00001 00002 /*-------------------------------------------------------------------------*/ 00003 /** 00004 @file strlib.h 00005 @author N. Devillard 00006 @date Jan 2001 00007 @version $Revision: 1.3 $ 00008 @brief Various string handling routines to complement the C lib. 00009 00010 This modules adds a few complementary string routines usually missing 00011 in the standard C library. 00012 */ 00013 /*--------------------------------------------------------------------------*/ 00014 00015 /* 00016 $Id: strlib.h,v 1.3 2001/10/19 08:31:41 ndevilla Exp $ 00017 $Author: ndevilla $ 00018 $Date: 2001/10/19 08:31:41 $ 00019 $Revision: 1.3 $ 00020 */ 00021 00022 #ifndef _STRLIB_H_ 00023 #define _STRLIB_H_ 00024 00025 /*--------------------------------------------------------------------------- 00026 Includes 00027 ---------------------------------------------------------------------------*/ 00028 00029 #include <stdio.h> 00030 #include <stdlib.h> 00031 00032 /*--------------------------------------------------------------------------- 00033 Function codes 00034 ---------------------------------------------------------------------------*/ 00035 00036 /*-------------------------------------------------------------------------*/ 00037 /** 00038 @brief Convert a string to lowercase. 00039 @param s String to convert. 00040 @return ptr to statically allocated string. 00041 00042 This function returns a pointer to a statically allocated string 00043 containing a lowercased version of the input string. Do not free 00044 or modify the returned string! Since the returned string is statically 00045 allocated, it will be modified at each function call (not re-entrant). 00046 */ 00047 /*--------------------------------------------------------------------------*/ 00048 char * strlwc(const char * s); 00049 00050 /*-------------------------------------------------------------------------*/ 00051 /** 00052 @brief Convert a string to uppercase. 00053 @param s String to convert. 00054 @return ptr to statically allocated string. 00055 00056 This function returns a pointer to a statically allocated string 00057 containing an uppercased version of the input string. Do not free 00058 or modify the returned string! Since the returned string is statically 00059 allocated, it will be modified at each function call (not re-entrant). 00060 */ 00061 /*--------------------------------------------------------------------------*/ 00062 char * strupc(char * s); 00063 00064 /*-------------------------------------------------------------------------*/ 00065 /** 00066 @brief Skip blanks until the first non-blank character. 00067 @param s String to parse. 00068 @return Pointer to char inside given string. 00069 00070 This function returns a pointer to the first non-blank character in the 00071 given string. 00072 */ 00073 /*--------------------------------------------------------------------------*/ 00074 char * strskp(char * s); 00075 00076 /*-------------------------------------------------------------------------*/ 00077 /** 00078 @brief Remove blanks at the end of a string. 00079 @param s String to parse. 00080 @return ptr to statically allocated string. 00081 00082 This function returns a pointer to a statically allocated string, 00083 which is identical to the input string, except that all blank 00084 characters at the end of the string have been removed. 00085 Do not free or modify the returned string! Since the returned string 00086 is statically allocated, it will be modified at each function call 00087 (not re-entrant). 00088 */ 00089 /*--------------------------------------------------------------------------*/ 00090 char * strcrop(char * s); 00091 00092 /*-------------------------------------------------------------------------*/ 00093 /** 00094 @brief Remove blanks at the beginning and the end of a string. 00095 @param s String to parse. 00096 @return ptr to statically allocated string. 00097 00098 This function returns a pointer to a statically allocated string, 00099 which is identical to the input string, except that all blank 00100 characters at the end and the beg. of the string have been removed. 00101 Do not free or modify the returned string! Since the returned string 00102 is statically allocated, it will be modified at each function call 00103 (not re-entrant). 00104 */ 00105 /*--------------------------------------------------------------------------*/ 00106 char * strstrip(char * s) ; 00107 00108 #endif