ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
(Generate patch)

Comparing deliantra/server/include/util.h (file contents):
Revision 1.86 by root, Sat Jan 3 01:04:19 2009 UTC vs.
Revision 1.87 by root, Mon Jan 12 03:40:21 2009 UTC

676 erase (&obj); 676 erase (&obj);
677 } 677 }
678}; 678};
679 679
680// basically does what strncpy should do, but appends "..." to strings exceeding length 680// basically does what strncpy should do, but appends "..." to strings exceeding length
681// returns the number of bytes actually used (including \0)
681void assign (char *dst, const char *src, int maxlen); 682int assign (char *dst, const char *src, int maxsize);
682 683
683// type-safe version of assign 684// type-safe version of assign
684template<int N> 685template<int N>
685inline void assign (char (&dst)[N], const char *src) 686inline int assign (char (&dst)[N], const char *src)
686{ 687{
687 assign ((char *)&dst, src, N); 688 return assign ((char *)&dst, src, N);
688} 689}
689 690
690typedef double tstamp; 691typedef double tstamp;
691 692
692// return current time as timestamp 693// return current time as timestamp

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines