2 /*-------------------------------------------------------------------------*/
7 @version $Revision: 1.3 $
8 @brief Various string handling routines to complement the C lib.
10 This modules adds a few complementary string routines usually missing
11 in the standard C library.
13 /*--------------------------------------------------------------------------*/
16 $Id: inistrlib.h,v 1.3 2001/10/19 08:31:41 ndevilla Exp $
18 $Date: 2001/10/19 08:31:41 $
25 /*---------------------------------------------------------------------------
27 ---------------------------------------------------------------------------*/
30 /*---------------------------------------------------------------------------
32 ---------------------------------------------------------------------------*/
34 /*-------------------------------------------------------------------------*/
36 @brief Convert a string to lowercase.
37 @param s String to convert.
38 @return ptr to statically allocated string.
40 This function returns a pointer to a statically allocated string
41 containing a lowercased version of the input string. Do not free
42 or modify the returned string! Since the returned string is statically
43 allocated, it will be modified at each function call (not re-entrant).
45 /*--------------------------------------------------------------------------*/
46 char * inistrlwc(char * s
);
48 /*-------------------------------------------------------------------------*/
50 @brief Convert a string to uppercase.
51 @param s String to convert.
52 @return ptr to statically allocated string.
54 This function returns a pointer to a statically allocated string
55 containing an uppercased version of the input string. Do not free
56 or modify the returned string! Since the returned string is statically
57 allocated, it will be modified at each function call (not re-entrant).
59 /*--------------------------------------------------------------------------*/
60 char * inistrupc(char * s
);
62 /*-------------------------------------------------------------------------*/
64 @brief Skip blanks until the first non-blank character.
65 @param s String to parse.
66 @return Pointer to char inside given string.
68 This function returns a pointer to the first non-blank character in the
71 /*--------------------------------------------------------------------------*/
72 char * inistrskp(char * s
);
74 /*-------------------------------------------------------------------------*/
76 @brief Remove blanks at the end of a string.
77 @param s String to parse.
78 @return ptr to statically allocated string.
80 This function returns a pointer to a statically allocated string,
81 which is identical to the input string, except that all blank
82 characters at the end of the string have been removed.
83 Do not free or modify the returned string! Since the returned string
84 is statically allocated, it will be modified at each function call
87 /*--------------------------------------------------------------------------*/
88 char * inistrcrop(char * s
);
90 /*-------------------------------------------------------------------------*/
92 @brief Remove blanks at the beginning and the end of a string.
93 @param s String to parse.
94 @return ptr to statically allocated string.
96 This function returns a pointer to a statically allocated string,
97 which is identical to the input string, except that all blank
98 characters at the end and the beg. of the string have been removed.
99 Do not free or modify the returned string! Since the returned string
100 is statically allocated, it will be modified at each function call
103 /*--------------------------------------------------------------------------*/
104 char * inistrstrip(char * s
) ;
106 /*-------------------------------------------------------------------------*/
108 @brief Duplicate a string by allocating memory and copy the contents.
109 @param s String to duplicate.
110 @return ptr to dynamically allocated string.
112 This function returns a pointer to a dynamically allocated string,
113 which is identical to the input string.
114 Free the returned string when it is no longer used.
116 /*--------------------------------------------------------------------------*/
117 char *inistrdup(const char *s
);