Index: tester.c =================================================================== --- tester.c (revision 35422) +++ tester.c (revision 35423) @@ -1,6 +1,6 @@ #include "ucdf.h" -static void print_dir(ucdf_file_t *ctx, ucdf_direntry_t *dir, int level) +static void print_dir(ucdf_ctx_t *ctx, ucdf_direntry_t *dir, int level) { int n; ucdf_direntry_t *d; @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) { char *fn = "A.PcbDoc"; - ucdf_file_t ctx = {0}; + ucdf_ctx_t ctx = {0}; if (argc > 1) fn = argv[1]; Index: ucdf.c =================================================================== --- ucdf.c (revision 35422) +++ ucdf.c (revision 35423) @@ -76,12 +76,12 @@ return -1; \ } while(0) -static long sect_id2offs(ucdf_file_t *ctx, long id) +static long sect_id2offs(ucdf_ctx_t *ctx, long id) { return 512L + (id << ctx->ssz); } -static long load_int(ucdf_file_t *ctx, unsigned const char *src, int len) +static long load_int(ucdf_ctx_t *ctx, unsigned const char *src, int len) { int n, sh; long tmp, res = 0; @@ -107,7 +107,7 @@ return res; } -static int ucdf_read_hdr(ucdf_file_t *ctx) +static int ucdf_read_hdr(ucdf_ctx_t *ctx) { unsigned char buff[16]; @@ -165,7 +165,7 @@ return 0; } -static int ucdf_load_any_sat(ucdf_file_t *ctx, long *dst, long *idx) +static int ucdf_load_any_sat(ucdf_ctx_t *ctx, long *dst, long *idx) { int n; long id_per_sect = ctx->sect_size >> 2; @@ -180,7 +180,7 @@ return 0; } -static int ucdf_load_msat_(ucdf_file_t *ctx, long num_ids, long *idx) +static int ucdf_load_msat_(ucdf_ctx_t *ctx, long num_ids, long *idx) { int n; unsigned char buff[4]; @@ -194,7 +194,7 @@ return 0; } -static long ucdf_load_msat(ucdf_file_t *ctx, long num_ids, long *idx) +static long ucdf_load_msat(ucdf_ctx_t *ctx, long num_ids, long *idx) { unsigned char buff[4]; long next; @@ -211,7 +211,7 @@ return next; } -static int ucdf_read_sats(ucdf_file_t *ctx) +static int ucdf_read_sats(ucdf_ctx_t *ctx) { long next, n, idx = 0, id_per_sect = ctx->sect_size >> 2; @@ -274,7 +274,7 @@ long *diroffs; } dir_ctx_t; -static int ucdf_read_dir(ucdf_file_t *ctx, dir_ctx_t *dctx, long dirid, ucdf_direntry_t *parent, ucdf_direntry_t **de_out) +static int ucdf_read_dir(ucdf_ctx_t *ctx, dir_ctx_t *dctx, long dirid, ucdf_direntry_t *parent, ucdf_direntry_t **de_out) { long page = dirid / dctx->dirs_per_sect; long offs = dirid % dctx->dirs_per_sect; @@ -319,7 +319,7 @@ return 0; } -static int ucdf_read_dirs(ucdf_file_t *ctx) +static int ucdf_read_dirs(ucdf_ctx_t *ctx) { int res; long n, next; @@ -356,7 +356,7 @@ return res; } -int ucdf_open(ucdf_file_t *ctx, const char *path) +int ucdf_open(ucdf_ctx_t *ctx, const char *path) { ctx->f = fopen(path, "rb"); if (ctx->f == NULL) { Index: ucdf.h =================================================================== --- ucdf.h (revision 35422) +++ ucdf.h (revision 35423) @@ -63,7 +63,7 @@ long *msat; /* the master SAT read into memory */ long *sat; /* the whole SAT assembled and read into memory; entries are indexed by sector ID and contain the next sector ID within the chain */ long *ssat; /* the whole Short-SAT assembled and read into memory */ -} ucdf_file_t; +} ucdf_ctx_t; -int ucdf_open(ucdf_file_t *ctx, const char *path); +int ucdf_open(ucdf_ctx_t *ctx, const char *path);