Diff for /libelwix/src/str.c between versions 1.1.1.1 and 1.2.4.1

version 1.1.1.1, 2013/01/17 10:05:35 version 1.2.4.1, 2013/05/26 20:03:19
Line 52  SUCH DAMAGE. Line 52  SUCH DAMAGE.
  * @arr = Pointer to array for free   * @arr = Pointer to array for free
  * return: none   * return: none
  */   */
inline voidvoid
 str_FreeNullTerm(char *** __restrict arr)  str_FreeNullTerm(char *** __restrict arr)
 {  {
         char **a;          char **a;
Line 73  str_FreeNullTerm(char *** __restrict arr) Line 73  str_FreeNullTerm(char *** __restrict arr)
  * @csDelim = Delimiter(s) for separate   * @csDelim = Delimiter(s) for separate
  * return: 0 error format; -1 error:: can`t read; >0 ok, number of items   * return: 0 error format; -1 error:: can`t read; >0 ok, number of items
  */   */
inline intint
 str_ArgsNum(const char *csArgs, const char *csDelim)  str_ArgsNum(const char *csArgs, const char *csDelim)
 {  {
         register int res;          register int res;
Line 298  str_Dig2Hex(ait_val_t *digz) Line 298  str_Dig2Hex(ait_val_t *digz)
  * @psLine = Text string   * @psLine = Text string
  * return: 0 nothing to do; !=0 Removed bytes   * return: 0 nothing to do; !=0 Removed bytes
  */   */
inline intint
 str_LTrim(char * __restrict psLine)  str_LTrim(char * __restrict psLine)
 {  {
         int pos = 0;          int pos = 0;
Line 320  str_LTrim(char * __restrict psLine) Line 320  str_LTrim(char * __restrict psLine)
  * @psLine = Text string   * @psLine = Text string
  * return: 0 nothing to do; !=0 Removed bytes   * return: 0 nothing to do; !=0 Removed bytes
  */   */
inline intint
 str_RTrim(char * __restrict psLine)  str_RTrim(char * __restrict psLine)
 {  {
         char *t, *pos;          char *t, *pos;
Line 341  str_RTrim(char * __restrict psLine) Line 341  str_RTrim(char * __restrict psLine)
  * @psLine = Text string   * @psLine = Text string
  * return: 0 nothing to do; !=0 Removed bytes   * return: 0 nothing to do; !=0 Removed bytes
  */   */
inline intint
 str_Trim(char * __restrict psLine)  str_Trim(char * __restrict psLine)
 {  {
         int ret = 0;          int ret = 0;
Line 358  str_Trim(char * __restrict psLine) Line 358  str_Trim(char * __restrict psLine)
  * @psLine = Text string   * @psLine = Text string
  * return: 0 nothing to do; 1 successful unquoted string   * return: 0 nothing to do; 1 successful unquoted string
  */   */
inline intint
 str_Unquot(char * __restrict psLine)  str_Unquot(char * __restrict psLine)
 {  {
         char *pos, *str = NULL;          char *pos, *str = NULL;
Line 383  str_Unquot(char * __restrict psLine) Line 383  str_Unquot(char * __restrict psLine)
         return 0;          return 0;
 }  }
   
   /*
    * str_Upper() - Convert all lower characters to upper
    *
    * @psLine = Text string
    * return: 0 nothing to do; !=0 converted chars
    */
   int
   str_Upper(char * __restrict psLine)
   {
           char *s;
           register int cx = 0;
   
           if (!psLine || !*psLine)
                   return 0;
   
           for (s = psLine; *s; s++)
                   if (islower(*s)) {
                           *s = toupper(*s);
                           cx++;
                   }
   
           return cx;
   }
   
   /*
    * str_Lower() - Convert all upper characters to lower
    *
    * @psLine = Text string
    * return: 0 nothing to do; !=0 converted chars
    */
   int
   str_Lower(char * __restrict psLine)
   {
           char *s;
           register int cx = 0;
   
           if (!psLine || !*psLine)
                   return 0;
   
           for (s = psLine; *s; s++)
                   if (isupper(*s)) {
                           *s = tolower(*s);
                           cx++;
                   }
   
           return cx;
   }

Removed from v.1.1.1.1  
changed lines
  Added in v.1.2.4.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>