CString.h

Go to the documentation of this file.
00001 #ifndef __CSTRING_H__
00002 #define __CSTRING_H__
00003 
00004 namespace oasys {
00005 
00006 //
00007 // Byte oriented functions
00008 // 
00009 
00018 int cstring_copy(char* dest, size_t dest_size, const char* src)
00019 {
00020     if (dest == 0 || src == 0) 
00021     {
00022         return 0;
00023     }
00024 
00025     int cc = 0;
00026     while (dest_size > 1 && *src != '\0') 
00027     {
00028         *dest = *src;
00029         ++dest;
00030         ++src;
00031         --dest_size;
00032         ++cc;
00033     }
00034 
00035     *dest = '\0';
00036 
00037     return cc;
00038 }
00039 
00040 //
00041 // Wide-Character oriented functions (XXX/bowei - TODO: support for
00042 // wide chars)
00043 // 
00044 
00045 };
00046 
00047 #endif /* __CSTRING_H__ */

Generated on Fri Dec 22 14:47:58 2006 for DTN Reference Implementation by  doxygen 1.5.1