Category : Files from Magazines
Archive   : PJ93.ZIP
Filename : TOKEN.C

 
Output of file : TOKEN.C contained in archive : PJ93.ZIP
/*
* Source Code Illustrating Use of VM Calls
* by Stephen Kuhn (The Iliad Group)
*/

typedef unsigned long TOKEN;

typedef TOKEN TOKLINE;
typedef TOKLINE STRING;
typedef struct strline STRLINE;

struct strline {
TOKLINE next; /* token of next line in chain */
TOKLINE prev; /* token of prev line in chain */
STRING text; /* token of text for this line */
};

#define lineref(linetok) ((STRLINE *)vmderef(linetok))
#define stringref(stringtok) ((char *)vmderef(stringtok))
#define TOKLINE0 ((TOKLINE)0)
#define STRING0 ((STRING)0)

/* This function takes a head line token and a tail line token and
scans the lines between head and tail (inclusive) for a line that
begins with a number sign "#".

Returns the token of the line if found, TOKLINE0 if not found.
*/

TOKLINE linescan(headtok, tailtok)

{
TOKLINE line;

for (line=headtok; line != TOKLINE0; line=lineref(line)->next)
{
if (*stringref(lineref(line)->text) == '#')
return(line);
}
return(TOKLINE0);
}


  3 Responses to “Category : Files from Magazines
Archive   : PJ93.ZIP
Filename : TOKEN.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/