Category : Files from Magazines
Archive   : VOL11N12.ZIP
Filename : STRING.I

 
Output of file : STRING.I contained in archive : VOL11N12.ZIP

// a, b, p, q & r should be of "char [{near|far}] *" form

// the following are boolean in nature

#define IsStrNULL(p) (!(p)) // NULL?
#define IsStrNull(p) (!*(p)) // Null ("" or "\0")?

#define IsStrEqual(a,b) (!strcmp(a,b)) // equal?
#define IsStrEquiv(a,b) (!stricmp(a,b)) // equivalent?

#define IsStrOnly !StrVerify // verifies chars are in string

// the following are of "p = StrFunction(q, r)" form

#define StrNull(q) strchr(q,'\0')
// find string-end Null; p -> null terminator

#define StrCrop(q,r) (StrTrunc(q,r),StrLeft(q,r))
// crop both ends, copy; p==q: first non-"r"-char

#define StrLeft(q,r) strcpy(q,StrSkip(q,r))
// crop left side, copy; p==q: first non-"r"-char
#define StrLeftTo(q,r) strcpy(q,StrSkipTo(q,r))
// crop left side, copy; p==q: first "r"-char

#define StrSkip(q,r) (&(q)[strspn(q,r)])
// skip chars in "r"; p -> first non-"r"-char
#define StrSkipTo(q,r) (&(q)[strcspn(q,r)])
// skip to char in "r"; p -> first "r"-char

#define StrPlural(n,s,p) ((n)==1?(s):(p))
// if singular: "", "y"; if plural: "s", "es", "ies"

// BEWARE OF SIDE EFFECTS IN THE FOLLOWING

#define SubStrCL(to,from,col,len) SubStr(to,from,(col)-1,len)
#define SubStrCC(to,from,col1,col2) SubStr(to,from,(col1)-1,(col2)-(col1)+1)
#define SubStrOO(to,from,off1,off2) SubStr(to,from,off1,(off2)-(off1)+1)
#define SubStrOL SubStr // (to,from,off,len)

// the following are of "p = StrFunction(q, r)" form

#define TABSTOPS 8 // columns per tab in StrDetab and StrEntab

extern char *StrDetab(char *); // remove tabs, expanding
extern char *StrEntab(char *); // insert tabs, contracting
extern char *StrIndex(char *, char *); // same as MS-C "strstr"
extern char *StrTrunc(char *, char *); // truncates chars from end
extern char *StrUcLc(char *); // makes upper/lower case
extern char *StrVerify(char *, char *); // verifies chars are in string
extern char *SubStr(char *, char *, int, int); // PL/I "substr"



  3 Responses to “Category : Files from Magazines
Archive   : VOL11N12.ZIP
Filename : STRING.I

  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/