| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2007-02-23 15:22:36 +00:00
										 |  |  |  * $Id: lsp_i.h,v 1.10 2007-02-23 15:22:36 bacon Exp $ | 
					
						
							| 
									
										
										
										
											2007-02-03 10:52:36 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * {License} | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _ASE_LSP_LSPI_H_
 | 
					
						
							|  |  |  | #define _ASE_LSP_LSPI_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-02-23 10:57:09 +00:00
										 |  |  | #include <ase/cmn/mem.h>
 | 
					
						
							|  |  |  | #include <ase/cmn/str.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | #include <ase/lsp/lsp.h>
 | 
					
						
							| 
									
										
										
										
											2006-10-26 08:17:38 +00:00
										 |  |  | #include <ase/lsp/env.h>
 | 
					
						
							|  |  |  | #include <ase/lsp/obj.h>
 | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | #include <ase/lsp/mem.h>
 | 
					
						
							|  |  |  | #include <ase/lsp/misc.h>
 | 
					
						
							|  |  |  | #include <ase/lsp/prim.h>
 | 
					
						
							| 
									
										
										
										
											2006-10-26 08:17:38 +00:00
										 |  |  | #include <ase/lsp/name.h>
 | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef _MSC_VER
 | 
					
						
							|  |  |  | #pragma warning (disable: 4996)
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-02-23 15:22:36 +00:00
										 |  |  | #if defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG)
 | 
					
						
							|  |  |  | 	#define _CRTDBG_MAP_ALLOC
 | 
					
						
							|  |  |  | 	#include <crtdbg.h>
 | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-02-23 15:22:36 +00:00
										 |  |  | 	#define ASE_LSP_MALLOC(lsp,size) malloc (size)
 | 
					
						
							|  |  |  | 	#define ASE_LSP_REALLOC(lsp,ptr,size) realloc (ptr, size)
 | 
					
						
							|  |  |  | 	#define ASE_LSP_FREE(lsp,ptr) free (ptr)
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | 	#define ASE_LSP_MALLOC(lsp,size) ASE_MALLOC(&(lsp)->prmfns.mmgr,size)
 | 
					
						
							|  |  |  | 	#define ASE_LSP_REALLOC(lsp,ptr,size) ASE_REALLOC(&(lsp)->prmfns.mmgr,ptr,size)
 | 
					
						
							|  |  |  | 	#define ASE_LSP_FREE(lsp,ptr) ASE_FREE(&(lsp)->prmfns.mmgr,ptr)
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-02-23 10:57:09 +00:00
										 |  |  | #define ASE_LSP_ISUPPER(lsp,c)  ASE_ISUPPER(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISLOWER(lsp,c)  ASE_ISLOWER(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISALPHA(lsp,c)  ASE_ISALPHA(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISDIGIT(lsp,c)  ASE_ISDIGIT(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISXDIGIT(lsp,c) ASE_ISXDIGIT(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISALNUM(lsp,c)  ASE_ISALNUM(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISSPACE(lsp,c)  ASE_ISSPACE(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISPRINT(lsp,c)  ASE_ISPRINT(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISGRAPH(lsp,c)  ASE_ISGRAPH(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISCNTRL(lsp,c)  ASE_ISCNTRL(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_ISPUNCT(lsp,c)  ASE_ISPUNCT(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_TOUPPER(lsp,c)  ASE_TOUPPER(&(lsp)->prmfns.ccls,c)
 | 
					
						
							|  |  |  | #define ASE_LSP_TOLOWER(lsp,c)  ASE_TOLOWER(&(lsp)->prmfns.ccls,c)
 | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | struct ase_lsp_t  | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2007-02-01 08:52:10 +00:00
										 |  |  | 	ase_lsp_prmfns_t prmfns; | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-02-11 07:36:55 +00:00
										 |  |  | 	/* error */ | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 	int errnum; | 
					
						
							| 
									
										
										
										
											2007-02-11 07:36:55 +00:00
										 |  |  | 	ase_char_t errmsg[256]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* options */ | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 	int opt_undef_symbol; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* for read */ | 
					
						
							|  |  |  | 	ase_cint_t curc; | 
					
						
							| 
									
										
										
										
											2006-10-26 08:17:38 +00:00
										 |  |  | 	struct | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		int type; | 
					
						
							| 
									
										
										
										
											2006-10-29 13:00:39 +00:00
										 |  |  | 		ase_long_t ival; | 
					
						
							|  |  |  | 		ase_real_t rval; | 
					
						
							| 
									
										
										
										
											2006-10-26 08:17:38 +00:00
										 |  |  | 		ase_lsp_name_t name; | 
					
						
							|  |  |  | 	} token; | 
					
						
							| 
									
										
										
										
											2006-10-24 15:10:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* io functions */ | 
					
						
							|  |  |  | 	ase_lsp_io_t input_func; | 
					
						
							|  |  |  | 	ase_lsp_io_t output_func; | 
					
						
							|  |  |  | 	void* input_arg; | 
					
						
							|  |  |  | 	void* output_arg; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* security options */ | 
					
						
							|  |  |  | 	ase_size_t max_eval_depth; | 
					
						
							|  |  |  | 	ase_size_t cur_eval_depth; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* memory manager */ | 
					
						
							|  |  |  | 	ase_lsp_mem_t* mem; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |