Diff for /libaitio/src/Attic/tools.c between versions 1.7 and 1.9

version 1.7, 2011/12/13 02:23:08 version 1.9, 2012/03/15 01:52:23
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 297  io_FreeNullTerm(char *** __restrict arr) Line 297  io_FreeNullTerm(char *** __restrict arr)
 }  }
   
 /*  /*
    * io_Path2File() - Parse and make path/filename pair
    *
    * @csArgs = Input argument line
    * @psPath = Output Path, if ==NULL path not returned
    * @pathLen = Size of path array
    * @psFile = Output File
    * @fileLen = Size of file array
    * return: 0 error format; -1 error:: can`t read; >0 ok, number of readed items
    */
   inline int
   io_Path2File(const char * __restrict csArgs, char * __restrict psPath, 
                   int pathLen, char * __restrict psFile, int fileLen)
   {
           char *pos, *psBuf;
   
           if (!csArgs || !psFile || !fileLen)
                   return -1;
           if (psPath && !pathLen)
                   return -1;
   
           psBuf = strdup(csArgs);
           if (!psBuf) {
                   LOGERR;
                   return -1;
           }
   
           pos = strrchr(psBuf, '/');
           if (!pos) {
                   strlcpy(psFile, psBuf, fileLen);
   
                   free(psBuf);
                   return 1;
           } else
                   *pos++ = 0;
   
           strlcpy(psFile, pos, fileLen);
           if (psPath)
                   strlcpy(psPath, psBuf, pathLen);
   
           free(psBuf);
           return 2;
   }
   
   /*
  * io_ether_ntoa() Convert ethernet address to string   * io_ether_ntoa() Convert ethernet address to string
  * @n = ethernet address structure, like struct ether_addr   * @n = ethernet address structure, like struct ether_addr
  * @a = string   * @a = string
Line 411  io_n2addr(io_sockaddr_t * __restrict addr, ait_val_t * Line 455  io_n2addr(io_sockaddr_t * __restrict addr, ait_val_t *
                         return ret;                          return ret;
         }          }
   
        AIT_FREE_VAL(val);        if (!AIT_ISEMPTY(val))
                 AIT_FREE_VAL(val);
         AIT_SET_STR(val, ret);          AIT_SET_STR(val, ret);
        return ret;        return (const char*) AIT_GET_STR(val);
 }  }
   
 /*  /*

Removed from v.1.7  
changed lines
  Added in v.1.9


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