Category : C Source Code
Archive   : ABOUTNEW.ZIP
Filename : NDXFIND.C

 
Output of file : NDXFIND.C contained in archive : ABOUTNEW.ZIP
#include "stdio.h"
#include "ndx.h"
/*$LISTMACRO*/

long ndxfind(ndxfile,target_key,current_key,MAX_KEY_SIZE)
FILE *ndxfile; /* Must be open in binary mode */
char target_key[];
int MAX_KEY_SIZE;
{
long key_ptr,result;
int still_looking=1;
int bufsize;
int lenpos;
if (rewind(ndxfile)) return -12;
lenpos=getc(ndxfile);
bufsize=MAX_KEY_SIZE+2;
result=-1;
key_ptr=0;
while (still_looking)
{
if (still_looking=fread(&key_ptr,lenpos,1,ndxfile))
if (still_looking=fgets(current_key,bufsize,ndxfile))
if (!(still_looking=!comp(target_key,current_key)))
result=key_ptr;
}
return result; /* not found */
}


  3 Responses to “Category : C Source Code
Archive   : ABOUTNEW.ZIP
Filename : NDXFIND.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/