Lhogho  0.0.028
 All Data Structures Files Functions Variables Typedefs Macros Pages
words.h
Go to the documentation of this file.
1 //
2 // Project: Lhogho
3 // File: words.h
4 //
5 // Copyright (C) 2007 P.Boytchev
6 //
7 // Revision history:
8 // 2007-06-09 - file created from atoms.h
9 // 2007-06-17 - fixed bug #1738571 "Invalid pointer in Ubuntu binary"
10 // 2007-09-01 - FULLPRINTP
11 // 2007-10-06 - create_word
12 //
13 //
14 // This program is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 2 of the License, or
17 // (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 //
28 
29 #ifndef LHOGHO_WORDS_H
30 #define LHOGHO_WORDS_H
31 
32 
33 
34 
35 #define STRING(x) ((x)->unode.c[2])
36 #define WORD(x) ((x)->unode.a[3])
37 #define LENGTH(x) ((x)->unode.u[1] >> 8)
38 #define IDLENGTH(x) ((x)->unode.u[1])
39 #define IS_WORD(x) (ID(x)==WORD_ID)
40 #define IS_SUBWORD(x) (ID(x)==SUBWORD_ID)
41 #define IS_ANY_WORD(x) ((ID(x)==WORD_ID)||(ID(x)==SUBWORD_ID))
42 
43 #define WORD_SIZE 256*256*256
44 
45 
46 extern int full_print_p;
47 extern atom_t false_true[2];
48 
49 
50 extern atom_t new_word( chars_t string, uint_t length );
51 extern atom_t new_subword( atom_t word, chars_t string, uint_t length );
52 extern atom_t create_word(int buff_len);
53 extern void delete_word( atom_t a );
54 extern void delete_subword( atom_t a );
55 extern void dump_word( atom_t a, int level );
56 extern atom_t read_word( chars_t filename );
57 extern void write_word( atom_t word, chars_t filename );
58 extern int same_words( atom_t a, atom_t b );
59 extern atom_t decode_word( unsigned char* buffer, int size, int dealc );
60 extern int atom_to_boolean( atom_t a, int* np );
61 extern int atom_to_string(atom_t a, chars_t buff, int * buff_len);
62 extern atom_t atom_to_word( atom_t data );
63 extern atom_t atom_to_real_word( atom_t data );
64 
65 extern int same_strings( int ci, chars_t sa, chars_t sb, int n );
66 
67 #endif //LHOGHO_WORDS_H

[ HOME | INDEX | ATOMS | VARS | REFERENCE ]
Lhogho Developer's Documentation
Wed Jul 10 2013