Artifact 2c611ba15ba10a498ab6c937fb37df1bb540d783d596a951e7585eab6ae27d51:
- Executable file
r38/lisp/csl/cslbase/wstring.c
— 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: 1107) [annotate] [blame] [check-ins using] [more...]
/* wstring.c Copyright (C) 2003-2006 Gil Dabah, http://ragestorm.net/distorm/ This library is licensed under the BSD license. See the file COPYING. */ #include "wstring.h" /* // Protected buffers. void strcpy_WS(_WString* s, const char* buf) { s->pos = (unsigned int)strlen(buf); if (s->pos >= MAX_TEXT_SIZE - 1) s->pos = MAX_TEXT_SIZE-1; memcpy((char*)s->p, buf, s->pos); s->p[s->pos] = '\0'; } void strcat_WS(_WString* s, const char* buf) { unsigned int l = (unsigned int)strlen(buf); if ((s->pos + l) >= MAX_TEXT_SIZE - 1) l = MAX_TEXT_SIZE - s->pos - 1; memcpy((char*)&s->p[s->pos], buf, l); s->pos += l; s->p[s->pos] = '\0'; }*/ void _FASTCALL_ strcpy_WS(_WString* s, const char* buf) { s->pos = (unsigned int)strlen(buf); memcpy((char*)s->p, buf, s->pos + 1); } void _FASTCALL_ strcpylen_WS(_WString* s, const char* buf, unsigned int len) { s->pos = len; memcpy((char*)s->p, buf, len + 1); } void _FASTCALL_ strcatlen_WS(_WString* s, const char* buf, unsigned int len) { memcpy((char*)&s->p[s->pos], buf, len + 1); s->pos += len; }