|
|
00001 /* 00002 * Copyright (c) 1989 by the Massachusetts Institute of Technology. 00003 * For copying and distribution information, see the file 00004 * "mit-copyright.h". 00005 * 00006 * Modified for jwgc by Daniel Henninger. 00007 */ 00008 00009 #include "mit-copyright.h" 00010 00011 #include "character_class.h" 00012 00013 /* 00014 * It may look like we are passing the cache by value, but since it's really 00015 * an array we are passing by reference. C strikes again.... 00016 */ 00017 00018 static character_class cache; 00019 00020 /* character_class */ 00021 char * 00022 string_to_character_class(str) 00023 string str; 00024 { 00025 int i; 00026 00027 (void) memset(cache, 0, sizeof(cache)); 00028 00029 for (i = 0; i < strlen(str); i++) 00030 cache[(int) str[i]] = 1; 00031 00032 return (cache); 00033 }
Last updated at Tue Dec 18 21:07:42 PST 2007. | This site and project hosted by... |