]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/character_class.c
a11aa86effc992ce3529e7f59a5c72d43971de6f
[1ts-debian.git] / zephyr / zwgc / character_class.c
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It is one of the source files comprising zwgc, the Zephyr WindowGram
3  * client.
4  *
5  *      Created by:     Marc Horowitz <marc@athena.mit.edu>
6  *
7  *      $Id$
8  *
9  *      Copyright (c) 1989 by the Massachusetts Institute of Technology.
10  *      For copying and distribution information, see the file
11  *      "mit-copyright.h".
12  */
13
14 #include <sysdep.h>
15
16 #if (!defined(lint) && !defined(SABER))
17 static const char rcsid_character_class_c[] = "$Id$";
18 #endif
19
20 #include <zephyr/mit-copyright.h>
21 #include <zephyr/zephyr.h>
22 #include "character_class.h"
23
24 /* 
25  * It may look like we are passing the cache by value, but since it's
26  * really an array we are passing by reference.  C strikes again....
27  */
28
29 static character_class cache;
30
31 /* character_class */
32 char *
33 string_to_character_class(string str)
34 {
35     int i;
36
37     (void) memset(cache, 0, sizeof(cache));
38
39     for (i=0; i<strlen(str); i++)
40       cache[str[i]] = 1;
41
42     return(cache);
43 }