diff options
author | dos-reis <gdr@axiomatics.org> | 2008-05-21 11:30:55 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-05-21 11:30:55 +0000 |
commit | 28aeada5c757a5a997526f74a471cf0c56c6b473 (patch) | |
tree | cd153e60571f07568a7e96a802d56100ed60a5c3 /src/include | |
parent | 7efb5764ecb6e7141c207bd906d9ac7f49342126 (diff) | |
download | open-axiom-28aeada5c757a5a997526f74a471cf0c56c6b473.tar.gz |
* graph/Gdraws/Makefile.in (HEADERS): Don't include hash.H1.
* include/halloc.h: Rename from include/halloc.H1.
* include/lex.H1: Remove.
* include/hterror.H1: Likewise.
* hyper/halloc.c: Likewise.
* hyper/hash.c: Likewise.
* hyper/Makefile.in (hypertex_SOURCES): Don't include hash.c,
halloc.c.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/all_hyper_proto.H1 | 4 | ||||
-rw-r--r-- | src/include/halloc.H1 | 1 | ||||
-rw-r--r-- | src/include/halloc.h | 41 | ||||
-rw-r--r-- | src/include/hash.H1 | 12 | ||||
-rw-r--r-- | src/include/hash.h | 29 | ||||
-rw-r--r-- | src/include/hterror.H1 | 6 | ||||
-rw-r--r-- | src/include/lex.H1 | 23 |
7 files changed, 62 insertions, 54 deletions
diff --git a/src/include/all_hyper_proto.H1 b/src/include/all_hyper_proto.H1 index 320e1eb1..0218d96a 100644 --- a/src/include/all_hyper_proto.H1 +++ b/src/include/all_hyper_proto.H1 @@ -7,16 +7,13 @@ #include "form_ext.H1" #include "extent1.H1" #include "extent2.H1" -#include "halloc.H1" #include "group.H1" -#include "hterror.H1" #include "htinp.H1" #include "hyper.H1" #include "initx.H1" #include "input.H1" #include "keyin.H1" #include "item.H1" -#include "lex.H1" #include "parse.H1" #include "macro.H1" #include "parse_paste.H1" @@ -27,5 +24,4 @@ #include "scrollbar.H1" #include "titlebar.H1" #include "spadint.H1" -#include "hash.H1" #include "mem.H1" diff --git a/src/include/halloc.H1 b/src/include/halloc.H1 deleted file mode 100644 index 717a7d0f..00000000 --- a/src/include/halloc.H1 +++ /dev/null @@ -1 +0,0 @@ -extern char * halloc(int bytes , char * msg); diff --git a/src/include/halloc.h b/src/include/halloc.h new file mode 100644 index 00000000..9ecd3aa0 --- /dev/null +++ b/src/include/halloc.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd. + All rights reserved. + Copyright (C) 2007-2008, Gabriel Dos Reis. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef OPENAXIOM_HALLOC +#define OPENAXIOM_HALLOC + +extern char * halloc(int, const char*); + +#endif /* OPENAXIOM_HALLOC */ diff --git a/src/include/hash.H1 b/src/include/hash.H1 deleted file mode 100644 index 2028b961..00000000 --- a/src/include/hash.H1 +++ /dev/null @@ -1,12 +0,0 @@ -extern char * alloc_string(char * str); -extern HashEntry * hash_copy_entry(HashEntry * e); -extern HashTable * hash_copy_table(HashTable * table); -extern void hash_delete(HashTable * table , char * key); -extern char * hash_find(HashTable * table , char * key); -extern void hash_init(HashTable * table , int size , EqualFunction equal ,HashcodeFunction hash_code); -extern void free_hash(HashTable * table , FreeFunction free_fun); -extern void hash_insert(HashTable * table , char * data , char * key); -extern void hash_map(HashTable * table , MappableFunction func); -extern char * hash_replace(HashTable * table , char * data , char * key); -extern int string_equal(char * s1 , char * s2); -extern int string_hash(char * s , int size); diff --git a/src/include/hash.h b/src/include/hash.h index 87b34610..5c63b315 100644 --- a/src/include/hash.h +++ b/src/include/hash.h @@ -36,17 +36,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -typedef struct hash_entry { - char *key; /* pointer to key data */ - char *data; /* Pointer to entry */ - struct hash_entry *next; /* Link to next entry */ +typedef struct HashEntry { + const char *key; /* pointer to key data */ + char *data; /* Pointer to entry */ + struct HashEntry *next; /* Link to next entry */ } HashEntry; -typedef int (*EqualFunction)(void *,void *); -typedef int (*HashcodeFunction)(void *,int); -typedef void (*MappableFunction) (void *); +typedef int (*EqualFunction)(const void*, const void*); +typedef int (*HashcodeFunction)(const void*,int); +typedef void (*MappableFunction) (const void*); typedef void (*FreeFunction) (void *); -typedef struct { +typedef struct HashTable { HashEntry **table; /* the actual table */ int size; /* size of table */ int num_entries; /* number of elements in a hash table */ @@ -54,4 +54,17 @@ typedef struct { HashcodeFunction hash_code; /* create hash code for a key */ } HashTable; +extern char* alloc_string(const char*); +extern HashEntry* hash_copy_entry(HashEntry*); +extern HashTable* hash_copy_table(HashTable*); +extern void hash_delete(HashTable*, const char*); +extern char* hash_find(HashTable*, const char*); +extern void hash_init(HashTable*, int, EqualFunction, HashcodeFunction); +extern void free_hash(HashTable*, FreeFunction); +extern void hash_insert(HashTable*, char*, const char*); +extern void hash_map(HashTable*, MappableFunction func); +extern char* hash_replace(HashTable*, char*, const char*); +extern int string_equal(const char*, const char*); +extern int string_hash(const char*, int size); + #endif diff --git a/src/include/hterror.H1 b/src/include/hterror.H1 deleted file mode 100644 index cf4f99d4..00000000 --- a/src/include/hterror.H1 +++ /dev/null @@ -1,6 +0,0 @@ -extern void print_page_and_filename(void ); -extern void jump(void ); -extern void print_token(void ); -extern void token_name(int type); -extern void print_next_ten_tokens(void ); -extern void htperror(char *, int); diff --git a/src/include/lex.H1 b/src/include/lex.H1 deleted file mode 100644 index 7f049204..00000000 --- a/src/include/lex.H1 +++ /dev/null @@ -1,23 +0,0 @@ -extern int connect_spad(void); -extern void get_expected_token(int type); -extern void parser_init(void); -extern void init_scanner(void); -extern void save_scanner_state(void); -extern void restore_scanner_state(void); -extern void unget_char(int c); -extern int get_char(void); -extern void unget_token(void); -extern int get_token(void); -extern void push_be_stack(int type , char * id); -extern void check_and_pop_be_stack(int type , char * id); -extern int clear_be_stack(void); -extern int be_type(char * which); -extern int begin_type(void); -extern int end_type(void); -extern void reset_connection(void); -extern int spad_busy(void); -#ifdef _LEX_C -static int get_char1(void ); -static void spad_error_handler(void ); -static int keyword_type(void ); -#endif |