DragonFly On-Line Manual Pages

Search: Section:  


sf_misc(3)            DragonFly Library Functions Manual            sf_misc(3)

NAME

eq, ecq - string equality test. countchar, countchar2, countstr - count characters and strings within the string. replace, replace_detach, limittextwidth - miscellaneous text functions.

SYNOPSIS

#include <strfunc.h> Equality test: int eq(const char *a, const char *b); Case-insensitive equality test: int ecq(const char *a, const char *b); Count the number of specified character within the string: int countchar(const char *string, char what2countChar); Count the number of specified characters within the string: int countchar2(const char *string, char *what2countSet); Count the number of specified little strings within the big string: int countstr(const char *string, char *what2countString); Replace the substring: char * replace(char *string, char *what, char *to); char * replace_detach(); Limit text width by inserting line breaks: char * limittextwidth(char *text, size_t width);

DESCRIPTION

eq() and ecq() function are just short names for !strcmp(3) and !strcasecmp(3) countchar() and countchar2() both used to compute the number of specified character's occurences within the specified string. countstr() used to compute the number of little string's occurences within the big string. replace() replaces the occurences of string what to the specified string to and able to do it when invoked recursive. The string is stored inside the library and if you want it to be completely yours, call replace_detach(). limittextwidth() ALTERS the source string, inserting the newlines ('\n') to break the long lines. Long line is the line which is more then width characters in length.

SEE ALSO

strfunc(3), sf_cgi(3), sf_mime(3), sf_fmt(3), sf_mem(3).

AUTHORS

Lev Walkin <vlm@lionet.info> DragonFly 6.5-DEVELOPMENT October 1, 2000 DragonFly 6.5-DEVELOPMENT

Search: Section: