1 /* (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 Stijn van Dongen 2 * (C) Copyright 2006, 2007, 2008, 2009 Stijn van Dongen 3 * 4 * This file is part of tingea. You can redistribute and/or modify tingea 5 * under the terms of the GNU General Public License; either version 3 of the 6 * License or (at your option) any later version. You should have received a 7 * copy of the GPL along with tingea, in the file COPYING. 8 */ 9 10 #ifndef tingea_ding 11 #define tingea_ding 12 13 #include <string.h> 14 #include "types.h" 15 #include "ting.h" 16 17 18 char* mcxStrDup 19 ( const char* str 20 ) ; 21 22 char* mcxStrNDup 23 ( const char* str 24 , dim n 25 ) ; 26 27 mcxstatus mcxStrTol 28 ( const char* s 29 , long* value 30 , char** end 31 ) ; 32 33 mcxstatus mcxStrToul 34 ( const char* s 35 , ulong* value 36 , char** end 37 ) ; 38 39 40 /* 41 * if len < 0, strlen(p) is used. 42 */ 43 44 dim mcxStrCountChar 45 ( const char* p 46 , char c 47 , ofs len /* -1 for don't know */ 48 ) ; 49 50 char* mcxStrChrIs 51 ( const char* src 52 , int (*fbool)(int c) 53 , ofs len /* -1 for don't know */ 54 ) ; 55 56 char* mcxStrChrAint 57 ( const char* src 58 , int (*fbool)(int c) 59 , ofs len /* -1 for don't know */ 60 ) ; 61 62 char* mcxStrRChrIs 63 ( const char* src 64 , int (*fbool)(int c) 65 , ofs offset /* -1 for don't know */ 66 ) ; 67 68 char* mcxStrRChrAint 69 ( const char* src 70 , int (*fbool)(int c) 71 , ofs offset /* -1 for don't know */ 72 ) ; 73 74 75 #define MCX_MEMPRINT_REVERSE 1 76 #define MCX_MEMPRINT_NOSPACE 2 77 78 79 /* Strides in char units, treats/truncates each unit 80 * as/to an 8-bit entity. 81 */ 82 83 mcxTing* mcxMemPrint 84 ( mcxTing* ting 85 , void* p 86 , dim n_bytes 87 , mcxbits flags 88 ) ; 89 90 91 int mcxEditDistance 92 ( const char* s1 93 , const char* s2 94 , int* lcs 95 ) ; 96 97 98 int mcxSetenv 99 ( const char* kv 100 ) ; 101 102 #endif 103 104 105