1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
samba-mirror/source3/aparser/vluke.c
Andrew Tridgell feb3afbb91 renamed the harness program to vluke (for "virtual luke")
added a couple of sample .prs files
(This used to be commit 70f68209da)
2000-05-12 14:35:15 +00:00

39 lines
705 B
C

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include "parser.h"
#include "test.h"
int main(int argc, char *argv[])
{
BOOL ret;
TEST_STRUCT *q_u;
char *desc = TEST_NAME;
char *fname = argv[1];
int fd;
struct stat st;
prs_struct ps;
if (argc < 2) {
printf("usage: vluke <file>\n");
exit(1);
}
fd = open(fname,O_RDONLY);
fstat(fd, &st);
prs_init(&ps, 0, 4, MARSHALL);
ps.is_dynamic=True;
prs_read(&ps, fd, st.st_size, 0);
dump_data(0, ps.data_p, ps.buffer_size);
ps.data_offset = 0;
ps.io = UNMARSHALL;
ret = TEST_FUNC(desc, &q_u, &ps, 1);
printf("ret=%d\n", ret);
return !ret;
}