From 9e7d459d47907accbc496f2f1c4c74f131086873 Mon Sep 17 00:00:00 2001 From: taw27 Date: Fri, 28 Sep 2007 23:58:28 +0000 Subject: s/reflectioncontext/reflectionlist/ git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@137 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/cache.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/cache.c') diff --git a/src/cache.c b/src/cache.c index f3b85af..eb164aa 100644 --- a/src/cache.c +++ b/src/cache.c @@ -28,17 +28,17 @@ typedef struct struct_cacheheader { double scale; } CacheHeader; -ReflectionContext *cache_load(const char *filename) { +ReflectionList *cache_load(const char *filename) { FILE *f; CacheHeader ch; - ReflectionContext *rctx; + ReflectionList *reflectionlist; size_t cachedreflection_size; int i; cachedreflection_size = sizeof(Reflection) - sizeof(Reflection *); - rctx = reflection_init(); + reflectionlist = reflection_init(); f = fopen(filename, "rb"); if ( !f ) { fprintf(stderr, "Couldn't read reflections from cache\n"); @@ -58,22 +58,22 @@ ReflectionContext *cache_load(const char *filename) { fprintf(stderr, "Couldn't read reflections from cache\n"); fclose(f); free(cr); - reflection_clear(rctx); + reflection_clear(reflectionlist); return NULL; } cr->next = NULL; /* Guarantee swift failure in the event of a screw-up */ //printf("reading (%f,%f,%f) i=%f (%d,%d,%d) %d\n",cr->x,cr->y,cr->z,cr->intensity,cr->h,cr->k,cr->l,cr->type); - reflection_add_from_reflection(rctx, cr); + reflection_add_from_reflection(reflectionlist, cr); } fclose(f); - return rctx; + return reflectionlist; } -int cache_save(const char *input_filename, ReflectionContext *rctx) { +int cache_save(const char *input_filename, ReflectionList *reflectionlist) { FILE *f; CacheHeader ch; @@ -91,7 +91,7 @@ int cache_save(const char *input_filename, ReflectionContext *rctx) { cachedreflection_size = sizeof(Reflection) - sizeof(Reflection *); count = 0; - r = rctx->reflections; + r = reflectionlist->reflections; while ( r != NULL ) { count++; r = r->next; @@ -108,7 +108,7 @@ int cache_save(const char *input_filename, ReflectionContext *rctx) { ch.scale = 0.; //temp, currently doesn't do anything fwrite(&ch, sizeof(CacheHeader), 1, f); - r = rctx->reflections; + r = reflectionlist->reflections; while ( r != NULL ) { fwrite(r, cachedreflection_size, 1, f); /* Write the reflection block, stopping just short of the "next" pointer */ -- cgit v1.2.3