| 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-2009 John E. Davis | | Copyright (C) 2004-2010 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 20202 | | #define SLANG_VERSION 20203 | |
| #define SLANG_VERSION_STRING "2.2.2" | | #define SLANG_VERSION_STRING "2.2.3" | |
| /* #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 277 | | skipping to change at line 277 | |
| | | | |
| 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 */ | | /* SLstrings */ | |
| typedef char SLstr_Type; | | typedef char SLstr_Type; | |
|
| | | typedef unsigned int SLstrlen_Type; /* Eventually this will become size_ | |
| | | t */ | |
| | | #define SLANG_STRLEN_TYPE SLANG_UINT_TYPE | |
| | | SL_EXTERN int SLang_pop_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 *, unsign
ed int); | | 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 (SLstr_Type *); /* handles NULL */ | |
| 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)
; | |
| | | | |
| SL_EXTERN void SLstring_dump_stats (void); | | SL_EXTERN void SLstring_dump_stats (void); | |
| | | | |
| /*{{{ UTF-8 and Wide Char support */ | | /*{{{ UTF-8 and Wide Char support */ | |
| | | | |
| #if SLANG_SIZEOF_INT == 4 | | #if SLANG_SIZEOF_INT == 4 | |
| | | | |
| skipping to change at line 346 | | skipping to change at line 351 | |
| #define SLWCWIDTH_SINGLE_WIDTH 0x0001 /* all double width characters given
as single width */ | | #define SLWCWIDTH_SINGLE_WIDTH 0x0001 /* all double width characters given
as single width */ | |
| #define SLWCWIDTH_CJK_LEGACY 0x0002 /* Ambiguous characters given width o
f 2 */ | | #define SLWCWIDTH_CJK_LEGACY 0x0002 /* Ambiguous characters given width o
f 2 */ | |
| SL_EXTERN int SLwchar_set_wcwidth_flags (int flags); | | SL_EXTERN int SLwchar_set_wcwidth_flags (int flags); | |
| | | | |
| /* The skip_char functions also skip over malformed strings counting each b
yte | | /* The skip_char functions also skip over malformed strings counting each b
yte | |
| * in the malformed sequence. | | * in the malformed sequence. | |
| */ | | */ | |
| SL_EXTERN SLuchar_Type *SLutf8_skip_char (SLuchar_Type *u, SLuchar_Type *um
ax); | | SL_EXTERN SLuchar_Type *SLutf8_skip_char (SLuchar_Type *u, SLuchar_Type *um
ax); | |
| SL_EXTERN SLuchar_Type *SLutf8_bskip_char (SLuchar_Type *umin, SLuchar_Type
*u); | | SL_EXTERN SLuchar_Type *SLutf8_bskip_char (SLuchar_Type *umin, SLuchar_Type
*u); | |
| SL_EXTERN SLuchar_Type *SLutf8_skip_chars (SLuchar_Type *u, SLuchar_Type *u
max, | | SL_EXTERN SLuchar_Type *SLutf8_skip_chars (SLuchar_Type *u, SLuchar_Type *u
max, | |
|
| unsigned int num, unsigned int *dnum
, | | SLstrlen_Type num, SLstrlen_Type *dn
um, | |
| int ignore_combining ); | | int ignore_combining ); | |
| SL_EXTERN SLuchar_Type *SLutf8_bskip_chars (SLuchar_Type *umin, SLuchar_Typ
e *u, | | SL_EXTERN SLuchar_Type *SLutf8_bskip_chars (SLuchar_Type *umin, SLuchar_Typ
e *u, | |
|
| unsigned int num, unsigned int *dn
um, | | SLstrlen_Type num, SLstrlen_Type *
dnum, | |
| int ignore_combining); | | int ignore_combining); | |
| | | | |
| /* The SLutf8_strup/lo functions return slstrings -- free with SLang_free_s
lstring */ | | /* The SLutf8_strup/lo functions return slstrings -- free with SLang_free_s
lstring */ | |
| SL_EXTERN SLuchar_Type *SLutf8_strup (SLuchar_Type *u, SLuchar_Type *umax); | | SL_EXTERN SLuchar_Type *SLutf8_strup (SLuchar_Type *u, SLuchar_Type *umax); | |
| SL_EXTERN SLuchar_Type *SLutf8_strlo (SLuchar_Type *u, SLuchar_Type *umax); | | SL_EXTERN SLuchar_Type *SLutf8_strlo (SLuchar_Type *u, SLuchar_Type *umax); | |
| | | | |
| SL_EXTERN SLstr_Type *SLutf8_subst_wchar (SLuchar_Type *u, SLuchar_Type *um
ax, | | SL_EXTERN SLstr_Type *SLutf8_subst_wchar (SLuchar_Type *u, SLuchar_Type *um
ax, | |
|
| SLwchar_Type wch, unsigned int pos, | | SLwchar_Type wch, SLstrlen_Type pos, | |
| int ignore_combining); | | int ignore_combining); | |
| | | | |
|
| SL_EXTERN unsigned int SLutf8_strlen (SLuchar_Type *s, int ignore_combining
); | | SL_EXTERN SLstrlen_Type SLutf8_strlen (SLuchar_Type *s, int ignore_combinin
g); | |
| SL_EXTERN SLuchar_Type *SLutf8_decode (SLuchar_Type *u, SLuchar_Type *umax, | | SL_EXTERN SLuchar_Type *SLutf8_decode (SLuchar_Type *u, SLuchar_Type *umax, | |
|
| SLwchar_Type *w, unsigned int *nconsume | | SLwchar_Type *w, SLstrlen_Type *nconsum | |
| dp); | | edp); | |
| SL_EXTERN SLuchar_Type *SLutf8_encode (SLwchar_Type w, SLuchar_Type *u, uns | | SL_EXTERN SLuchar_Type *SLutf8_encode (SLwchar_Type w, SLuchar_Type *u, SLs | |
| igned int ulen); | | trlen_Type ulen); | |
| | | | |
| SL_EXTERN int SLutf8_compare (SLuchar_Type *a, SLuchar_Type *amax, | | SL_EXTERN int SLutf8_compare (SLuchar_Type *a, SLuchar_Type *amax, | |
|
| SLuchar_Type *b, SLuchar_Type *bmax, | | SLuchar_Type *b, SLuchar_Type *bmax, | |
| unsigned int nchars, int case_sensitive); | | SLstrlen_Type nchars, int case_sensitive); | |
| | | | |
| /* In these functions, buf is assumed to contain at least SLUTF8_MAX_MBLEN+
1 | | /* In these functions, buf is assumed to contain at least SLUTF8_MAX_MBLEN+
1 | |
| * bytes | | * bytes | |
| */ | | */ | |
| SL_EXTERN SLuchar_Type *SLutf8_extract_utf8_char (SLuchar_Type *u, SLuchar_
Type *umax, SLuchar_Type *buf); | | SL_EXTERN SLuchar_Type *SLutf8_extract_utf8_char (SLuchar_Type *u, SLuchar_
Type *umax, SLuchar_Type *buf); | |
| SL_EXTERN SLuchar_Type *SLutf8_encode_null_terminate (SLwchar_Type w, SLuch
ar_Type *buf); | | SL_EXTERN SLuchar_Type *SLutf8_encode_null_terminate (SLwchar_Type w, SLuch
ar_Type *buf); | |
| | | | |
| typedef struct SLwchar_Lut_Type SLwchar_Lut_Type; | | typedef struct SLwchar_Lut_Type SLwchar_Lut_Type; | |
| SL_EXTERN SLwchar_Lut_Type *SLwchar_create_lut (unsigned int num_entries); | | SL_EXTERN SLwchar_Lut_Type *SLwchar_create_lut (unsigned int num_entries); | |
| SL_EXTERN int SLwchar_add_range_to_lut (SLwchar_Lut_Type *r, SLwchar_Type a
, SLwchar_Type b); | | SL_EXTERN int SLwchar_add_range_to_lut (SLwchar_Lut_Type *r, SLwchar_Type a
, SLwchar_Type b); | |
| | | | |
| skipping to change at line 569 | | skipping to change at line 574 | |
| SLtype type; | | SLtype type; | |
| unsigned char read_only; | | unsigned char read_only; | |
| } | | } | |
| SLang_CStruct_Field_Type; | | SLang_CStruct_Field_Type; | |
| | | | |
| SL_EXTERN int SLadd_intrin_fun_table (SLang_Intrin_Fun_Type *, SLFUTURE_CON
ST char *); | | SL_EXTERN int SLadd_intrin_fun_table (SLang_Intrin_Fun_Type *, SLFUTURE_CON
ST char *); | |
| SL_EXTERN int SLadd_intrin_var_table (SLang_Intrin_Var_Type *, SLFUTURE_CON
ST char *); | | SL_EXTERN int SLadd_intrin_var_table (SLang_Intrin_Var_Type *, SLFUTURE_CON
ST char *); | |
| SL_EXTERN int SLadd_app_unary_table (SLang_App_Unary_Type *, SLFUTURE_CONST
char *); | | SL_EXTERN int SLadd_app_unary_table (SLang_App_Unary_Type *, SLFUTURE_CONST
char *); | |
| SL_EXTERN int SLadd_math_unary_table (SLang_Math_Unary_Type *, SLFUTURE_CON
ST char *); | | SL_EXTERN int SLadd_math_unary_table (SLang_Math_Unary_Type *, SLFUTURE_CON
ST char *); | |
| SL_EXTERN int SLadd_iconstant_table (SLang_IConstant_Type *, SLFUTURE_CONST
char *); | | SL_EXTERN int SLadd_iconstant_table (SLang_IConstant_Type *, SLFUTURE_CONST
char *); | |
|
| | | SL_EXTERN int SLadd_lconstant_table (SLang_LConstant_Type *, SLFUTURE_CONST
char *pp); | |
| SL_EXTERN int SLadd_dconstant_table (SLang_DConstant_Type *, SLFUTURE_CONST
char *); | | SL_EXTERN int SLadd_dconstant_table (SLang_DConstant_Type *, SLFUTURE_CONST
char *); | |
| SL_EXTERN int SLadd_fconstant_table (SLang_FConstant_Type *, SLFUTURE_CONST
char *); | | SL_EXTERN int SLadd_fconstant_table (SLang_FConstant_Type *, SLFUTURE_CONST
char *); | |
| #ifdef HAVE_LONG_LONG | | #ifdef HAVE_LONG_LONG | |
| SL_EXTERN int SLadd_llconstant_table (SLang_LLConstant_Type *, SLFUTURE_CON
ST char *); | | SL_EXTERN int SLadd_llconstant_table (SLang_LLConstant_Type *, SLFUTURE_CON
ST char *); | |
| #endif | | #endif | |
| SL_EXTERN int SLadd_istruct_table (SLang_IStruct_Field_Type *, VOID_STAR, S
LFUTURE_CONST char *); | | SL_EXTERN int SLadd_istruct_table (SLang_IStruct_Field_Type *, VOID_STAR, S
LFUTURE_CONST char *); | |
| | | | |
| 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 *); | |
| | | | |
| skipping to change at line 665 | | skipping to change at line 671 | |
| # 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_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 **); | |
| | | | |
| 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 | |
| | | | |
| skipping to change at line 732 | | skipping to change at line 744 | |
| SL_EXTERN int SLclass_set_aput_function (SLang_Class_Type *, int (*)(SLtype
, unsigned int)); | | SL_EXTERN int SLclass_set_aput_function (SLang_Class_Type *, int (*)(SLtype
, unsigned int)); | |
| SL_EXTERN int SLclass_set_anew_function (SLang_Class_Type *, int (*)(SLtype
, unsigned int)); | | SL_EXTERN int SLclass_set_anew_function (SLang_Class_Type *, int (*)(SLtype
, unsigned int)); | |
| | | | |
| SL_EXTERN int SLclass_set_sget_function (SLang_Class_Type *, int (*)(SLtype
, SLFUTURE_CONST char *)); | | SL_EXTERN int SLclass_set_sget_function (SLang_Class_Type *, int (*)(SLtype
, SLFUTURE_CONST char *)); | |
| SL_EXTERN int SLclass_set_sput_function (SLang_Class_Type *, int (*)(SLtype
, SLFUTURE_CONST char *)); | | SL_EXTERN int SLclass_set_sput_function (SLang_Class_Type *, int (*)(SLtype
, SLFUTURE_CONST char *)); | |
| | | | |
| SL_EXTERN int SLclass_set_acopy_function (SLang_Class_Type *, int (*)(SLtyp
e, VOID_STAR, VOID_STAR)); | | SL_EXTERN int SLclass_set_acopy_function (SLang_Class_Type *, int (*)(SLtyp
e, VOID_STAR, VOID_STAR)); | |
| SL_EXTERN int SLclass_set_deref_function (SLang_Class_Type *, int (*)(SLtyp
e, VOID_STAR)); | | SL_EXTERN int SLclass_set_deref_function (SLang_Class_Type *, int (*)(SLtyp
e, VOID_STAR)); | |
| SL_EXTERN int SLclass_set_eqs_function (SLang_Class_Type *, int (*)(SLtype,
VOID_STAR, SLtype, VOID_STAR)); | | SL_EXTERN int SLclass_set_eqs_function (SLang_Class_Type *, int (*)(SLtype,
VOID_STAR, SLtype, VOID_STAR)); | |
| | | | |
|
| SL_EXTERN int SLclass_set_length_function (SLang_Class_Type *, int(*)(SLtyp
e, VOID_STAR, unsigned int *)); | | SL_EXTERN int SLclass_set_length_function (SLang_Class_Type *, int(*)(SLtyp
e, VOID_STAR, SLuindex_Type *)); | |
| | | | |
| SL_EXTERN int SLclass_set_is_container (SLang_Class_Type *, int); | | SL_EXTERN int SLclass_set_is_container (SLang_Class_Type *, int); | |
| SL_EXTERN int SLclass_set_foreach_functions ( | | SL_EXTERN int SLclass_set_foreach_functions ( | |
| SLang_Class_Type *, | | SLang_Class_Type *, | |
| SLang_Foreach_Context_Type *(*)(SLtype, unsigned int), /* open method *
/ | | SLang_Foreach_Context_Type *(*)(SLtype, unsigned int), /* open method *
/ | |
| int (*)(SLtype, SLang_Foreach_Context_Type *), /* foreach method */ | | int (*)(SLtype, SLang_Foreach_Context_Type *), /* foreach method */ | |
| void (*)(SLtype, SLang_Foreach_Context_Type *));/* close method */ | | void (*)(SLtype, SLang_Foreach_Context_Type *));/* close method */ | |
| | | | |
| /* When an array is created, this callback function is called to initialize
the data | | /* When an array is created, this callback function is called to initialize
the data | |
| * at the specified address. | | * at the specified address. | |
| | | | |
| skipping to change at line 779 | | skipping to change at line 791 | |
| #define SLMATH_ISINF 21 | | #define SLMATH_ISINF 21 | |
| #define SLMATH_ISNAN 22 | | #define SLMATH_ISNAN 22 | |
| #define SLMATH_FLOOR 23 | | #define SLMATH_FLOOR 23 | |
| #define SLMATH_CEIL 24 | | #define SLMATH_CEIL 24 | |
| #define SLMATH_ROUND 25 | | #define SLMATH_ROUND 25 | |
| #define SLMATH_EXPM1 26 | | #define SLMATH_EXPM1 26 | |
| #define SLMATH_LOG1P 27 | | #define SLMATH_LOG1P 27 | |
| | | | |
| SL_EXTERN int SLclass_add_unary_op (SLtype, | | SL_EXTERN int SLclass_add_unary_op (SLtype, | |
| int (*) (int, | | int (*) (int, | |
|
| SLtype, VOID_STAR, unsigned int, | | SLtype, VOID_STAR, SLuindex_Type, | |
| VOID_STAR), | | VOID_STAR), | |
| int (*) (int, SLtype, SLtype *)); | | int (*) (int, SLtype, SLtype *)); | |
| | | | |
| SL_EXTERN int | | SL_EXTERN int | |
| SLclass_add_app_unary_op (SLtype, | | SLclass_add_app_unary_op (SLtype, | |
| int (*) (int, | | int (*) (int, | |
|
| SLtype, VOID_STAR, unsigned int, | | SLtype, VOID_STAR, SLuindex_Type, | |
| VOID_STAR), | | VOID_STAR), | |
| int (*) (int, SLtype, SLtype *)); | | int (*) (int, SLtype, SLtype *)); | |
| | | | |
| SL_EXTERN int | | SL_EXTERN int | |
| SLclass_add_binary_op (SLtype, SLtype, | | SLclass_add_binary_op (SLtype, SLtype, | |
| int (*) (int, | | int (*) (int, | |
|
| SLtype, VOID_STAR, unsigned int, | | SLtype, VOID_STAR, SLuindex_Type, | |
| SLtype, VOID_STAR, unsigned int, | | SLtype, VOID_STAR, SLuindex_Type, | |
| VOID_STAR), | | VOID_STAR), | |
| int (*) (int, SLtype, SLtype, SLtype *)); | | int (*) (int, SLtype, SLtype, SLtype *)); | |
| | | | |
| SL_EXTERN int | | SL_EXTERN int | |
| SLclass_add_math_op (SLtype, | | SLclass_add_math_op (SLtype, | |
| int (*)(int, | | int (*)(int, | |
|
| SLtype, VOID_STAR, unsigned int, | | SLtype, VOID_STAR, SLuindex_Type, | |
| VOID_STAR), | | VOID_STAR), | |
| int (*)(int, SLtype, SLtype *)); | | int (*)(int, SLtype, SLtype *)); | |
| | | | |
| SL_EXTERN int | | SL_EXTERN int | |
| SLclass_add_typecast (SLtype /* from */, SLtype /* to */, | | SLclass_add_typecast (SLtype /* from */, SLtype /* to */, | |
|
| int (*)_PROTO((SLtype, VOID_STAR, unsigned int, | | int (*)_PROTO((SLtype, VOID_STAR, SLuindex_Type, | |
| SLtype, VOID_STAR)), | | SLtype, VOID_STAR)), | |
| int /* allow implicit typecasts */ | | int /* allow implicit typecasts */ | |
| ); | | ); | |
| | | | |
| SL_EXTERN SLFUTURE_CONST char *SLclass_get_datatype_name (SLtype); | | SL_EXTERN SLFUTURE_CONST char *SLclass_get_datatype_name (SLtype); | |
| | | | |
| SL_EXTERN double SLcomplex_abs (double *); | | SL_EXTERN double SLcomplex_abs (double *); | |
| SL_EXTERN double *SLcomplex_times (double *, double *, double *); | | SL_EXTERN double *SLcomplex_times (double *, double *, double *); | |
| SL_EXTERN double *SLcomplex_divide (double *, double *, double *); | | SL_EXTERN double *SLcomplex_divide (double *, double *, double *); | |
| SL_EXTERN double *SLcomplex_sin (double *, double *); | | SL_EXTERN double *SLcomplex_sin (double *, double *); | |
| | | | |
| skipping to change at line 853 | | skipping to change at line 865 | |
| | | | |
| SL_EXTERN void SLang_free_mmt (SLang_MMT_Type *); | | SL_EXTERN void SLang_free_mmt (SLang_MMT_Type *); | |
| SL_EXTERN VOID_STAR SLang_object_from_mmt (SLang_MMT_Type *); | | SL_EXTERN VOID_STAR SLang_object_from_mmt (SLang_MMT_Type *); | |
| SL_EXTERN SLang_MMT_Type *SLang_create_mmt (SLtype, VOID_STAR); | | SL_EXTERN SLang_MMT_Type *SLang_create_mmt (SLtype, VOID_STAR); | |
| SL_EXTERN int SLang_push_mmt (SLang_MMT_Type *); | | SL_EXTERN int SLang_push_mmt (SLang_MMT_Type *); | |
| SL_EXTERN SLang_MMT_Type *SLang_pop_mmt (SLtype); | | SL_EXTERN SLang_MMT_Type *SLang_pop_mmt (SLtype); | |
| SL_EXTERN void SLang_inc_mmt (SLang_MMT_Type *); | | SL_EXTERN void SLang_inc_mmt (SLang_MMT_Type *); | |
| | | | |
| /* Maximum number of dimensions of an array. */ | | /* Maximum number of dimensions of an array. */ | |
| #define SLARRAY_MAX_DIMS 7 | | #define SLARRAY_MAX_DIMS 7 | |
|
| 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 *); | | | |
| typedef struct _pSLang_Array_Type | | typedef struct _pSLang_Array_Type | |
| { | | { | |
| SLtype data_type; | | SLtype data_type; | |
| unsigned int sizeof_type; | | unsigned int sizeof_type; | |
| VOID_STAR data; | | VOID_STAR data; | |
| SLuindex_Type num_elements; | | SLuindex_Type num_elements; | |
| unsigned int num_dims; | | unsigned int num_dims; | |
| SLindex_Type dims [SLARRAY_MAX_DIMS]; | | SLindex_Type dims [SLARRAY_MAX_DIMS]; | |
| VOID_STAR (*index_fun)_PROTO((struct _pSLang_Array_Type *, SLindex_Type
*)); | | VOID_STAR (*index_fun)_PROTO((struct _pSLang_Array_Type *, SLindex_Type
*)); | |
| /* This function is designed to allow a type to store an array in | | /* This function is designed to allow a type to store an array in | |
| | | | |
| skipping to change at line 1526 | | skipping to change at line 1534 | |
| | | | |
| SL_EXTERN int SLang_Key_TimeOut_Flag; | | SL_EXTERN int SLang_Key_TimeOut_Flag; | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
| /*{{{ SLang Readline Interface */ | | /*{{{ SLang Readline Interface */ | |
| | | | |
| typedef struct _pSLrline_Type SLrline_Type; | | typedef struct _pSLrline_Type SLrline_Type; | |
| SL_EXTERN SLrline_Type *SLrline_open (unsigned int width, unsigned int flag
s); | | SL_EXTERN SLrline_Type *SLrline_open (unsigned int width, unsigned int flag
s); | |
| SL_EXTERN SLrline_Type *SLrline_open2 (SLFUTURE_CONST char *, unsigned int
width, unsigned int flags); | | SL_EXTERN SLrline_Type *SLrline_open2 (SLFUTURE_CONST char *, unsigned int
width, unsigned int flags); | |
|
| #define SL_RLINE_NO_ECHO 1 | | #define SL_RLINE_NO_ECHO 0x0001 | |
| #define SL_RLINE_USE_ANSI 2 | | #define SL_RLINE_USE_ANSI 0x0002 | |
| #define SL_RLINE_BLINK_MATCH 4 | | #define SL_RLINE_BLINK_MATCH 0x0004 | |
| #define SL_RLINE_UTF8_MODE 8 | | #define SL_RLINE_UTF8_MODE 0x0008 | |
| | | #define SL_RLINE_USE_MULTILINE 0x0010 | |
| | | | |
| SL_EXTERN void SLrline_close (SLrline_Type *); | | SL_EXTERN void SLrline_close (SLrline_Type *); | |
| | | | |
| /* This returns a malloced string */ | | /* This returns a malloced string */ | |
| SL_EXTERN char *SLrline_read_line (SLrline_Type *, SLFUTURE_CONST char *pro
mpt, unsigned int *lenp); | | SL_EXTERN char *SLrline_read_line (SLrline_Type *, SLFUTURE_CONST char *pro
mpt, unsigned int *lenp); | |
| | | | |
| SL_EXTERN int SLrline_bol (SLrline_Type *); | | SL_EXTERN int SLrline_bol (SLrline_Type *); | |
| SL_EXTERN int SLrline_eol (SLrline_Type *); | | SL_EXTERN int SLrline_eol (SLrline_Type *); | |
| SL_EXTERN int SLrline_del (SLrline_Type *, unsigned int len); | | SL_EXTERN int SLrline_del (SLrline_Type *, unsigned int len); | |
| SL_EXTERN int SLrline_ins (SLrline_Type *, SLFUTURE_CONST char *s, unsigned
int len); | | SL_EXTERN int SLrline_ins (SLrline_Type *, SLFUTURE_CONST char *s, unsigned
int len); | |
| SL_EXTERN int SLrline_move (SLrline_Type *, int); | | SL_EXTERN int SLrline_move (SLrline_Type *, int); | |
| | | | |
| skipping to change at line 1681 | | skipping to change at line 1691 | |
| SL_EXTERN void SLtt_set_alt_char_set (int); | | SL_EXTERN void SLtt_set_alt_char_set (int); | |
| SL_EXTERN int SLtt_write_to_status_line (SLFUTURE_CONST char *, int); | | SL_EXTERN int SLtt_write_to_status_line (SLFUTURE_CONST char *, int); | |
| SL_EXTERN void SLtt_disable_status_line (void); | | SL_EXTERN void SLtt_disable_status_line (void); | |
| # ifdef REAL_UNIX_SYSTEM | | # ifdef REAL_UNIX_SYSTEM | |
| /* These are termcap/terminfo routines that assume SLtt_initialize has | | /* These are termcap/terminfo routines that assume SLtt_initialize has | |
| * been called. | | * been called. | |
| */ | | */ | |
| SL_EXTERN char *SLtt_tgetstr (SLFUTURE_CONST char *); | | SL_EXTERN char *SLtt_tgetstr (SLFUTURE_CONST char *); | |
| SL_EXTERN int SLtt_tgetnum (SLFUTURE_CONST char *); | | SL_EXTERN int SLtt_tgetnum (SLFUTURE_CONST char *); | |
| SL_EXTERN int SLtt_tgetflag (SLFUTURE_CONST char *); | | SL_EXTERN int SLtt_tgetflag (SLFUTURE_CONST char *); | |
|
| | | SL_EXTERN int SLtt_tgetent(char *name); | |
| | | SL_EXTERN char *SLtt_tgoto(char *cap, int col, int row); | |
| | | SL_EXTERN int SLtt_tputs(char *str, int affcnt, int (*putcfun)(int)); | |
| | | | |
| /* The following are terminfo-only routines -- these prototypes will change | | /* The following are terminfo-only routines -- these prototypes will change | |
| * in V2.x. | | * in V2.x. | |
| */ | | */ | |
| SL_EXTERN char *SLtt_tigetent (SLFUTURE_CONST char *); | | SL_EXTERN char *SLtt_tigetent (SLFUTURE_CONST char *); | |
| SL_EXTERN char *SLtt_tigetstr (SLFUTURE_CONST char *, char **); | | SL_EXTERN char *SLtt_tigetstr (SLFUTURE_CONST char *, char **); | |
| SL_EXTERN int SLtt_tigetnum (SLFUTURE_CONST char *, char **); | | SL_EXTERN int SLtt_tigetnum (SLFUTURE_CONST char *, char **); | |
| # endif | | # endif | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 2244 | | skipping to change at line 2257 | |
| | | | |
| #define MAKE_HCONSTANT_T(n,val,T) \ | | #define MAKE_HCONSTANT_T(n,val,T) \ | |
| {(n),NULL, SLANG_HCONSTANT, T, (short)(val)} | | {(n),NULL, SLANG_HCONSTANT, T, (short)(val)} | |
| #define MAKE_HCONSTANT(n,val) MAKE_HCONSTANT_T(n,val,SLANG_SHORT_TYPE) | | #define MAKE_HCONSTANT(n,val) MAKE_HCONSTANT_T(n,val,SLANG_SHORT_TYPE) | |
| | | | |
| #define MAKE_ICONSTANT_T(n,val,T) \ | | #define MAKE_ICONSTANT_T(n,val,T) \ | |
| {(n),NULL, SLANG_ICONSTANT, T, (int)(val)} | | {(n),NULL, SLANG_ICONSTANT, T, (int)(val)} | |
| #define MAKE_ICONSTANT(n,val) MAKE_ICONSTANT_T(n,val,SLANG_INT_TYPE) | | #define MAKE_ICONSTANT(n,val) MAKE_ICONSTANT_T(n,val,SLANG_INT_TYPE) | |
| | | | |
| #define MAKE_LCONSTANT_T(n,val,T) \ | | #define MAKE_LCONSTANT_T(n,val,T) \ | |
|
| {(n),NULL, SLANG_LCONSTANT, T, (int)(val)} | | {(n),NULL, SLANG_LCONSTANT, T, (long)(val)} | |
| #define MAKE_LCONSTANT(n,val) MAKE_LCONSTANT_T(n,val,SLANG_LONG_TYPE) | | #define MAKE_LCONSTANT(n,val) MAKE_LCONSTANT_T(n,val,SLANG_LONG_TYPE) | |
| | | | |
| #ifdef HAVE_LONG_LONG | | #ifdef HAVE_LONG_LONG | |
| # define MAKE_LLCONSTANT_T(n,val,T) \ | | # define MAKE_LLCONSTANT_T(n,val,T) \ | |
| {(n),NULL, T, (long long)(val)} | | {(n),NULL, T, (long long)(val)} | |
| # define MAKE_LLCONSTANT(n,val) MAKE_LLCONSTANT_T(n,val,SLANG_LLONG_TYPE) | | # define MAKE_LLCONSTANT(n,val) MAKE_LLCONSTANT_T(n,val,SLANG_LLONG_TYPE) | |
| #endif | | #endif | |
| | | | |
| #define MAKE_FCONSTANT(n,val) \ | | #define MAKE_FCONSTANT(n,val) \ | |
| {(n),NULL, SLANG_FCONSTANT, (val)} | | {(n),NULL, SLANG_FCONSTANT, (val)} | |
| | | | |
| skipping to change at line 2291 | | skipping to change at line 2304 | |
| #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) | |
|
| | | #define SLANG_END_LCONST_TABLE MAKE_LCONSTANT(NULL,0) | |
| #define SLANG_END_LLCONST_TABLE MAKE_LLCONSTANT(NULL,0) | | #define SLANG_END_LLCONST_TABLE MAKE_LLCONSTANT(NULL,0) | |
| #define SLANG_END_ISTRUCT_TABLE {NULL, 0, 0, 0} | | #define SLANG_END_ISTRUCT_TABLE {NULL, 0, 0, 0} | |
| #define SLANG_END_CSTRUCT_TABLE {NULL, 0, 0, 0} | | #define SLANG_END_CSTRUCT_TABLE {NULL, 0, 0, 0} | |
| | | | |
| /*}}}*/ | | /*}}}*/ | |
| | | | |
| /*{{{ Upper/Lowercase Functions */ | | /*{{{ Upper/Lowercase Functions */ | |
| | | | |
| SL_EXTERN void SLang_define_case(int *, int *); | | SL_EXTERN void SLang_define_case(int *, int *); | |
| SL_EXTERN void SLang_init_case_tables (void); | | SL_EXTERN void SLang_init_case_tables (void); | |
| | | | |
End of changes. 23 change blocks. |
| 30 lines changed or deleted | | 45 lines changed or added | |
|