|
NAMEStrAlloc, StrAppend, StrAppendMax, StrContains, StrCopy, StrCopyMax, StrDuplicate, StrDuplicateMax, StrEqual, StrEqualMax, StrEqualCase, StrEqualCaseMax, StrError, StrFormat, StrFormatMax, StrFormatDateMax, StrFree, StrHash, StrIndex, StrIndexLast, StrLength, StrMatch, StrMatchCase, StrScan, StrSpanFunction, StrSubstring, StrSubstringMax, StrTokenize, StrToDouble, StrToFloat, StrToLong, StrToUnsignedLong, StrToUpper - string functions SYNOPSIS
cc ... -ltrio -lm #include <strio.h> See section Functions below for the prototypes of the string functions. DESCRIPTIONThis package renames, fixes, and extends the C string handling functions. NAMINGRenaming is done to provide more clear names, to provide a consistant naming and argument policy, and to hide portability issues. * All functions starts with "Str". * Target is always the first argument, if present, except where the target is optional, such as StrToDouble(). * Functions requiring a size for target ends with "Max", and the size is always the second argument. FIXINGFixing is done to avoid subtle error conditions. For example, strncpy() does not terminate the result with a zero if the source string is bigger than the maximal length, so technically the result is not a C string anymore. StrCopyMax() makes sure that the result is zero terminated. EXTENDINGExtending is done to provide a richer set of fundamental functions. This includes wildcard matching (StrMatch()) and calculation of hash values (StrHash()). FUNCTIONS
char *StrAlloc(size_t size);
char *StrAppend(char *target, char *source);
char *StrAppendMax(char *target, size_t max, const char *source);
int StrContains(const char *string, const char *substring);
char *StrCopy(char *target, const char *source);
char *StrCopyMax(char *target, size_t max, const char *source);
char *StrDuplicate(const char *source);
char *StrDuplicateMax(const char *source, size_t max);
int StrEqual(const char *first, const char *second);
int StrEqualMax(const char *first, size_t max, const char *second);
int StrEqualCase(const char *first, const char *second);
int StrEqualCaseMax(const char *first, size_t max, const char *second);
const char *StrError(int errno);
int StrFormat(char *target, const char *format, ...);
int StrFormatMax(char *target, size_t max, const char *format, ...);
int StrFormatDateMax(char *target, size_t max, const char *format, const struct tm *datetime);
int StrFree(char *target);
unsigned long StrHash(const char *source, int type);
char *StrIndex(char *string, int character);
char *StrIndexLast(char *string, int character);
size_t StrLength(char *source);
int StrMatch(char *string, char *pattern);
int StrMatchCase(char *string, char *pattern);
int StrScan(char *source, const char *format, ...);
size_t StrSpanFunction(char *target, int (*Function)(int));
char *StrSubstring(const char *string, const char *substring);
char *StrSubstringMax(const char *string, size_t max, const char *substring);
char *StrTokenize(char *target, const char *delimiter);
double StrToDouble(const char *source, const char **target);
float StrToFloat(const char *source, const char **target);
long StrToLong(const char *source, const char **target, int base);
unsigned long StrToUnsignedLong(const char *source, const char **target, int base);
int StrToUpper(char *target); SEE ALSOtrio_printf (3), trio_scanf (3) LEGAL ISSUESCopyright (C) 1998-2000 Bjorn Reese and Daniel Stenberg. Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. This HTML page was made with roffit. |
Web page edited by daniel at haxx.se, modified April 05, 2005