source: abuse/trunk/src/lisp2.hpp @ 57

Last change on this file since 57 was 57, checked in by Sam Hocevar, 11 years ago
  • Move each header to the same directory as its corresponding source, to get a better idea of which files are likely to export symbols.
File size: 3.9 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef _LISP_HPP_INCLUDED_
11#define _LISP_HPP_INCLUDED_
12
13#include        <sys/types.h>
14#include        <stdtool.h>
15
16
17
18
19extern "C"
20{
21#include        "li_modul.h"
22#include        "li_proto.h"
23}
24
25/* ------------------------- COMPATIBILITY ------------------------- */
26
27#define L_SYMBOL                LI_tSYMBOL
28#define L_STRING                LI_tSTRING
29#define L_CONS_CELL             LI_tCONS
30#define L_NUMBER                LI_tLONG
31#define L_CHARACTER             LI_tLONG
32#define L_POINTER               LI_tUSER
33#define L_FIXED_POINT   LI_tFIXEDPOINT
34
35#define PERM_SPACE      0
36#define TEMP_SPACE      0
37#define cons_cell       Cell
38#define lisp_symbol     Cell
39
40/* ------------------------- GLOBAL VARS ------------------------- */
41
42extern int current_space;
43extern void *enviroment;
44
45/* ------------------------- GLOBAL LISP VARS ------------------------- */
46
47extern Cell *l_difficulty,*l_easy,*l_hard,*l_medium,*l_main_menu,
48            *l_logo,*l_state_art,*l_abilities,*l_state_sfx,
49                        *l_song_list,*l_filename,*l_sfx_directory,*l_max_hp,
50                        *l_default_font,*l_morph,*l_max_power,*l_default_abilities,
51                        *l_default_ai_function,*l_tile_files,*l_empty_cache,*l_range,
52                        *l_joy_file,*l_hurt_all,*l_death_handler,*l_title_screen,
53                        *l_console_font,*l_fields,*l_dist,*l_pushx,*l_pushy,
54                        *l_object,*l_tile;
55
56/* variables for the status bar */
57
58extern Cell *l_statbar_ammo_x,*l_statbar_ammo_y,
59            *l_statbar_ammo_w,*l_statbar_ammo_h,
60                        *l_statbar_ammo_bg_color,
61
62                        *l_statbar_health_x,*l_statbar_health_y,
63                        *l_statbar_health_w,*l_statbar_health_h,
64                        *l_statbar_health_bg_color,
65
66                        *l_statbar_logo_x,*l_statbar_logo_y;
67
68extern Cell *true_symbol;
69
70/* ------------------------- TRIGONOMETRY -------------------- */
71
72#define FIXED_TRIG_SIZE 360               // 360 degrees stored in table
73extern int32_t sin_table[FIXED_TRIG_SIZE];   // this should be filled in by external module
74#define TBS 1662                          // atan table granularity
75extern uint16_t atan_table[TBS];
76
77/* ------------------------- COMPATIBILITY -------------------- */
78
79typedef Cell    lisp_symbol;
80#undef CAR
81#undef CDR
82#undef SCAR
83#undef SCDR
84#define SCAR(x)                 (((Cell*)x)->type == LI_tCONS ? ((Cell*)x)->v.cons.car : Nil)
85#define SCDR(x)                 (((Cell*)x)->type == LI_tCONS ? ((Cell*)x)->v.cons.cdr : Nil)
86#define CAR(x)                  (((Cell*)x)->v.cons.car)
87#define CDR(x)                  (((Cell*)x)->v.cons.cdr)
88
89/* ------------------------- FUNCTION PROTOTYPES ------------------------- */
90
91void lisp_init (long a, long b);
92void lisp_uninit (void);
93char * lstring_value (void* x);
94long lnumber_value (void* x);
95char lcharacter_value (void* x);
96Cell* new_lisp_number (long x);
97Cell* new_lisp_character (unsigned short x);
98Cell* new_lisp_string (long x);
99Cell* new_lisp_pointer (void* x);
100Cell* new_cons_cell (void);
101Cell* lcar (void* x);
102Cell* lcdr (void* x);
103Cell* lprint (void* x);
104Cell* set_symbol_number (void* x, long y);
105Cell* set_symbol_value(void *symbol, void *value);
106Cell* symbol_value (void* x);
107Cell* make_find_symbol (char* name);
108Cell* find_symbol (char* name);
109Cell* symbol_function (void* symbol);
110void use_user_space(void *addr, long size);
111Cell* eval_function(void *sym, void *arg_list, void *env);
112void clear_tmp();
113void resize_tmp (int size);
114Cell* eval (void* item, void* env);
115long list_length(void *i);
116Cell* nth (int num, void *list);
117Cell* compile (char*& str);
118int get_lprop_number (void* symbol, int number);
119Cell* assoc (void* vlists, void* vtarget);
120char* symbol_name (void* symbol);
121int item_type (void* cell);
122int32_t lisp_cos(int32_t x);
123int32_t lisp_sin(int32_t x);
124int32_t lisp_atan2(int32_t dy, int32_t dx);
125void push_onto_list(Cell *object, Cell *&list);
126
127void* lpointer_value (void* x);
128long lfixed_point_value(void* x);
129void lisp_init_globals ();
130int lisp_init_lisp_fns ();
131void lisp_init_c_fns ();
132
133extern "C" void lbreak (const char* format, ...);
134
135#endif /* _LISP_HPP_INCLUDED_ */
Note: See TracBrowser for help on using the repository browser.