| slang.h | | slang.h | |
| #ifndef DAVIS_SLANG_H_ | | #ifndef DAVIS_SLANG_H_ | |
| #define DAVIS_SLANG_H_ | | #define DAVIS_SLANG_H_ | |
| /* -*- mode: C; mode: fold; -*- */ | | /* -*- mode: C; mode: fold; -*- */ | |
| /* | | /* | |
|
| Copyright (C) 2004-2011 John E. Davis | | Copyright (C) 2004-2014 John E. Davis | |
| | | | |
| This file is part of the S-Lang Library. | | This file is part of the S-Lang Library. | |
| | | | |
| The S-Lang Library is free software; you can redistribute it and/or | | The S-Lang Library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU General Public License as | | modify it under the terms of the GNU General Public License as | |
| published by the Free Software Foundation; either version 2 of the | | published by the Free Software Foundation; either version 2 of the | |
| License, or (at your option) any later version. | | License, or (at your option) any later version. | |
| | | | |
| The S-Lang Library is distributed in the hope that it will be useful, | | The S-Lang Library is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| General Public License for more details. | | General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU General Public License | | You should have received a copy of the GNU General Public License | |
| along with this library; if not, write to the Free Software | | along with this library; if not, write to the Free Software | |
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
| USA. | | USA. | |
| */ | | */ | |
| | | | |
|
| #define SLANG_VERSION 20204 | | #define SLANG_VERSION 20301 | |
| #define SLANG_VERSION_STRING "2.2.4" | | #define SLANG_VERSION_STRING "pre2.3.1-22" | |
| /* #ifdef __DATE__ */ | | /* #ifdef __DATE__ */ | |
| /* # define SLANG_VERSION_STRING SLANG_VERSION_STRING0 " " __DATE__ */ | | /* # define SLANG_VERSION_STRING SLANG_VERSION_STRING0 " " __DATE__ */ | |
| /* #else */ | | /* #else */ | |
| /* # define SLANG_VERSION_STRING SLANG_VERSION_STRING0 */ | | /* # define SLANG_VERSION_STRING SLANG_VERSION_STRING0 */ | |
| /* #endif */ | | /* #endif */ | |
| /*{{{ System Dependent Macros and Typedefs */ | | /*{{{ System Dependent Macros and Typedefs */ | |
| | | | |
| #if defined(__WATCOMC__) && defined(DOS) | | #if defined(__WATCOMC__) && defined(DOS) | |
| # ifndef __MSDOS__ | | # ifndef __MSDOS__ | |
| # define __MSDOS__ | | # define __MSDOS__ | |
| | | | |
| skipping to change at line 225 | | skipping to change at line 225 | |
| typedef unsigned char *VOID_STAR; | | typedef unsigned char *VOID_STAR; | |
| #define SLCONST | | #define SLCONST | |
| #endif | | #endif | |
| | | | |
| #ifdef ENABLE_SLFUTURE_CONST | | #ifdef ENABLE_SLFUTURE_CONST | |
| # define SLFUTURE_CONST SLCONST | | # define SLFUTURE_CONST SLCONST | |
| #else | | #else | |
| # define SLFUTURE_CONST | | # define SLFUTURE_CONST | |
| #endif | | #endif | |
| | | | |
|
| | | #ifdef ENABLE_SLFUTURE_VOID | |
| | | # define SLFUTURE_VOID void | |
| | | #else | |
| | | # define SLFUTURE_VOID char | |
| | | #endif | |
| | | | |
| typedef int (*FVOID_STAR)(void); | | typedef int (*FVOID_STAR)(void); | |
| | | | |
| #if defined(__MSDOS__) && defined(__BORLANDC__) | | #if defined(__MSDOS__) && defined(__BORLANDC__) | |
| # define SLFREE(buf) farfree((void far *)(buf)) | | # define SLFREE(buf) farfree((void far *)(buf)) | |
| # define SLMALLOC(x) farmalloc((unsigned long) (x)) | | # define SLMALLOC(x) farmalloc((unsigned long) (x)) | |
| # define SLREALLOC(buf, n) farrealloc((void far *) (buf), (unsigned long) (
n)) | | # define SLREALLOC(buf, n) farrealloc((void far *) (buf), (unsigned long) (
n)) | |
| # define SLCALLOC(n, m) farcalloc((unsigned long) (n), (unsigned long) (m)) | | # define SLCALLOC(n, m) farcalloc((unsigned long) (n), (unsigned long) (m)) | |
| #else | | #else | |
| # if defined(VMS) && !defined(__DECC) | | # if defined(VMS) && !defined(__DECC) | |
| # define SLFREE VAXC$FREE_OPT | | # define SLFREE VAXC$FREE_OPT | |
| | | | |
| skipping to change at line 259 | | skipping to change at line 265 | |
| #else | | #else | |
| # define SL_EXPORT | | # define SL_EXPORT | |
| # define SL_IMPORT | | # define SL_IMPORT | |
| #endif | | #endif | |
| #ifdef SLANG_SOURCE_ | | #ifdef SLANG_SOURCE_ | |
| # define SL_EXTERN extern SL_EXPORT | | # define SL_EXTERN extern SL_EXPORT | |
| #else | | #else | |
| # define SL_EXTERN extern SL_IMPORT | | # define SL_EXTERN extern SL_IMPORT | |
| #endif | | #endif | |
| | | | |
|
| SL_EXTERN char *SLdebug_malloc (unsigned long); | | SL_EXTERN SLFUTURE_VOID *SLdebug_malloc (unsigned long); | |
| SL_EXTERN char *SLdebug_calloc (unsigned long, unsigned long); | | SL_EXTERN SLFUTURE_VOID *SLdebug_calloc (unsigned long, unsigned long); | |
| SL_EXTERN char *SLdebug_realloc (char *, unsigned long); | | SL_EXTERN SLFUTURE_VOID *SLdebug_realloc (SLFUTURE_VOID *, unsigned long); | |
| SL_EXTERN void SLdebug_free (char *); | | SL_EXTERN void SLdebug_free (SLFUTURE_VOID *); | |
| SL_EXTERN void SLmalloc_dump_statistics (void); | | SL_EXTERN void SLmalloc_dump_statistics (void); | |
| SL_EXTERN char *SLstrcpy(register char *, register char *); | | SL_EXTERN char *SLstrcpy(register char *, register char *); | |
| SL_EXTERN int SLstrcmp(register char *, register char *); | | SL_EXTERN int SLstrcmp(register char *, register char *); | |
| SL_EXTERN char *SLstrncpy(char *, register char *, register int); | | SL_EXTERN char *SLstrncpy(char *, register char *, register int); | |
| | | | |
| SL_EXTERN void SLmemset (char *, char, int); | | SL_EXTERN void SLmemset (char *, char, int); | |
| SL_EXTERN char *SLmemchr (register char *, register char, register int); | | SL_EXTERN char *SLmemchr (register char *, register char, register int); | |
| SL_EXTERN char *SLmemcpy (char *, char *, int); | | SL_EXTERN char *SLmemcpy (char *, char *, int); | |
| SL_EXTERN int SLmemcmp (char *, char *, int); | | SL_EXTERN int SLmemcmp (char *, char *, int); | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
|
| /* SLstrings */ | | | |
| typedef char SLstr_Type; | | | |
| typedef unsigned int SLstrlen_Type; /* Eventually this will become size_
t */ | | typedef unsigned int SLstrlen_Type; /* Eventually this will become size_
t */ | |
| #define SLANG_STRLEN_TYPE SLANG_UINT_TYPE | | #define SLANG_STRLEN_TYPE SLANG_UINT_TYPE | |
|
| | | typedef int SLindex_Type; | |
| | | typedef unsigned int SLuindex_Type; | |
| | | #define SLANG_ARRAY_INDEX_TYPE SLANG_INT_TYPE | |
| | | | |
| | | /* SLstrings */ | |
| | | typedef char SLstr_Type; | |
| SL_EXTERN int SLang_pop_strlen_type (SLstrlen_Type *); | | SL_EXTERN int SLang_pop_strlen_type (SLstrlen_Type *); | |
| SL_EXTERN int SLang_push_strlen_type (SLstrlen_Type); | | SL_EXTERN int SLang_push_strlen_type (SLstrlen_Type); | |
| | | | |
| /* An SLstr_Type object must be treated as a constant and may only be freed | | /* An SLstr_Type object must be treated as a constant and may only be freed | |
| * by the SLang_free_slstring function and nothing else. | | * by the SLang_free_slstring function and nothing else. | |
| */ | | */ | |
| SL_EXTERN SLstr_Type *SLang_create_nslstring (SLFUTURE_CONST char *, SLstrl
en_Type); | | SL_EXTERN SLstr_Type *SLang_create_nslstring (SLFUTURE_CONST char *, SLstrl
en_Type); | |
| SL_EXTERN SLstr_Type *SLang_create_slstring (SLFUTURE_CONST char *); | | SL_EXTERN SLstr_Type *SLang_create_slstring (SLFUTURE_CONST char *); | |
|
| SL_EXTERN void SLang_free_slstring (SLstr_Type *); /* handles NULL */ | | SL_EXTERN void SLang_free_slstring (SLCONST SLstr_Type *); /* handles NU
LL */ | |
| SL_EXTERN int SLang_pop_slstring (SLstr_Type **); /* free with SLang_free
_slstring */ | | SL_EXTERN int SLang_pop_slstring (SLstr_Type **); /* free with SLang_free
_slstring */ | |
| SL_EXTERN SLstr_Type *SLang_concat_slstrings (SLstr_Type *a, SLstr_Type *b)
; | | SL_EXTERN SLstr_Type *SLang_concat_slstrings (SLstr_Type *a, SLstr_Type *b)
; | |
|
| | | typedef unsigned long SLstr_Hash_Type; | |
| | | SL_EXTERN SLstr_Hash_Type SLcompute_string_hash (SLCONST SLstr_Type *); | |
| | | | |
|
| SL_EXTERN void SLstring_dump_stats (void); | | /* SL_EXTERN void SLstring_dump_stats (void); // is not (yet?) defined by
S-Lang library */ | |
| | | | |
| /*{{{ UTF-8 and Wide Char support */ | | /*{{{ UTF-8 and Wide Char support */ | |
| | | | |
| #if SLANG_SIZEOF_INT == 4 | | #if SLANG_SIZEOF_INT == 4 | |
| typedef unsigned int SLwchar_Type; | | typedef unsigned int SLwchar_Type; | |
| # define SLANG_WCHAR_TYPE SLANG_UINT_TYPE | | # define SLANG_WCHAR_TYPE SLANG_UINT_TYPE | |
| # define SLang_push_wchar SLang_push_uint | | # define SLang_push_wchar SLang_push_uint | |
| # define SLang_pop_wchar SLang_pop_uint | | # define SLang_pop_wchar SLang_pop_uint | |
| #else | | #else | |
| typedef unsigned long SLwchar_Type; | | typedef unsigned long SLwchar_Type; | |
| | | | |
| skipping to change at line 591 | | skipping to change at line 603 | |
| | | | |
| typedef struct _pSLang_NameSpace_Type SLang_NameSpace_Type; | | typedef struct _pSLang_NameSpace_Type SLang_NameSpace_Type; | |
| | | | |
| SL_EXTERN int SLns_add_intrin_fun_table (SLang_NameSpace_Type *, SLang_Intr
in_Fun_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_intrin_fun_table (SLang_NameSpace_Type *, SLang_Intr
in_Fun_Type *, SLFUTURE_CONST char *); | |
| SL_EXTERN int SLns_add_intrin_var_table (SLang_NameSpace_Type *, SLang_Intr
in_Var_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_intrin_var_table (SLang_NameSpace_Type *, SLang_Intr
in_Var_Type *, SLFUTURE_CONST char *); | |
| SL_EXTERN int SLns_add_app_unary_table (SLang_NameSpace_Type *, SLang_App_U
nary_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_app_unary_table (SLang_NameSpace_Type *, SLang_App_U
nary_Type *, SLFUTURE_CONST char *); | |
| SL_EXTERN int SLns_add_math_unary_table (SLang_NameSpace_Type *, SLang_Math
_Unary_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_math_unary_table (SLang_NameSpace_Type *, SLang_Math
_Unary_Type *, SLFUTURE_CONST char *); | |
| SL_EXTERN int SLns_add_hconstant_table (SLang_NameSpace_Type *, SLang_HCons
tant_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_hconstant_table (SLang_NameSpace_Type *, SLang_HCons
tant_Type *, SLFUTURE_CONST char *); | |
| SL_EXTERN int SLns_add_iconstant_table (SLang_NameSpace_Type *, SLang_ICons
tant_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_iconstant_table (SLang_NameSpace_Type *, SLang_ICons
tant_Type *, SLFUTURE_CONST char *); | |
| SL_EXTERN int SLns_add_lconstant_table (SLang_NameSpace_Type *, SLang_LCons
tant_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_lconstant_table (SLang_NameSpace_Type *, SLang_LCons
tant_Type *, SLFUTURE_CONST char *); | |
|
| SL_EXTERN int SLns_add_fconstant_table (SLang_NameSpace_Type *, SLang_FCons
tant_Type *, SLFUTURE_CONST char *); | | /* SL_EXTERN int SLns_add_fconstant_table (SLang_NameSpace_Type *, SLang_FC
onstant_Type *, SLFUTURE_CONST char *); // is not (yet?) defined by S-Lang
library */ | |
| SL_EXTERN int SLns_add_dconstant_table (SLang_NameSpace_Type *, SLang_DCons
tant_Type *, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_dconstant_table (SLang_NameSpace_Type *, SLang_DCons
tant_Type *, SLFUTURE_CONST char *); | |
| #ifdef HAVE_LONG_LONG | | #ifdef HAVE_LONG_LONG | |
|
| SL_EXTERN int SLns_add_llconstant_table (SLang_NameSpace_Type *, SLang_LLCo
nstant_Type *, SLFUTURE_CONST char *); | | /* SL_EXTERN int SLns_add_llconstant_table (SLang_NameSpace_Type *, SLang_L
LConstant_Type *, SLFUTURE_CONST char *); // is not (yet?) defined by S-La
ng library */ | |
| #endif | | #endif | |
| SL_EXTERN int SLns_add_istruct_table (SLang_NameSpace_Type *, SLang_IStruct
_Field_Type *, VOID_STAR, SLFUTURE_CONST char *); | | SL_EXTERN int SLns_add_istruct_table (SLang_NameSpace_Type *, SLang_IStruct
_Field_Type *, VOID_STAR, SLFUTURE_CONST char *); | |
| | | | |
| SL_EXTERN int SLns_add_hconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, SLtype, short); | | SL_EXTERN int SLns_add_hconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, SLtype, short); | |
| SL_EXTERN int SLns_add_iconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, SLtype, int); | | SL_EXTERN int SLns_add_iconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, SLtype, int); | |
| SL_EXTERN int SLns_add_lconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, SLtype, long); | | SL_EXTERN int SLns_add_lconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, SLtype, long); | |
| SL_EXTERN int SLns_add_fconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, float); | | SL_EXTERN int SLns_add_fconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, float); | |
| SL_EXTERN int SLns_add_dconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, double); | | SL_EXTERN int SLns_add_dconstant (SLang_NameSpace_Type *, SLFUTURE_CONST ch
ar *, double); | |
| #ifdef HAVE_LONG_LONG | | #ifdef HAVE_LONG_LONG | |
| SL_EXTERN int SLns_add_llconstant (SLang_NameSpace_Type *, SLFUTURE_CONST c
har *, long long); | | SL_EXTERN int SLns_add_llconstant (SLang_NameSpace_Type *, SLFUTURE_CONST c
har *, long long); | |
| | | | |
| skipping to change at line 671 | | skipping to change at line 683 | |
| # define NO_PROTOTYPES | | # define NO_PROTOTYPES | |
| # endif | | # endif | |
| #endif | | #endif | |
| | | | |
| #ifndef NO_PROTOTYPES | | #ifndef NO_PROTOTYPES | |
| # define _PROTO(x) x | | # define _PROTO(x) x | |
| #else | | #else | |
| # define _PROTO(x) () | | # define _PROTO(x) () | |
| #endif | | #endif | |
| | | | |
|
| typedef int SLindex_Type; | | | |
| typedef unsigned int SLuindex_Type; | | | |
| #define SLANG_ARRAY_INDEX_TYPE SLANG_INT_TYPE | | | |
| SL_EXTERN int SLang_pop_array_index (SLindex_Type *); | | SL_EXTERN int SLang_pop_array_index (SLindex_Type *); | |
| SL_EXTERN int SLang_push_array_index (SLindex_Type); | | SL_EXTERN int SLang_push_array_index (SLindex_Type); | |
| | | | |
| typedef struct _pSLang_Struct_Type SLang_Struct_Type; | | typedef struct _pSLang_Struct_Type SLang_Struct_Type; | |
| SL_EXTERN void SLang_free_struct (SLang_Struct_Type *); | | SL_EXTERN void SLang_free_struct (SLang_Struct_Type *); | |
| SL_EXTERN int SLang_push_struct (SLang_Struct_Type *); | | SL_EXTERN int SLang_push_struct (SLang_Struct_Type *); | |
| SL_EXTERN int SLang_pop_struct (SLang_Struct_Type **); | | SL_EXTERN int SLang_pop_struct (SLang_Struct_Type **); | |
| | | | |
|
| | | SL_EXTERN SLang_Struct_Type *SLang_create_struct (SLFUTURE_CONST char **fie | |
| | | ld_names, unsigned int nfields); | |
| | | /* Push the specified field value onto the stack */ | |
| | | SL_EXTERN int SLang_push_struct_field (SLang_Struct_Type *s, char *name); | |
| | | /* Pop the value from the stack into the specified field */ | |
| | | SL_EXTERN int SLang_pop_struct_field (SLang_Struct_Type *s, char *name); | |
| | | /* Set the first n fields of the struct from the stack. If n < 0, pop all | |
| | | fields. */ | |
| | | SL_EXTERN int SLang_pop_struct_fields (SLang_Struct_Type *s, int n); | |
| | | | |
| | | typedef struct _pSLang_Assoc_Array_Type SLang_Assoc_Array_Type; | |
| | | | |
| | | SL_EXTERN SLang_Assoc_Array_Type *SLang_create_assoc (SLtype type, int has_ | |
| | | default); | |
| | | /* If has_default is non-zero, take the default value from the stack */ | |
| | | SL_EXTERN void SLang_free_assoc (SLang_Assoc_Array_Type *); | |
| | | SL_EXTERN int SLang_push_assoc (SLang_Assoc_Array_Type *, int free_flag); | |
| | | SL_EXTERN int SLang_pop_assoc (SLang_Assoc_Array_Type **); | |
| | | SL_EXTERN int SLang_assoc_get (SLang_Assoc_Array_Type *, SLstr_Type *, SLty | |
| | | pe *); | |
| | | /* SLang_assoc_get leaves the object on the stack */ | |
| | | SL_EXTERN int SLang_assoc_put (SLang_Assoc_Array_Type *, SLstr_Type *); | |
| | | /* SLang_assoc_put takes the object from the stack */ | |
| | | | |
| | | SL_EXTERN int SLang_assoc_key_exists (SLang_Assoc_Array_Type *, SLstr_Type | |
| | | *); | |
| | | | |
| | | typedef struct _pSLang_List_Type SLang_List_Type; | |
| | | SL_EXTERN SLang_List_Type *SLang_create_list (int); | |
| | | SL_EXTERN int SLang_list_append (SLang_List_Type *, int); | |
| | | SL_EXTERN int SLang_list_insert (SLang_List_Type *, int); | |
| | | SL_EXTERN int SLang_push_list (SLang_List_Type *, int free_list); | |
| | | SL_EXTERN int SLang_pop_list (SLang_List_Type **); | |
| | | SL_EXTERN void SLang_free_list (SLang_List_Type *); | |
| | | | |
| typedef struct _pSLang_Foreach_Context_Type SLang_Foreach_Context_Type; | | typedef struct _pSLang_Foreach_Context_Type SLang_Foreach_Context_Type; | |
| | | | |
| typedef struct _pSLang_Class_Type SLang_Class_Type; | | typedef struct _pSLang_Class_Type SLang_Class_Type; | |
| | | | |
| /* These are the low-level functions for building push/pop methods. They | | /* These are the low-level functions for building push/pop methods. They | |
| * know nothing about memory management. For SLANG_CLASS_TYPE_MMT, use the | | * know nothing about memory management. For SLANG_CLASS_TYPE_MMT, use the | |
| * MMT push/pop functions instead. | | * MMT push/pop functions instead. | |
| */ | | */ | |
| SL_EXTERN int SLclass_push_double_obj (SLtype, double); | | SL_EXTERN int SLclass_push_double_obj (SLtype, double); | |
| SL_EXTERN int SLclass_push_float_obj (SLtype, float); | | SL_EXTERN int SLclass_push_float_obj (SLtype, float); | |
| | | | |
| skipping to change at line 710 | | skipping to change at line 749 | |
| SL_EXTERN int SLclass_pop_int_obj (SLtype, int *); | | SL_EXTERN int SLclass_pop_int_obj (SLtype, int *); | |
| SL_EXTERN int SLclass_pop_short_obj (SLtype, short *); | | SL_EXTERN int SLclass_pop_short_obj (SLtype, short *); | |
| SL_EXTERN int SLclass_pop_char_obj (SLtype, char *); | | SL_EXTERN int SLclass_pop_char_obj (SLtype, char *); | |
| SL_EXTERN int SLclass_pop_ptr_obj (SLtype, VOID_STAR *); | | SL_EXTERN int SLclass_pop_ptr_obj (SLtype, VOID_STAR *); | |
| | | | |
| #ifdef HAVE_LONG_LONG | | #ifdef HAVE_LONG_LONG | |
| SL_EXTERN int SLang_pop_long_long (long long *); | | SL_EXTERN int SLang_pop_long_long (long long *); | |
| SL_EXTERN int SLang_push_long_long (long long); | | SL_EXTERN int SLang_push_long_long (long long); | |
| SL_EXTERN int SLang_pop_ulong_long (unsigned long long *); | | SL_EXTERN int SLang_pop_ulong_long (unsigned long long *); | |
| SL_EXTERN int SLang_push_ulong_long (unsigned long long); | | SL_EXTERN int SLang_push_ulong_long (unsigned long long); | |
|
| SL_EXTERN int SLclass_pop_llong_obj (SLtype, long long *); | | /* SL_EXTERN int SLclass_pop_llong_obj (SLtype, long long *); // is not (y
et?) defined by S-Lang library */ | |
| SL_EXTERN int SLclass_push_llong_obj (SLtype, long long); | | SL_EXTERN int SLclass_push_llong_obj (SLtype, long long); | |
| #endif | | #endif | |
| | | | |
| SL_EXTERN SLang_Class_Type *SLclass_allocate_class (SLFUTURE_CONST char *); | | SL_EXTERN SLang_Class_Type *SLclass_allocate_class (SLFUTURE_CONST char *); | |
| SL_EXTERN int SLclass_get_class_id (SLang_Class_Type *cl); | | SL_EXTERN int SLclass_get_class_id (SLang_Class_Type *cl); | |
| SL_EXTERN int SLclass_create_synonym (SLFUTURE_CONST char *, SLtype); | | SL_EXTERN int SLclass_create_synonym (SLFUTURE_CONST char *, SLtype); | |
| SL_EXTERN int SLclass_is_class_defined (SLtype); | | SL_EXTERN int SLclass_is_class_defined (SLtype); | |
| SL_EXTERN int SLclass_dup_object (SLtype type, VOID_STAR from, VOID_STAR to
); | | SL_EXTERN int SLclass_dup_object (SLtype type, VOID_STAR from, VOID_STAR to
); | |
| | | | |
| typedef int SLclass_Type; | | typedef int SLclass_Type; | |
| | | | |
| skipping to change at line 1195 | | skipping to change at line 1234 | |
| SL_EXTERN int SLpop_string (char **); /* malloced -- free with SLfree */ | | SL_EXTERN int SLpop_string (char **); /* malloced -- free with SLfree */ | |
| | | | |
| SL_EXTERN int SLang_push_null (void); | | SL_EXTERN int SLang_push_null (void); | |
| SL_EXTERN int SLang_pop_null (void); | | SL_EXTERN int SLang_pop_null (void); | |
| | | | |
| SL_EXTERN int SLang_push_value (SLtype type, VOID_STAR); | | SL_EXTERN int SLang_push_value (SLtype type, VOID_STAR); | |
| SL_EXTERN int SLang_pop_value (SLtype type, VOID_STAR); | | SL_EXTERN int SLang_pop_value (SLtype type, VOID_STAR); | |
| SL_EXTERN void SLang_free_value (SLtype type, VOID_STAR); | | SL_EXTERN void SLang_free_value (SLtype type, VOID_STAR); | |
| | | | |
| typedef struct _pSLang_Object_Type SLang_Any_Type; | | typedef struct _pSLang_Object_Type SLang_Any_Type; | |
|
| | | | |
| SL_EXTERN int SLang_pop_anytype (SLang_Any_Type **); | | SL_EXTERN int SLang_pop_anytype (SLang_Any_Type **); | |
| SL_EXTERN int SLang_push_anytype (SLang_Any_Type *); | | SL_EXTERN int SLang_push_anytype (SLang_Any_Type *); | |
| SL_EXTERN void SLang_free_anytype (SLang_Any_Type *); | | SL_EXTERN void SLang_free_anytype (SLang_Any_Type *); | |
| | | | |
| #ifdef SLANG_SOURCE_ | | #ifdef SLANG_SOURCE_ | |
| typedef struct _pSLang_Ref_Type SLang_Ref_Type; | | typedef struct _pSLang_Ref_Type SLang_Ref_Type; | |
| #else | | #else | |
| typedef int SLang_Ref_Type; | | typedef int SLang_Ref_Type; | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 1267 | | skipping to change at line 1305 | |
| int utf8_encode); | | int utf8_encode); | |
| | | | |
| SL_EXTERN SLang_Name_Type *SLang_get_function (SLFUTURE_CONST char *); | | SL_EXTERN SLang_Name_Type *SLang_get_function (SLFUTURE_CONST char *); | |
| SL_EXTERN void SLang_release_function (SLang_Name_Type *); | | SL_EXTERN void SLang_release_function (SLang_Name_Type *); | |
| | | | |
| SL_EXTERN int SLreverse_stack (int); | | SL_EXTERN int SLreverse_stack (int); | |
| SL_EXTERN int SLroll_stack (int); | | SL_EXTERN int SLroll_stack (int); | |
| /* If argument p is positive, the top p objects on the stack are rolled | | /* If argument p is positive, the top p objects on the stack are rolled | |
| * up. If negative, the stack is rolled down. | | * up. If negative, the stack is rolled down. | |
| */ | | */ | |
|
| | | | |
| | | /* exchange two items on the stack. The top item is given by 0 */ | |
| | | SL_EXTERN int SLstack_exch (unsigned int, unsigned int); | |
| | | | |
| SL_EXTERN int SLdup_n (int n); | | SL_EXTERN int SLdup_n (int n); | |
| /* Duplicate top n elements of stack */ | | /* Duplicate top n elements of stack */ | |
| | | | |
| SL_EXTERN int SLang_peek_at_stack1 (void); | | SL_EXTERN int SLang_peek_at_stack1 (void); | |
| SL_EXTERN int SLang_peek_at_stack (void); | | SL_EXTERN int SLang_peek_at_stack (void); | |
| SL_EXTERN int SLang_peek_at_stack_n (unsigned int n); | | SL_EXTERN int SLang_peek_at_stack_n (unsigned int n); | |
| SL_EXTERN int SLang_peek_at_stack1_n (unsigned int n); | | SL_EXTERN int SLang_peek_at_stack1_n (unsigned int n); | |
| | | | |
| /* Returns type of next object on stack-- -1 upon stack underflow. */ | | /* Returns type of next object on stack-- -1 upon stack underflow. */ | |
| SL_EXTERN void SLmake_lut (unsigned char *, unsigned char *, unsigned char)
; | | SL_EXTERN void SLmake_lut (unsigned char *, unsigned char *, unsigned char)
; | |
| | | | |
| skipping to change at line 1293 | | skipping to change at line 1335 | |
| VOID_STAR *); | | VOID_STAR *); | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
| /*{{{ Misc Functions */ | | /*{{{ Misc Functions */ | |
| | | | |
| /* This is an interface to atexit */ | | /* This is an interface to atexit */ | |
| SL_EXTERN int SLang_add_cleanup_function (void (*)(void)); | | SL_EXTERN int SLang_add_cleanup_function (void (*)(void)); | |
| | | | |
| SL_EXTERN char *SLmake_string (SLFUTURE_CONST char *); | | SL_EXTERN char *SLmake_string (SLFUTURE_CONST char *); | |
|
| SL_EXTERN char *SLmake_nstring (SLFUTURE_CONST char *, unsigned int); | | SL_EXTERN char *SLmake_nstring (SLFUTURE_CONST char *, SLstrlen_Type); | |
| /* Returns a null terminated string made from the first n characters of the | | /* Returns a null terminated string made from the first n characters of the | |
| * string. | | * string. | |
| */ | | */ | |
| | | | |
| /* Binary strings */ | | /* Binary strings */ | |
| /* The binary string is an opaque type. Use the SLbstring_get_pointer func
tion | | /* The binary string is an opaque type. Use the SLbstring_get_pointer func
tion | |
| * to get a pointer and length. | | * to get a pointer and length. | |
| */ | | */ | |
| typedef struct _pSLang_BString_Type SLang_BString_Type; | | typedef struct _pSLang_BString_Type SLang_BString_Type; | |
|
| SL_EXTERN unsigned char *SLbstring_get_pointer (SLang_BString_Type *, unsig
ned int *); | | SL_EXTERN unsigned char *SLbstring_get_pointer (SLang_BString_Type *, SLstr
len_Type *); | |
| | | | |
| SL_EXTERN SLang_BString_Type *SLbstring_dup (SLang_BString_Type *); | | SL_EXTERN SLang_BString_Type *SLbstring_dup (SLang_BString_Type *); | |
|
| SL_EXTERN SLang_BString_Type *SLbstring_create (unsigned char *, unsigned i
nt); | | SL_EXTERN SLang_BString_Type *SLbstring_create (unsigned char *, SLstrlen_T
ype); | |
| | | | |
|
| /* The create_malloced function used the first argument which is assumed | | /* The create_malloced function uses the first argument which is assumed | |
| * to be a pointer to a len + 1 malloced string. The extra byte is for | | * to be a pointer to a len + 1 malloced string. The extra byte is for | |
| * \0 termination. | | * \0 termination. | |
| */ | | */ | |
|
| SL_EXTERN SLang_BString_Type *SLbstring_create_malloced (unsigned char *, u
nsigned int, int); | | SL_EXTERN SLang_BString_Type *SLbstring_create_malloced (unsigned char *s,
SLstrlen_Type len, int free_on_error); | |
| | | | |
| /* Create a bstring from an slstring */ | | /* Create a bstring from an slstring */ | |
| SL_EXTERN SLang_BString_Type *SLbstring_create_slstring (SLFUTURE_CONST cha
r *); | | SL_EXTERN SLang_BString_Type *SLbstring_create_slstring (SLFUTURE_CONST cha
r *); | |
| | | | |
| SL_EXTERN void SLbstring_free (SLang_BString_Type *); | | SL_EXTERN void SLbstring_free (SLang_BString_Type *); | |
| SL_EXTERN int SLang_pop_bstring (SLang_BString_Type **); | | SL_EXTERN int SLang_pop_bstring (SLang_BString_Type **); | |
| SL_EXTERN int SLang_push_bstring (SLang_BString_Type *); | | SL_EXTERN int SLang_push_bstring (SLang_BString_Type *); | |
| | | | |
|
| SL_EXTERN char *SLmalloc (unsigned int); | | SL_EXTERN SLFUTURE_VOID *SLmalloc (SLstrlen_Type); | |
| SL_EXTERN char *SLcalloc (unsigned int, unsigned int); | | SL_EXTERN SLFUTURE_VOID *SLcalloc (SLstrlen_Type, SLstrlen_Type); | |
| SL_EXTERN void SLfree(char *); /* This function handles NULL */ | | SL_EXTERN void SLfree(SLFUTURE_VOID *); /* This function hand | |
| SL_EXTERN char *SLrealloc (char *, unsigned int); | | les NULL */ | |
| | | SL_EXTERN SLFUTURE_VOID *SLrealloc (SLFUTURE_VOID *, SLstrlen_Type); | |
| | | | |
| SL_EXTERN char *SLcurrent_time_string (void); | | SL_EXTERN char *SLcurrent_time_string (void); | |
| | | | |
| SL_EXTERN int SLatoi(unsigned char *); | | SL_EXTERN int SLatoi(unsigned char *); | |
| SL_EXTERN long SLatol (unsigned char *); | | SL_EXTERN long SLatol (unsigned char *); | |
| SL_EXTERN unsigned long SLatoul (unsigned char *); | | SL_EXTERN unsigned long SLatoul (unsigned char *); | |
| | | | |
| #ifdef HAVE_LONG_LONG | | #ifdef HAVE_LONG_LONG | |
| SL_EXTERN long long SLatoll (unsigned char *s); | | SL_EXTERN long long SLatoll (unsigned char *s); | |
| SL_EXTERN unsigned long long SLatoull (unsigned char *s); | | SL_EXTERN unsigned long long SLatoull (unsigned char *s); | |
| | | | |
| skipping to change at line 1375 | | skipping to change at line 1417 | |
| SL_EXTERN int SLfile_set_clientdata (SLFile_FD_Type *f, void (*free_func)(V
OID_STAR), VOID_STAR cd, int id); | | SL_EXTERN int SLfile_set_clientdata (SLFile_FD_Type *f, void (*free_func)(V
OID_STAR), VOID_STAR cd, int id); | |
| SL_EXTERN int SLfile_get_clientdata (SLFile_FD_Type *f, int id, VOID_STAR *
cdp); | | SL_EXTERN int SLfile_get_clientdata (SLFile_FD_Type *f, int id, VOID_STAR *
cdp); | |
| | | | |
| typedef double (*SLang_To_Double_Fun_Type)(VOID_STAR); | | typedef double (*SLang_To_Double_Fun_Type)(VOID_STAR); | |
| SL_EXTERN SLang_To_Double_Fun_Type SLarith_get_to_double_fun (SLtype, unsig
ned int *); | | SL_EXTERN SLang_To_Double_Fun_Type SLarith_get_to_double_fun (SLtype, unsig
ned int *); | |
| | | | |
| SL_EXTERN int SLang_set_argc_argv (int, char **); | | SL_EXTERN int SLang_set_argc_argv (int, char **); | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
|
| | | /*{{{ Qualifier Functions */ | |
| | | | |
| | | extern int SLang_qualifier_exists (SLCONST char *name); | |
| | | extern int SLang_get_int_qualifier (SLCONST char *name, int *val, int defva | |
| | | l); | |
| | | extern int SLang_get_long_qualifier (SLCONST char *name, long *val, long de | |
| | | fval); | |
| | | extern int SLang_get_double_qualifier (SLCONST char *name, double *val, dou | |
| | | ble defval); | |
| | | extern int SLang_get_string_qualifier (SLCONST char *name, char **val, SLFU | |
| | | TURE_CONST char *defval); | |
| | | | |
| | | /*}}}*/ | |
| | | | |
| /*{{{ SLang getkey interface Functions */ | | /*{{{ SLang getkey interface Functions */ | |
| | | | |
| #ifdef REAL_UNIX_SYSTEM | | #ifdef REAL_UNIX_SYSTEM | |
| SL_EXTERN int SLang_TT_Baud_Rate; | | SL_EXTERN int SLang_TT_Baud_Rate; | |
| SL_EXTERN int SLang_TT_Read_FD; | | SL_EXTERN int SLang_TT_Read_FD; | |
| #else | | #else | |
| # if defined(__WIN32__) | | # if defined(__WIN32__) | |
| /* I do not want to include windows.h just to get the typedef for HANDLE. | | /* I do not want to include windows.h just to get the typedef for HANDLE. | |
| * Make this conditional upon the inclusion of windows.h. | | * Make this conditional upon the inclusion of windows.h. | |
| */ | | */ | |
|
| # ifdef WINVER | | # ifdef _WINDOWS_ | |
| SL_EXTERN HANDLE SLw32_Hstdin; | | SL_EXTERN HANDLE SLw32_Hstdin; | |
| # endif | | # endif | |
| # endif | | # endif | |
| #endif | | #endif | |
| | | | |
| SL_EXTERN int SLang_init_tty (int, int, int); | | SL_EXTERN int SLang_init_tty (int, int, int); | |
| /* Initializes the tty for single character input. If the first parameter
*p1 | | /* Initializes the tty for single character input. If the first parameter
*p1 | |
| * is in the range 0-255, it will be used for the abort character; | | * is in the range 0-255, it will be used for the abort character; | |
| * otherwise, (unix only) if it is -1, the abort character will be the one | | * otherwise, (unix only) if it is -1, the abort character will be the one | |
| * used by the terminal. If the second parameter p2 is non-zero, flow | | * used by the terminal. If the second parameter p2 is non-zero, flow | |
| | | | |
| skipping to change at line 1571 | | skipping to change at line 1623 | |
| SL_EXTERN char *SLrline_get_line (SLrline_Type *); | | SL_EXTERN char *SLrline_get_line (SLrline_Type *); | |
| SL_EXTERN int SLrline_get_hscroll (SLrline_Type *, unsigned int *); | | SL_EXTERN int SLrline_get_hscroll (SLrline_Type *, unsigned int *); | |
| SL_EXTERN int SLrline_get_display_width (SLrline_Type *, unsigned int *); | | SL_EXTERN int SLrline_get_display_width (SLrline_Type *, unsigned int *); | |
| | | | |
| SL_EXTERN int SLrline_set_update_hook (SLrline_Type *, | | SL_EXTERN int SLrline_set_update_hook (SLrline_Type *, | |
| void (*)(SLrline_Type *rli, | | void (*)(SLrline_Type *rli, | |
| SLFUTURE_CONST char *prompt, | | SLFUTURE_CONST char *prompt, | |
| SLFUTURE_CONST char *buf, unsig
ned int len, | | SLFUTURE_CONST char *buf, unsig
ned int len, | |
| unsigned int point, VOID_STAR c
lient_data), | | unsigned int point, VOID_STAR c
lient_data), | |
| VOID_STAR client_data); | | VOID_STAR client_data); | |
|
| | | /* free update_hook client_data */ | |
| | | SL_EXTERN void SLrline_set_free_update_cb (SLrline_Type *, void (*)(SLrline | |
| | | _Type *, VOID_STAR)); | |
| | | | |
| | | /* These functions are passed a pointer to the update_hook client_data */ | |
| | | SL_EXTERN void SLrline_set_update_clear_cb(SLrline_Type *, void (*)(SLrline | |
| | | _Type *, VOID_STAR)); | |
| | | SL_EXTERN void SLrline_set_update_preread_cb (SLrline_Type *, void (*)(SLrl | |
| | | ine_Type *, VOID_STAR)); | |
| | | SL_EXTERN void SLrline_set_update_postread_cb (SLrline_Type *, void (*)(SLr | |
| | | line_Type *, VOID_STAR)); | |
| | | SL_EXTERN void SLrline_set_update_width_cb (SLrline_Type *, void (*)(SLrlin | |
| | | e_Type *, int, VOID_STAR)); | |
| | | SL_EXTERN int SLrline_get_update_client_data (SLrline_Type *, VOID_STAR *); | |
| | | | |
| SL_EXTERN SLkeymap_Type *SLrline_get_keymap (SLrline_Type *); | | SL_EXTERN SLkeymap_Type *SLrline_get_keymap (SLrline_Type *); | |
| | | | |
| SL_EXTERN void SLrline_redraw (SLrline_Type *); | | SL_EXTERN void SLrline_redraw (SLrline_Type *); | |
| SL_EXTERN int SLrline_save_line (SLrline_Type *); | | SL_EXTERN int SLrline_save_line (SLrline_Type *); | |
| SL_EXTERN int SLrline_add_to_history (SLrline_Type *, SLFUTURE_CONST char *
); | | SL_EXTERN int SLrline_add_to_history (SLrline_Type *, SLFUTURE_CONST char *
); | |
| | | | |
| /* Interpreter interface */ | | /* Interpreter interface */ | |
| SL_EXTERN int SLrline_init (SLFUTURE_CONST char *appname, SLFUTURE_CONST ch
ar *user_initfile, SLFUTURE_CONST char *sys_initfile); | | SL_EXTERN int SLrline_init (SLFUTURE_CONST char *appname, SLFUTURE_CONST ch
ar *user_initfile, SLFUTURE_CONST char *sys_initfile); | |
| | | | |
| | | | |
| skipping to change at line 1598 | | skipping to change at line 1659 | |
| SL_EXTERN unsigned long SLtt_Num_Chars_Output; | | SL_EXTERN unsigned long SLtt_Num_Chars_Output; | |
| SL_EXTERN int SLtt_Baud_Rate; | | SL_EXTERN int SLtt_Baud_Rate; | |
| | | | |
| typedef unsigned long SLtt_Char_Type; | | typedef unsigned long SLtt_Char_Type; | |
| | | | |
| #define SLTT_BOLD_MASK 0x01000000UL | | #define SLTT_BOLD_MASK 0x01000000UL | |
| #define SLTT_BLINK_MASK 0x02000000UL | | #define SLTT_BLINK_MASK 0x02000000UL | |
| #define SLTT_ULINE_MASK 0x04000000UL | | #define SLTT_ULINE_MASK 0x04000000UL | |
| #define SLTT_REV_MASK 0x08000000UL | | #define SLTT_REV_MASK 0x08000000UL | |
| #define SLTT_ALTC_MASK 0x10000000UL | | #define SLTT_ALTC_MASK 0x10000000UL | |
|
| | | #define SLTT_ITALIC_MASK 0x20000000UL | |
| | | | |
| SL_EXTERN int SLtt_Screen_Rows; | | SL_EXTERN int SLtt_Screen_Rows; | |
| SL_EXTERN int SLtt_Screen_Cols; | | SL_EXTERN int SLtt_Screen_Cols; | |
| SL_EXTERN int SLtt_Term_Cannot_Insert; | | SL_EXTERN int SLtt_Term_Cannot_Insert; | |
| SL_EXTERN int SLtt_Term_Cannot_Scroll; | | SL_EXTERN int SLtt_Term_Cannot_Scroll; | |
| SL_EXTERN int SLtt_Use_Ansi_Colors; | | SL_EXTERN int SLtt_Use_Ansi_Colors; | |
| SL_EXTERN int SLtt_Ignore_Beep; | | SL_EXTERN int SLtt_Ignore_Beep; | |
| #if defined(REAL_UNIX_SYSTEM) | | #if defined(REAL_UNIX_SYSTEM) | |
| SL_EXTERN int SLtt_Force_Keypad_Init; | | SL_EXTERN int SLtt_Force_Keypad_Init; | |
| SL_EXTERN int SLang_TT_Write_FD; | | SL_EXTERN int SLang_TT_Write_FD; | |
| | | | |
| skipping to change at line 1886 | | skipping to change at line 1948 | |
| # define SLSMG_COLOR_BROWN 0x000003 | | # define SLSMG_COLOR_BROWN 0x000003 | |
| # define SLSMG_COLOR_BLUE 0x000004 | | # define SLSMG_COLOR_BLUE 0x000004 | |
| # define SLSMG_COLOR_MAGENTA 0x000005 | | # define SLSMG_COLOR_MAGENTA 0x000005 | |
| # define SLSMG_COLOR_CYAN 0x000006 | | # define SLSMG_COLOR_CYAN 0x000006 | |
| # define SLSMG_COLOR_LGRAY 0x000007 | | # define SLSMG_COLOR_LGRAY 0x000007 | |
| # define SLSMG_COLOR_GRAY 0x000008 | | # define SLSMG_COLOR_GRAY 0x000008 | |
| # define SLSMG_COLOR_BRIGHT_RED 0x000009 | | # define SLSMG_COLOR_BRIGHT_RED 0x000009 | |
| # define SLSMG_COLOR_BRIGHT_GREEN 0x00000A | | # define SLSMG_COLOR_BRIGHT_GREEN 0x00000A | |
| # define SLSMG_COLOR_BRIGHT_BROWN 0x00000B | | # define SLSMG_COLOR_BRIGHT_BROWN 0x00000B | |
| # define SLSMG_COLOR_BRIGHT_BLUE 0x00000C | | # define SLSMG_COLOR_BRIGHT_BLUE 0x00000C | |
|
| # define SLSMG_COLOR_BRIGHT_CYAN 0x00000D | | # define SLSMG_COLOR_BRIGHT_MAGENTA 0x00000D | |
| # define SLSMG_COLOR_BRIGHT_MAGENTA 0x00000E | | # define SLSMG_COLOR_BRIGHT_CYAN 0x00000E | |
| # define SLSMG_COLOR_BRIGHT_WHITE 0x00000F | | # define SLSMG_COLOR_BRIGHT_WHITE 0x00000F | |
| #endif | | #endif | |
| | | | |
| typedef struct | | typedef struct | |
| { | | { | |
| void (*tt_normal_video)(void); | | void (*tt_normal_video)(void); | |
| void (*tt_set_scroll_region)(int, int); | | void (*tt_set_scroll_region)(int, int); | |
| void (*tt_goto_rc)(int, int); | | void (*tt_goto_rc)(int, int); | |
| void (*tt_reverse_index)(int); | | void (*tt_reverse_index)(int); | |
| void (*tt_reset_scroll_region)(void); | | void (*tt_reset_scroll_region)(void); | |
| | | | |
| skipping to change at line 2294 | | skipping to change at line 2356 | |
| SLANG_LLONG_TYPE, (r)\ | | SLANG_LLONG_TYPE, (r)\ | |
| } | | } | |
| #define MAKE_CSTRUCT_UINT_FIELD(s,f,n,r) {(n), offsetof(s,f),\ | | #define MAKE_CSTRUCT_UINT_FIELD(s,f,n,r) {(n), offsetof(s,f),\ | |
| (sizeof(((s*)0L)->f)==sizeof(int))?(SLANG_UINT_TYPE): \ | | (sizeof(((s*)0L)->f)==sizeof(int))?(SLANG_UINT_TYPE): \ | |
| (sizeof(((s*)0L)->f)==sizeof(short))?(SLANG_USHORT_TYPE): \ | | (sizeof(((s*)0L)->f)==sizeof(short))?(SLANG_USHORT_TYPE): \ | |
| (sizeof(((s*)0L)->f)==sizeof(char))?(SLANG_UCHAR_TYPE): \ | | (sizeof(((s*)0L)->f)==sizeof(char))?(SLANG_UCHAR_TYPE): \ | |
| (sizeof(((s*)0L)->f)==sizeof(long))?(SLANG_ULONG_TYPE): \ | | (sizeof(((s*)0L)->f)==sizeof(long))?(SLANG_ULONG_TYPE): \ | |
| SLANG_ULLONG_TYPE, (r)\ | | SLANG_ULLONG_TYPE, (r)\ | |
| } | | } | |
| | | | |
|
| | | #define MAKE_CSTRUCT_FLOAT_FIELD(s,f,n,r) {(n), offsetof(s,f),\ | |
| | | (sizeof(((s*)0L)->f)==sizeof(float))?(SLANG_FLOAT_TYPE): \ | |
| | | SLANG_DOUBLE_TYPE, (r)\ | |
| | | } | |
| | | | |
| #define SLANG_END_TABLE {NULL} | | #define SLANG_END_TABLE {NULL} | |
| #define SLANG_END_INTRIN_FUN_TABLE MAKE_INTRINSIC_0(NULL,NULL,0) | | #define SLANG_END_INTRIN_FUN_TABLE MAKE_INTRINSIC_0(NULL,NULL,0) | |
| #define SLANG_END_FCONST_TABLE MAKE_DCONSTANT(NULL,0) | | #define SLANG_END_FCONST_TABLE MAKE_DCONSTANT(NULL,0) | |
| #define SLANG_END_DCONST_TABLE MAKE_DCONSTANT(NULL,0) | | #define SLANG_END_DCONST_TABLE MAKE_DCONSTANT(NULL,0) | |
| #define SLANG_END_MATH_UNARY_TABLE MAKE_MATH_UNARY(NULL,0) | | #define SLANG_END_MATH_UNARY_TABLE MAKE_MATH_UNARY(NULL,0) | |
| #define SLANG_END_ARITH_UNARY_TABLE MAKE_ARITH_UNARY(NULL,0) | | #define SLANG_END_ARITH_UNARY_TABLE MAKE_ARITH_UNARY(NULL,0) | |
| #define SLANG_END_ARITH_BINARY_TABLE MAKE_ARITH_BINARY(NULL,0) | | #define SLANG_END_ARITH_BINARY_TABLE MAKE_ARITH_BINARY(NULL,0) | |
| #define SLANG_END_APP_UNARY_TABLE MAKE_APP_UNARY(NULL,0) | | #define SLANG_END_APP_UNARY_TABLE MAKE_APP_UNARY(NULL,0) | |
| #define SLANG_END_INTRIN_VAR_TABLE MAKE_VARIABLE(NULL,NULL,0,0) | | #define SLANG_END_INTRIN_VAR_TABLE MAKE_VARIABLE(NULL,NULL,0,0) | |
| #define SLANG_END_ICONST_TABLE MAKE_ICONSTANT(NULL,0) | | #define SLANG_END_ICONST_TABLE MAKE_ICONSTANT(NULL,0) | |
| | | | |
| skipping to change at line 2332 | | skipping to change at line 2399 | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
| /*{{{ Regular Expression Interface */ | | /*{{{ Regular Expression Interface */ | |
| typedef struct _pSLRegexp_Type SLRegexp_Type; | | typedef struct _pSLRegexp_Type SLRegexp_Type; | |
| SL_EXTERN SLRegexp_Type *SLregexp_compile (SLFUTURE_CONST char *pattern, un
signed int flags); | | SL_EXTERN SLRegexp_Type *SLregexp_compile (SLFUTURE_CONST char *pattern, un
signed int flags); | |
| #define SLREGEXP_CASELESS 0x01 | | #define SLREGEXP_CASELESS 0x01 | |
| #define SLREGEXP_UTF8 0x10 | | #define SLREGEXP_UTF8 0x10 | |
| | | | |
| SL_EXTERN void SLregexp_free (SLRegexp_Type *); | | SL_EXTERN void SLregexp_free (SLRegexp_Type *); | |
|
| SL_EXTERN char *SLregexp_match (SLRegexp_Type *compiled_regexp, SLFUTURE_CO | | SL_EXTERN char *SLregexp_match (SLRegexp_Type *compiled_regexp, SLFUTURE_CO | |
| NST char *str, unsigned int len); | | NST char *str, SLstrlen_Type len); | |
| SL_EXTERN int SLregexp_nth_match (SLRegexp_Type *, unsigned int nth, unsign | | SL_EXTERN int SLregexp_nth_match (SLRegexp_Type *, unsigned int nth, SLstrl | |
| ed int *ofsp, unsigned int *lenp); | | en_Type *ofsp, SLstrlen_Type *lenp); | |
| | | | |
| SL_EXTERN int SLregexp_get_hints (SLRegexp_Type *, unsigned int *flagsp); | | SL_EXTERN int SLregexp_get_hints (SLRegexp_Type *, unsigned int *flagsp); | |
| #define SLREGEXP_HINT_BOL 0x01 /* pattern must match bol */ | | #define SLREGEXP_HINT_BOL 0x01 /* pattern must match bol */ | |
| #define SLREGEXP_HINT_OSEARCH 0x02 /* ordinary search will do */ | | #define SLREGEXP_HINT_OSEARCH 0x02 /* ordinary search will do */ | |
| | | | |
| SL_EXTERN char *SLregexp_quote_string (SLFUTURE_CONST char *pattern, char *
buf, unsigned int buflen); | | SL_EXTERN char *SLregexp_quote_string (SLFUTURE_CONST char *pattern, char *
buf, unsigned int buflen); | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
| /*{{{ SLang Command Interface */ | | /*{{{ SLang Command Interface */ | |
| | | | |
| skipping to change at line 2382 | | skipping to change at line 2449 | |
| SL_EXTERN SLsearch_Type *SLsearch_new (SLuchar_Type *u, int search_flags); | | SL_EXTERN SLsearch_Type *SLsearch_new (SLuchar_Type *u, int search_flags); | |
| #define SLSEARCH_CASELESS 0x1 | | #define SLSEARCH_CASELESS 0x1 | |
| #define SLSEARCH_UTF8 0x2 | | #define SLSEARCH_UTF8 0x2 | |
| | | | |
| SL_EXTERN void SLsearch_delete (SLsearch_Type *); | | SL_EXTERN void SLsearch_delete (SLsearch_Type *); | |
| | | | |
| SL_EXTERN SLuchar_Type *SLsearch_forward (SLsearch_Type *st, | | SL_EXTERN SLuchar_Type *SLsearch_forward (SLsearch_Type *st, | |
| SLuchar_Type *pmin, SLuchar_Type *p
max); | | SLuchar_Type *pmin, SLuchar_Type *p
max); | |
| SL_EXTERN SLuchar_Type *SLsearch_backward (SLsearch_Type *st, | | SL_EXTERN SLuchar_Type *SLsearch_backward (SLsearch_Type *st, | |
| SLuchar_Type *pmin, SLuchar_Type *
pstart, SLuchar_Type *pmax); | | SLuchar_Type *pmin, SLuchar_Type *
pstart, SLuchar_Type *pmax); | |
|
| SL_EXTERN unsigned int SLsearch_match_len (SLsearch_Type *); | | SL_EXTERN SLstrlen_Type SLsearch_match_len (SLsearch_Type *); | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
| /*{{{ SLang Pathname Interface */ | | /*{{{ SLang Pathname Interface */ | |
| | | | |
| /* These function return pointers to the original space */ | | /* These function return pointers to the original space */ | |
| SL_EXTERN char *SLpath_basename (SLFUTURE_CONST char *); | | SL_EXTERN char *SLpath_basename (SLFUTURE_CONST char *); | |
| SL_EXTERN char *SLpath_extname (SLFUTURE_CONST char *); | | SL_EXTERN char *SLpath_extname (SLFUTURE_CONST char *); | |
| | | | |
| SL_EXTERN int SLpath_is_absolute_path (SLFUTURE_CONST char *); | | SL_EXTERN int SLpath_is_absolute_path (SLFUTURE_CONST char *); | |
| | | | |
| skipping to change at line 2409 | | skipping to change at line 2476 | |
| SL_EXTERN int SLpath_set_load_path (SLFUTURE_CONST char *); | | SL_EXTERN int SLpath_set_load_path (SLFUTURE_CONST char *); | |
| /* search path for loading .sl files --- returns slstring */ | | /* search path for loading .sl files --- returns slstring */ | |
| SL_EXTERN char *SLpath_get_load_path (void); | | SL_EXTERN char *SLpath_get_load_path (void); | |
| | | | |
| /* These return malloced strings--- NOT slstrings */ | | /* These return malloced strings--- NOT slstrings */ | |
| SL_EXTERN char *SLpath_dircat (SLFUTURE_CONST char *, SLFUTURE_CONST char *
); | | SL_EXTERN char *SLpath_dircat (SLFUTURE_CONST char *, SLFUTURE_CONST char *
); | |
| SL_EXTERN char *SLpath_find_file_in_path (SLFUTURE_CONST char *, SLFUTURE_C
ONST char *); | | SL_EXTERN char *SLpath_find_file_in_path (SLFUTURE_CONST char *, SLFUTURE_C
ONST char *); | |
| SL_EXTERN char *SLpath_dirname (SLFUTURE_CONST char *); | | SL_EXTERN char *SLpath_dirname (SLFUTURE_CONST char *); | |
| SL_EXTERN int SLpath_file_exists (SLFUTURE_CONST char *); | | SL_EXTERN int SLpath_file_exists (SLFUTURE_CONST char *); | |
| SL_EXTERN char *SLpath_pathname_sans_extname (SLFUTURE_CONST char *); | | SL_EXTERN char *SLpath_pathname_sans_extname (SLFUTURE_CONST char *); | |
|
| | | SL_EXTERN char *SLpath_getcwd (void); /* return NULL on error, sets errno
*/ | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
| SL_EXTERN int SLang_set_module_load_path (SLFUTURE_CONST char *); | | SL_EXTERN int SLang_set_module_load_path (SLFUTURE_CONST char *); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| # define SLANG_MODULE(name) \ | | # define SLANG_MODULE(name) \ | |
| extern SL_EXPORT "C" int init_##name##_module_ns (char *); \ | | extern SL_EXPORT "C" int init_##name##_module_ns (char *); \ | |
| extern SL_EXPORT "C" void deinit_##name##_module (void); \ | | extern SL_EXPORT "C" void deinit_##name##_module (void); \ | |
| extern SL_EXPORT "C" int SLmodule_##name##_api_version; \ | | extern SL_EXPORT "C" int SLmodule_##name##_api_version; \ | |
| | | | |
End of changes. 31 change blocks. |
| 35 lines changed or deleted | | 118 lines changed or added | |
|