Category : Recently Uploaded Files
Archive   : MSQ320.ZIP
Filename : BMG.C

 
Output of file : BMG.C contained in archive : MSQ320.ZIP
/* bmg - emulate Boyer-More-Gosper routines, without actually doing
it, because MSGED/SQ doesn't use the proper functionality, for
unknown reasons. */
/* Written by Paul Edwards and released to the public domain */

#include
#include

#include "bmg.h"
#include "strextra.h"

static char search_string[256];

void bmg_setsearch(char *search)
{
strcpy(search_string, search);
return;
}

char *bmg_search(char *text)
{
return (bmg_find(text, search_string));
}

char *bmg_find(char *text, char *search)
{
int lent, lens;
char *endText;
char *p;
register int searchStart;

lent = strlen(text);
lens = strlen(search);
if (lens > lent)
{
return (NULL);
}
searchStart = toupper(*search);
p = text;
endText = p + (lent - lens) + 1;
for (; p != endText; p++)
{
if (toupper(*p) == searchStart)
{
if (strncmpi(p, search, lens) == 0)
{
return (p);
}
}
}
return (NULL);
}


  3 Responses to “Category : Recently Uploaded Files
Archive   : MSQ320.ZIP
Filename : BMG.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/