2000-07-28
2000-07-28 17:16:56 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
-
1f21335d77ba21a17d4aafbc236b50418322b885
(155 lines)
(+78/-77)
[
Show
| Annotate
]
Branch: 7.9
JUMBOPATCH: dynamic loading now works on Win* !!!! (somewhat experimental :)
Rev: src/.cvsignore:1.24
Rev: src/Makefile.in:1.198
Rev: src/aclocal.m4:1.17
Rev: src/array.c:1.79
Rev: src/array.h:1.22
Rev: src/backend.c:1.53
Rev: src/backend.h:1.9
Rev: src/bignum.c:1.17
Rev: src/bignum.h:1.14
Rev: src/builtin_functions.c:1.293
Rev: src/builtin_functions.h:1.14
Rev: src/callback.c:1.20
Rev: src/configure.in:1.387
Rev: src/constants.c:1.22
Rev: src/dynamic_buffer.c:1.10
Rev: src/dynamic_load.c:1.41
Rev: src/error.c:1.56
Rev: src/error.h:1.46
Rev: src/fd_control.c:1.32
Rev: src/fdlib.c:1.37
Rev: src/fdlib.h:1.34
Rev: src/fsort.c:1.13
Rev: src/fsort_template.h:1.7
Rev: src/gc.c:1.110
Rev: src/gc.h:1.57
Rev: src/global.h:1.44
Rev: src/interpret.c:1.158
Rev: src/interpret.h:1.52
Rev: src/main.c:1.94
Rev: src/mapping.c:1.94
Rev: src/mapping.h:1.28
Rev: src/module_magic.h:1.1
Rev: src/module_support.c:1.34
Rev: src/module_support.h:1.7
Rev: src/multiset.c:1.26
Rev: src/object.c:1.137
Rev: src/object.h:1.50
Rev: src/opcodes.c:1.78
Rev: src/operators.c:1.93
Rev: src/operators.h:1.8
Rev: src/pike_macros.h:1.17
Rev: src/pike_memory.c:1.71
Rev: src/pike_memory.h:1.14
Rev: src/pike_types.c:1.132
Rev: src/port.c:1.28
Rev: src/precompile.sh.in:1.2
Rev: src/program.c:1.252
Rev: src/program.h:1.97
Rev: src/signal_handler.c:1.173
Rev: src/stralloc.c:1.85
Rev: src/stralloc.h:1.42
Rev: src/stuff.c:1.11
Rev: src/svalue.c:1.85
Rev: src/svalue.h:1.62
Rev: src/testsuite.in:1.316
Rev: src/threads.c:1.133
Rev: src/threads.h:1.99
5:
\*/
/**/
#include "global.h"
- RCSID("$Id: builtin_functions.c,v 1.292 2000/07/27 17:47:29 lange Exp $");
+ RCSID("$Id: builtin_functions.c,v 1.293 2000/07/28 17:16:54 hubbe Exp $");
#include "interpret.h"
#include "svalue.h"
#include "pike_macros.h"
58:
/* #define DIFF_DEBUG */
/* #define ENABLE_DYN_DIFF */
- void f_equal(INT32 args)
+ PMOD_EXPORT void f_equal(INT32 args)
{
int i;
if(args != 2)
69:
push_int(i);
}
- void debug_f_aggregate(INT32 args)
+ PMOD_EXPORT void debug_f_aggregate(INT32 args)
{
struct array *a;
#ifdef PIKE_DEBUG
125:
push_int(i);
}
- void f_copy_value(INT32 args)
+ PMOD_EXPORT void f_copy_value(INT32 args)
{
if(!args)
SIMPLE_TOO_FEW_ARGS_ERROR("copy_value",1);
270:
} \
} while(0)
- void f_lower_case(INT32 args)
+ PMOD_EXPORT void f_lower_case(INT32 args)
{
INT32 i;
struct pike_string *orig;
309:
push_string(end_shared_string(ret));
}
- void f_upper_case(INT32 args)
+ PMOD_EXPORT void f_upper_case(INT32 args)
{
INT32 i;
struct pike_string *orig;
369:
}
}
- void f_random(INT32 args)
+ PMOD_EXPORT void f_random(INT32 args)
{
INT_TYPE i;
394:
push_int(i);
}
- void f_random_string(INT32 args)
+ PMOD_EXPORT void f_random_string(INT32 args)
{
struct pike_string *ret;
INT32 e,len;
405:
push_string(end_shared_string(ret));
}
- void f_random_seed(INT32 args)
+ PMOD_EXPORT void f_random_seed(INT32 args)
{
INT_TYPE i;
#ifdef AUTO_BIGNUM
429:
push_int(Pike_fp ? Pike_fp->args : 0);
}
- void f_search(INT32 args)
+ PMOD_EXPORT void f_search(INT32 args)
{
INT32 start;
506:
}
/* int has_prefix(string a, string prefix) */
- void f_has_prefix(INT32 args)
+ PMOD_EXPORT void f_has_prefix(INT32 args)
{
struct pike_string *a, *b;
562:
#undef TWO_SHIFTS
}
- void f_has_index(INT32 args)
+ PMOD_EXPORT void f_has_index(INT32 args)
{
int t = 0;
625:
}
}
- void f_has_value(INT32 args)
+ PMOD_EXPORT void f_has_value(INT32 args)
{
if(args != 2)
PIKE_ERROR("has_value", "Bad number of arguments.\n", Pike_sp, args);
674:
/* Old backtrace */
- void f_backtrace(INT32 args)
+ PMOD_EXPORT void f_backtrace(INT32 args)
{
INT32 frames;
struct pike_frame *f,*of;
749:
a->type_field = BIT_ARRAY | BIT_INT;
}
- void f_add_constant(INT32 args)
+ PMOD_EXPORT void f_add_constant(INT32 args)
{
CHECK_SECURITY_OR_ERROR(SECURITY_BIT_SECURITY, ("add_constant: permission denied.\n"));
if(args<1)
931:
return ret;
}
- void f_combine_path(INT32 args)
+ PMOD_EXPORT void f_combine_path(INT32 args)
{
char *path=0;
int e,dofree=0;
966:
push_string(ret);
}
- void f_function_object(INT32 args)
+ PMOD_EXPORT void f_function_object(INT32 args)
{
if(args < 1)
SIMPLE_TOO_FEW_ARGS_ERROR("function_object",1);
983:
}
}
- void f_function_name(INT32 args)
+ PMOD_EXPORT void f_function_name(INT32 args)
{
struct pike_string *s;
if(args < 1)
1010:
}
}
- void f_zero_type(INT32 args)
+ PMOD_EXPORT void f_zero_type(INT32 args)
{
if(args < 1)
SIMPLE_TOO_FEW_ARGS_ERROR("zero_type",1);
1037:
* Some wide-strings related functions
*/
- void f_string_to_unicode(INT32 args)
+ PMOD_EXPORT void f_string_to_unicode(INT32 args)
{
struct pike_string *in;
struct pike_string *out = NULL;
1144:
push_string(out);
}
- void f_unicode_to_string(INT32 args)
+ PMOD_EXPORT void f_unicode_to_string(INT32 args)
{
struct pike_string *in;
struct pike_string *out = NULL;
1303:
push_string(out);
}
- void f_utf8_to_string(INT32 args)
+ PMOD_EXPORT void f_utf8_to_string(INT32 args)
{
struct pike_string *in;
struct pike_string *out;
1455:
push_string( res );
}
- void f_all_constants(INT32 args)
+ PMOD_EXPORT void f_all_constants(INT32 args)
{
pop_n_elems(args);
ref_push_mapping(get_builtin_constants());
}
- void f_allocate(INT32 args)
+ PMOD_EXPORT void f_allocate(INT32 args)
{
INT32 size;
struct array *a;
1534:
return NULL;
}
- void f_throw(INT32 args)
+ PMOD_EXPORT void f_throw(INT32 args)
{
if(args < 1)
SIMPLE_TOO_FEW_ARGS_ERROR("throw", 1);
1544:
pike_throw();
}
- void f_exit(INT32 args)
+ PMOD_EXPORT void f_exit(INT32 args)
{
static int in_exit=0;
CHECK_SECURITY_OR_ERROR(SECURITY_BIT_SECURITY, ("exit: permission denied.\n"));
1574:
exit(Pike_sp[-args].u.integer);
}
- void f_time(INT32 args)
+ PMOD_EXPORT void f_time(INT32 args)
{
if(!args)
{
1596:
push_int(current_time.tv_sec);
}
- void f_crypt(INT32 args)
+ PMOD_EXPORT void f_crypt(INT32 args)
{
char salt[2];
char *ret, *saltp;
1650:
}
}
- void f_destruct(INT32 args)
+ PMOD_EXPORT void f_destruct(INT32 args)
{
struct object *o;
if(args)
1675:
pop_n_elems(args);
}
- void f_indices(INT32 args)
+ PMOD_EXPORT void f_indices(INT32 args)
{
INT32 size;
struct array *a;
1941:
return NULL;
}
- void f_values(INT32 args)
+ PMOD_EXPORT void f_values(INT32 args)
{
INT32 size;
struct array *a;
2008:
push_array(a);
}
- void f_next_object(INT32 args)
+ PMOD_EXPORT void f_next_object(INT32 args)
{
struct object *o;
if(args < 1)
2029:
}
}
- void f_object_program(INT32 args)
+ PMOD_EXPORT void f_object_program(INT32 args)
{
if(args < 1)
SIMPLE_TOO_FEW_ARGS_ERROR("object_program", 1);
2088:
return NULL;
}
- void f_reverse(INT32 args)
+ PMOD_EXPORT void f_reverse(INT32 args)
{
if(args < 1)
SIMPLE_TOO_FEW_ARGS_ERROR("reverse", 1);
2329:
return finish_string_builder(&ret);
}
- void f_replace(INT32 args)
+ PMOD_EXPORT void f_replace(INT32 args)
{
if(args < 3)
SIMPLE_TOO_FEW_ARGS_ERROR("replace", 3);
2386:
}
}
- void f_compile(INT32 args)
+ PMOD_EXPORT void f_compile(INT32 args)
{
struct program *p;
2442:
- void f_objectp(INT32 args)
+ PMOD_EXPORT void f_objectp(INT32 args)
{
if(args<1)
SIMPLE_TOO_FEW_ARGS_ERROR("objectp", 1);
2460:
}
}
- void f_functionp(INT32 args)
+ PMOD_EXPORT void f_functionp(INT32 args)
{
if(args<1)
SIMPLE_TOO_FEW_ARGS_ERROR("functionp", 1);
2479:
#undef HAVE_POLL
#endif
- void f_sleep(INT32 args)
+ PMOD_EXPORT void f_sleep(INT32 args)
{
#define POLL_SLEEP_LIMIT 0.02
2592: Inside #if defined(AUTO_BIGNUM)
*/
#define TYPEP(ID,NAME,TYPE,TYPE_NAME) \
- void ID(INT32 args) \
+ PMOD_EXPORT void ID(INT32 args) \
{ \
int t; \
if(args<1) \
2625:
#endif /* AUTO_BIGNUM */
- void f_programp(INT32 args)
+ PMOD_EXPORT void f_programp(INT32 args)
{
if(args<1)
SIMPLE_TOO_FEW_ARGS_ERROR("programp", 1);
2666:
TYPEP(f_floatp, "floatp", T_FLOAT)
#endif /* AUTO_BIGNUM */
- void f_sort(INT32 args)
+ PMOD_EXPORT void f_sort(INT32 args)
{
INT32 e,*order;
2694:
}
}
- void f_rows(INT32 args)
+ PMOD_EXPORT void f_rows(INT32 args)
{
INT32 e;
struct array *a,*tmp;
2731:
#ifdef PIKE_DEBUG
- void f__verify_internals(INT32 args)
+ PMOD_EXPORT void f__verify_internals(INT32 args)
{
INT32 tmp=d_flag;
CHECK_SECURITY_OR_ERROR(SECURITY_BIT_SECURITY,
2743: Inside #if defined(PIKE_DEBUG)
pop_n_elems(args);
}
- void f__debug(INT32 args)
+ PMOD_EXPORT void f__debug(INT32 args)
{
INT_TYPE d;
2756: Inside #if defined(PIKE_DEBUG)
d_flag = d;
}
- void f__optimizer_debug(INT32 args)
+ PMOD_EXPORT void f__optimizer_debug(INT32 args)
{
INT_TYPE l;
2771: Inside #if defined(PIKE_DEBUG) and #if defined(YYDEBUG)
#ifdef YYDEBUG
- void f__compiler_trace(INT32 args)
+ PMOD_EXPORT void f__compiler_trace(INT32 args)
{
extern int yydebug;
INT_TYPE yyd;
2813:
#endif
#ifdef HAVE_GMTIME
- void f_gmtime(INT32 args)
+ PMOD_EXPORT void f_gmtime(INT32 args)
{
struct tm *tm;
INT_TYPE tt;
2833:
#endif
#ifdef HAVE_LOCALTIME
- void f_localtime(INT32 args)
+ PMOD_EXPORT void f_localtime(INT32 args)
{
struct tm *tm;
INT_TYPE tt;
2863:
#endif
#ifdef HAVE_MKTIME
- void f_mktime (INT32 args)
+ PMOD_EXPORT void f_mktime (INT32 args)
{
INT_TYPE sec, min, hour, mday, mon, year, isdst;
struct tm date;
3099:
return j==s->len;
}
- void f_glob(INT32 args)
+ PMOD_EXPORT void f_glob(INT32 args)
{
INT32 i,matches;
struct array *a;
4096:
return aggregate_array(2);
}
- void f_diff(INT32 args)
+ PMOD_EXPORT void f_diff(INT32 args)
{
struct array *seq;
struct array *cmptbl;
4205:
}
- void f__memory_usage(INT32 args)
+ PMOD_EXPORT void f__memory_usage(INT32 args)
{
INT32 num,size;
struct svalue *ss;
4271:
f_aggregate_mapping(Pike_sp-ss);
}
- void f__next(INT32 args)
+ PMOD_EXPORT void f__next(INT32 args)
{
struct svalue tmp;
4304:
}
}
- void f__prev(INT32 args)
+ PMOD_EXPORT void f__prev(INT32 args)
{
struct svalue tmp;
4335:
}
}
- void f__refs(INT32 args)
+ PMOD_EXPORT void f__refs(INT32 args)
{
INT32 i;
4356:
/* This function is for debugging *ONLY*
* do not document please. /Hubbe
*/
- void f__leak(INT32 args)
+ PMOD_EXPORT void f__leak(INT32 args)
{
INT32 i;
4374:
push_int(i);
}
- void f__typeof(INT32 args)
+ PMOD_EXPORT void f__typeof(INT32 args)
{
struct pike_string *s;
if(!args)
4387:
Pike_sp[-1].type = T_TYPE;
}
- void f_replace_master(INT32 args)
+ PMOD_EXPORT void f_replace_master(INT32 args)
{
CHECK_SECURITY_OR_ERROR(SECURITY_BIT_SECURITY,
("replace_master: permission denied.\n"));
4411:
pop_n_elems(args);
}
- void f_master(INT32 args)
+ PMOD_EXPORT void f_master(INT32 args)
{
pop_n_elems(args);
ref_push_object(master());
4420:
#ifdef HAVE_GETHRVTIME
#include <sys/time.h>
- void f_gethrvtime(INT32 args)
+ PMOD_EXPORT void f_gethrvtime(INT32 args)
{
pop_n_elems(args);
push_int64(gethrvtime()/1000);
}
- void f_gethrtime(INT32 args)
+ PMOD_EXPORT void f_gethrtime(INT32 args)
{
pop_n_elems(args);
if(args)
4435:
push_int64(gethrtime()/1000);
}
#else
- void f_gethrtime(INT32 args)
+ PMOD_EXPORT void f_gethrtime(INT32 args)
{
struct timeval tv;
pop_n_elems(args);
4496:
}
#endif /* PROFILING */
- void f_object_variablep(INT32 args)
+ PMOD_EXPORT void f_object_variablep(INT32 args)
{
struct object *o;
struct pike_string *s;
4520:
}
/* uniqify an array while at the same time keeping the order intact */
- void f_uniq_array(INT32 args)
+ PMOD_EXPORT void f_uniq_array(INT32 args)
{
struct array *a, *b;
struct mapping *m;
4548:
push_array(b);
}
- void f_splice(INT32 args)
+ PMOD_EXPORT void f_splice(INT32 args)
{
struct array *out;
INT32 size=0x7fffffff;
4626:
}
- void f_transpose(INT32 args)
+ PMOD_EXPORT void f_transpose(INT32 args)
{
struct array *out;
struct array *in;
4698:
}
#ifdef DEBUG_MALLOC
- void f__reset_dmalloc(INT32 args)
+ PMOD_EXPORT void f__reset_dmalloc(INT32 args)
{
CHECK_SECURITY_OR_ERROR(SECURITY_BIT_SECURITY,
("_reset_dmalloc: permission denied.\n"));
4706: Inside #if defined(DEBUG_MALLOC)
reset_debug_malloc();
}
- void f__dmalloc_set_name(INT32 args)
+ PMOD_EXPORT void f__dmalloc_set_name(INT32 args)
{
char *s;
INT_TYPE i;
4723: Inside #if defined(DEBUG_MALLOC)
pop_n_elems(args);
}
- void f__list_open_fds(INT32 args)
+ PMOD_EXPORT void f__list_open_fds(INT32 args)
{
extern void list_open_fds(void);
list_open_fds();
4731:
#endif
#ifdef PIKE_DEBUG
- void f__locate_references(INT32 args)
+ PMOD_EXPORT void f__locate_references(INT32 args)
{
CHECK_SECURITY_OR_ERROR(SECURITY_BIT_SECURITY,
("_locate_references: permission denied.\n"));
4740: Inside #if defined(PIKE_DEBUG)
pop_n_elems(args-1);
}
- void f__describe(INT32 args)
+ PMOD_EXPORT void f__describe(INT32 args)
{
struct svalue *s;
4753:
#endif
- void f_map_array(INT32 args)
+ PMOD_EXPORT void f_map_array(INT32 args)
{
ONERROR tmp;
INT32 e;
4785:
push_array(ret);
}
- void f_map(INT32 args)
+ PMOD_EXPORT void f_map(INT32 args)
{
/*
map(arr,fun,extra) => ret
5120:
}
}
- void f_filter(INT32 args)
+ PMOD_EXPORT void f_filter(INT32 args)
{
/* filter(mixed arr,mixed fun,mixed ... extra) ->
5460:
}
}
- void f_inherit_list(INT32 args)
+ PMOD_EXPORT void f_inherit_list(INT32 args)
{
struct program *p;
struct svalue *arg;
5548:
}
- void f_function_defined(INT32 args)
+ PMOD_EXPORT void f_function_defined(INT32 args)
{
check_all_args("Function.defined",args,BIT_FUNCTION, 0);