static offset FindEntryPosInToc( TocEntryId *e ) /*************************************************/ { TocEntry searchEntry; TocEntry *entry; searchEntry.e = *e; entry = FindHTableElem( Toc, &searchEntry ); if( entry != NULL ) { return( OffFromToc( entry->pos ) ); } else { return( BOGUS ); // return bogus position; likely to cause alignment exception } }
static void CheckNewFile( mod_entry *mod, file_list *list, int AlwaysCheckUsingDate) /*********************************************************/ { time_t modtime; if( !(LinkFlags & GOT_CHGD_FILES) || AlwaysCheckUsingDate ) { if( QModTime( list->file->name, &modtime ) || modtime > mod->modtime ) { list->status |= STAT_HAS_CHANGED; } } else { if( FindHTableElem( Root->modFilesHashed, list->file->name ) ) { list->status |= STAT_HAS_CHANGED; } } }
static void AddToToc( TocEntryId *e ) /***********************************/ { TocEntry searchEntry; TocEntry * entry; searchEntry.e = *e; if( FindHTableElem( Toc, &searchEntry ) == NULL ) { entry = ChkLAlloc( sizeof( *entry ) ); entry->e = *e; entry->pos = TocSize; TocSize += sizeof( offset ); AddHTableElem( Toc, entry ); } }