File: zstring.h

package info (click to toggle)
zephyr 3.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,744 kB
  • ctags: 2,626
  • sloc: ansic: 41,183; sh: 8,927; makefile: 849; python: 416; yacc: 250; lisp: 127
file content (33 lines) | stat: -rw-r--r-- 846 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Copyright (C) 1991 by the Massachusetts Institute of Technology.
 * For copying and distribution information, see the file "mit-copyright.h".
 *
 *	$Id: zstring.h 2527 2009-08-09 18:42:32Z kcr@ATHENA.MIT.EDU $
 */

#include <zephyr/mit-copyright.h>

#ifndef __zstring_h
#define __zstring_h __FILE__

#define STRING_HASH_TABLE_SIZE	1024

#include <stdio.h>

typedef struct _String
{
  char *string;				/* the string itself */
  int ref_count;			/* for gc */
  unsigned long hash_val;		/* hash value for this string */
  struct _String *next, *prev;		/* for linking in hash table */
} String;

String *make_string(char *s, int downcase);
void free_string(String *z);
String *find_string(char *s, int downcase);
String *dup_string(String *z);
int comp_string(String *a, String *b);
void print_string_table(FILE *f);

#endif /* __zstring_h */