source: trunk/src/emx/include/ternary.h@ 1015

Last change on this file since 1015 was 123, checked in by zap, 22 years ago

Started the work for re-designing the EMX C runtime library to not require
EMX.DLL. The new design is projected to be as follows:

  • all emx syscalls are replaced with the routines from the old sys.lib library which is now compilable in both a.out and OMF formats.
  • the sys.a library should be made replaceable and selectable by some gcc switch (e.g. -msyslib=emx would link with emx.a instead of sys.a which would give almost full backward compatibility with emx).
  • All C functions names were renamed to not contain the starting underscore (e.g. fopen and not _fopen). The underscored aliases will be added later with the c_alias library (which will be generated automatically from all public symbols of libc; any exported symbol that do not start with an underscore will be given an underscored alias unless such a symbol is already defined).

Also a lot of updates to the building system. It is now much faster (thanks
to Knut's suggestion of using ash's builtin echo).
Also re-wrote thunk1.asm and thunk2.asm to GAS format; this removes the need
for MASM and makes it possible to use 16-bit functions in a.out programs
without the need for EMX.DLL.
Also made a lot of small changes I don't remember now.

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1/* ternary.h - Ternary Search Trees
2 Copyright 2001 Free Software Foundation, Inc.
3
4 Contributed by Daniel Berlin (dan@cgsoftware.com)
5
6
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
10 later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20 USA. */
21#ifndef TERNARY_H_
22#define TERNARY_H_
23/* Ternary search trees */
24
25typedef struct ternary_node_def *ternary_tree;
26
27typedef struct ternary_node_def
28{
29 char splitchar;
30 ternary_tree lokid;
31 ternary_tree eqkid;
32 ternary_tree hikid;
33}
34ternary_node;
35
36/* Insert string S into tree P, associating it with DATA.
37 Return the data in the tree associated with the string if it's
38 already there, and replace is 0.
39 Otherwise, replaces if it it exists, inserts if it doesn't, and
40 returns the data you passed in. */
41PTR ternary_insert PARAMS ((ternary_tree *p, const char *s,
42 PTR data, int replace));
43
44/* Delete the ternary search tree rooted at P.
45 Does NOT delete the data you associated with the strings. */
46void ternary_cleanup PARAMS ((ternary_tree p));
47
48/* Search the ternary tree for string S, returning the data associated
49 with it if found. */
50PTR ternary_search PARAMS ((const ternary_node *p, const char *s));
51#endif
Note: See TracBrowser for help on using the repository browser.