aboutsummaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-09-28 23:58:28 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-09-28 23:58:28 +0000
commit9e7d459d47907accbc496f2f1c4c74f131086873 (patch)
treec5a0a7a472929f7003bc3e5ebd8ec30581424648 /src/cache.c
parent555bc4f60c845bf47aee94e4b7963382838c9f57 (diff)
s/reflectioncontext/reflectionlist/
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@137 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c18
1 files changed, 9 insertions, 9 deletions
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 */