/* * the chache engine - code */ #include #include #include #include #include #include "../floatimg.h" #include "cachengn.h" extern int verbosity; static int nombre_slots = -1; static int index_slot = -1; static FimgCacheEntry *le_cache = NULL; /* ------------------------------------------------------------ */ void cachengn_print_version(int k) { printf("\t!!! this is the version ZERO !!!\n"); fprintf(stderr, "sizeof cache entry: %ld\n", sizeof(FimgCacheEntry)); if (k) fimg_print_version(0); } /* ------------------------------------------------------------ */ /* * */ int init_empty_cache(int iw, int ih, int szc, int wtfparam) { int idx; fprintf(stderr, ">>> %s ( %d %d %d %d )\n", __func__, iw, ih, szc, wtfparam); /* MOLLYGUARD : don't init TWICE, please */ if (NULL != le_cache) { fprintf(stderr, "%s: there is a cache at %p\n", __func__, le_cache); return -2; } /* allocate an prepare memory */ if ( NULL==(le_cache=calloc(szc, sizeof(FimgCacheEntry))) ) { fprintf(stderr, "%s: no memory, sorry...\n", __func__); return -3; } fprintf(stderr, " slot array at %p\n", le_cache); for (idx=0; idx>> %s ( '%s' %d )\n", __func__, fname, notused); /* please add molly guard ! */ if (notused) fprintf(stderr, "in %s, notused was %d\n", __func__, notused); /* is the floatimg already in the cahce ? */ for (idx=0; idx>> %s ( Ox%X )\n", __func__, flags); /* please add molly guard here */ fprintf(stderr, "cache at %p : %d slots, idx = %d\n", le_cache, nombre_slots, index_slot); for (idx=0; idx