Index: alien_formats/altium/Makefile =================================================================== --- alien_formats/altium/Makefile (nonexistent) +++ alien_formats/altium/Makefile (revision 35452) @@ -0,0 +1,7 @@ +CFLAGS = -Wall -g + +test: test.o pcbdoc_bin.o + +test.o: test.c + +pcbdoc_bin.o: pcbdoc_bin.c \ No newline at end of file Index: alien_formats/altium/pcbdoc_ascii.h =================================================================== --- alien_formats/altium/pcbdoc_ascii.h (nonexistent) +++ alien_formats/altium/pcbdoc_ascii.h (revision 35452) @@ -0,0 +1,32 @@ +/*** glue layer ***/ + +/* ucdf emulation (ran on unpacked file for easier debugging) */ +#include +#define ucdf_file_t FILE + +static inline long ucdf_fread(ucdf_file_t *fp, char *dst, long len) +{ + return fread(dst, 1, len, fp); +} + + +/* pcbdoc_ascii emulation */ +typedef struct altium_field_s { + int type; /* derived from ->key */ + const char *key; + const char *val; +} altium_field_t; + +typedef struct altium_record_s { + int type; /* derived from ->key */ + const char *type_s; +} altium_record_t; + +typedef struct altium_tree_s { + int dummy; +} altium_tree_t; + +typedef struct rnd_hidlib_s { + int dummy; +} rnd_hidlib_t; + Index: alien_formats/altium/pcbdoc_bin.c =================================================================== --- alien_formats/altium/pcbdoc_bin.c (nonexistent) +++ alien_formats/altium/pcbdoc_bin.c (revision 35452) @@ -0,0 +1,15 @@ +#include "pcbdoc_ascii.h" + +typedef struct { + long alloced; + unsigned char *data; +} altium_buf_t; + + +int pcbdoc_bin_parse_board6(rnd_hidlib_t *hidlib, altium_tree_t *tree, ucdf_file_t *fp) +{ + + return -1; +} + + Index: alien_formats/altium/test.c =================================================================== --- alien_formats/altium/test.c (nonexistent) +++ alien_formats/altium/test.c (revision 35452) @@ -0,0 +1,26 @@ +#include +#include +#include "pcbdoc_ascii.h" + +int pcbdoc_bin_parse_board6(rnd_hidlib_t *hidlib, altium_tree_t *tree, ucdf_file_t *fp); + +int main(int argc, char *argv[]) +{ + const char *fn = "Data.dat"; + FILE *f; + int res; + altium_tree_t tree; + rnd_hidlib_t hidlib; + + f = fopen(fn, "rb"); + if (f == NULL) { + fprintf(stderr, "Can't open '%s' for read\n", fn); + exit(1); + } + + res = pcbdoc_bin_parse_board6(&hidlib, &tree, f); + + fclose(f); + + return res; +}