00001 /* BeeOS v0.1. Created: 2003/03/03 Modified: 2004/03/03 00002 * Copyright (C) 2004 Paul Harvey - ROMA, Australia. 00003 * csirac@users.sourceforge.net 00004 * - PLEASE DON'T LOOK AT THIS CODE - IT IS DISGUSTING! 00005 * - Full rewrite in progress. 00006 * - "what was I thinking - must have been bored" :-) 00007 */ 00008 00009 /* This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00026 #include "../include/beeos.h" 00027 #include "../include/bstring.h" 00028 /*@-exportheader@*/ /* These functions ARE exported but splint doesn't agree */ 00029 00035 ushort bstrlen (char *pString) 00036 { 00037 ushort i = 0; 00038 00039 while (*pString++ != '\0') i++; 00040 00041 return i; 00042 } 00043 00051 ushort bstrncpy(char *pDst, char *pSrc, ushort maxn) 00052 { 00055 ushort i = 0; 00056 00057 while ((*pSrc != '\0') && (i++ < maxn)) *pDst++ = *pSrc++; 00058 *pDst = '\0'; 00059 00060 return i; 00061 } 00062 00069 void bmemset(char *pDst, char pattern, ushort len) 00070 { 00071 while (len-- > 0) { 00072 *pDst++ = pattern; 00073 }; 00074 00075 return; 00076 } 00077 00084 void bmemcpy(char *pDst, char *pSrc, ushort len) 00085 { 00086 while (len-- > 0) { 00087 *pDst++ = *pSrc++; 00088 } 00089 00090 return; 00091 }