Artifact ee8be6c1ff1b825ac059a512492378f41c037e35859f85eece13e39b5ab972d1:
- Executable file
r38/lisp/csl/cslbase/wstring.h
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1251) [annotate] [blame] [check-ins using] [more...]
/* wstring.h Copyright (C) 2003-2006 Gil Dabah, http://ragestorm.net/distorm/ This library is licensed under the BSD license. See the file COPYING. */ #ifndef ___WSTRING_H__ #define ___WSTRING_H__ #include <string.h> #include "diconfig.h" // Make sure the buffer isn't overflowed. #define MAX_TEXT_SIZE (60) typedef struct { unsigned int pos; unsigned char p[MAX_TEXT_SIZE]; } _WString; // Warning, this macro should be used only when the compiler knows the size of string in advance! // This macro is used in order to spare the call to strlen when the strings are known already. // Note: sizeof includes NULL terminated character. #define strcat_WSN(s, t) strcatlen_WS((s), (t), sizeof((t))-1) #define strcpy_WSN(s, t) strcpylen_WS((s), (t), sizeof((t))-1) void _FASTCALL_ strcpy_WS(_WString* s, const char* buf); void _FASTCALL_ strcpylen_WS(_WString* s, const char* buf, unsigned int len); void _FASTCALL_ strcatlen_WS(_WString* s, const char* buf, unsigned int len); _INLINE_ void strclear_WS(_WString* s) { s->p[0] = '\0'; s->pos = 0; } _INLINE_ void chrcat_WS(_WString* s, unsigned char ch) { s->p[s->pos] = ch; s->p[s->pos + 1] = '\0'; s->pos += 1; } #endif // ___WSTRING_H__