📄 htstring.h
字号:
/* W3C Sample Code Library libwww Generic String Management! Generic String Management!*//*** (c) COPYRIGHT MIT 1995.** Please first read the full copyright statement in the file COPYRIGH.*//*These functions provide functionality for case-independent string comparisonand allocations with copies etc.This module is implemented by HTString.c, and itis a part of the W3CSample Code Library.*/#ifndef HTSTRING_H#define HTSTRING_H/*. Dynamic String Manipulation.These two functions are dynamic versions of strcpy andstrcat. They use malloc for allocating space forthe string. If StrAllocCopy is called with a non-NULL dest,then this is freed before the new value is assigned so that only thelast string created has to be freed by the user. IfStrAllocCat is called with a NULL pointer as destination thenit is equivalent to StrAllocCopy. */#define StrAllocCopy(dest, src) HTSACopy (&(dest), src)#define StrAllocCat(dest, src) HTSACat (&(dest), src)extern char * HTSACopy (char **dest, const char *src);extern char * HTSACat (char **dest, const char *src);/*The next two functions take a variable number of strings and cats them togetherusing dynamic memory. This is basically like a simple form for sprintf wherethe only argument is char *. One day we should turn this intoa real dynamic sprintf().*/extern char * StrAllocMCopy (char ** dest, ...);extern char * StrAllocMCat (char ** dest, ...);/*The last argument MUST be NULL as we otherwise don't know when the argumentlist stops.. Case-insensitive String Comparison.The usual routines (comp instead of cmp) had some problem.*/extern int strcasecomp (const char *a, const char *b);extern int strncasecomp (const char *a, const char *b, int n);/*. Tail String Comparison.Like strcmp, but match the tail of s2 (used for cookie domain comparison)*/extern int tailcomp(const char * s1, const char * s2);extern int tailcasecomp(const char * s1, const char * s2);/*. String Comparison with Wild Card Match.String comparison function for file names with one wildcard * in the template.Arguments are: tmpl is a template string to match the name against. agaist, may contain a single wildcard character * which matches zero or more arbitrary characters. name is the name to be matched agaist the template.Returns empty string ("") if perfect match, pointer to part matched by wildcardif any, or NULL if no match. This is basically the same as YES if match,else NO.*/extern char * HTStrMatch (const char * tmpl, const char * name);extern char * HTStrCaseMatch (const char * tmpl, const char * name);/*. Case-insensitive strstr.This works like strstr() but is not case-sensitive.*/extern char * HTStrCaseStr (char * s1, char * s2);/*. Strip white space off a string.Return value points to first non-white character, or to '/0' if none. Alltrailing white space is OVERWRITTEN with zero.*/extern char * HTStrip (char * s);/**/#endif /* !HTSTRING_H *//* @(#) $Id: HTString.html,v 2.38 1999/07/31 01:27:55 raff Exp $*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -