pike.git/
src/
builtin.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2006-07-05
2006-07-05 19:21:29 by Martin Stjernholm <mast@lysator.liu.se>
28ab1df11c6207e335648919ecc44fc78c30709a (
35
lines) (+
34
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
Export most functions.
Rev: src/builtin.cmod:1.190
Rev: src/builtin_functions.h:1.34
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: builtin.cmod,v 1.
189
2006/
04
/
22
15
:
27
:
39
grubba
Exp $
+
|| $Id: builtin.cmod,v 1.
190
2006/
07
/
05
19
:
21
:
29
mast
Exp $
*/ #include "global.h"
68:
*! an array of objects instead, and more information about the *! symbols might be added. */
+
PMOD_EXPORT
PIKEFUN array(array(int|string)) _describe_program(mixed x) efun; {
110:
*! @seealso *! @[sprintf()] */
+
PMOD_EXPORT
PIKEFUN string basetype(mixed x) efun; optflags OPT_TRY_OPTIMIZE;
173:
*! @seealso *! @[sprintf()] */
+
PMOD_EXPORT
PIKEFUN string int2char(int|object x) efun; optflags OPT_TRY_OPTIMIZE;
225:
*! @seealso *! @[sprintf()] */
+
PMOD_EXPORT
PIKEFUN string int2hex(int|object x) efun; optflags OPT_TRY_OPTIMIZE;
303:
*! @seealso *! @[hex2string()] */
+
PMOD_EXPORT
PIKEFUN string string2hex(string s) errname String.string2hex; optflags OPT_TRY_OPTIMIZE;
332:
*! @seealso *! @[string2hex()] */
+
PMOD_EXPORT
PIKEFUN string hex2string(string hex) errname String.hex2string; optflags OPT_TRY_OPTIMIZE;
368:
*! @seealso *! @[rows()] */
+
PMOD_EXPORT
PIKEFUN array column(array data, mixed index) efun; optflags OPT_TRY_OPTIMIZE;
383:
*! @[aggregate_multiset()] *! */
+
PMOD_EXPORT
PIKEFUN multiset(1) mkmultiset(array(1=mixed) a) efun; optflags OPT_TRY_OPTIMIZE|OPT_EXTERNAL_DEPEND;
435:
*! @returns *! The old trace level in the current thread is returned. */
+
PMOD_EXPORT
PIKEFUN int trace(int level, void|string facility, void|int all_threads) efun; optflags OPT_SIDE_EFFECT;
509:
*! @seealso *! @[gc], @[Debug.gc_status] */
+
PMOD_EXPORT
PIKEFUN mapping(string:mixed) gc_parameters (void|mapping(string:mixed) params) errname Pike.gc_parameters; optflags OPT_SIDE_EFFECT;
586:
*! @seealso *! @[time()], @[localtime()], @[mktime()], @[gmtime()] */
+
PMOD_EXPORT
PIKEFUN string ctime(int timestamp) efun; optflags OPT_TRY_OPTIMIZE;
610:
*! @seealso *! @[indices()], @[values()] */
+
PMOD_EXPORT
PIKEFUN mapping(1:2) mkmapping(array(1=mixed) ind, array(2=mixed) val) efun; optflags OPT_TRY_OPTIMIZE|OPT_EXTERNAL_DEPEND;
634:
*! @seealso *! @[search()], @[`/()] */
+
PMOD_EXPORT
PIKEFUN int string_count(string haystack, string needle) errname String.count; optflags OPT_TRY_OPTIMIZE;
672:
*! *! Trim leading and trailing spaces and tabs from the string @[s]. */
+
PMOD_EXPORT
PIKEFUN string string_trim_whites (string s) errname String.trim_whites; optflags OPT_TRY_OPTIMIZE;
704:
*! Trim leading and trailing white spaces characters (space, tab, *! newline and carriage return) from the string @[s]. */
+
PMOD_EXPORT
PIKEFUN string string_trim_all_whites (string s) errname String.trim_all_whites; optflags OPT_TRY_OPTIMIZE;
737:
*! *! Returns 1 if @[prog] implements @[api]. */
+
PMOD_EXPORT
PIKEFUN int program_implements(program prog, program api) errname Program.implements; optflags OPT_TRY_OPTIMIZE;
749:
*! *! Returns 1 if @[child] has inherited @[parent]. */
+
PMOD_EXPORT
PIKEFUN int program_inherits(program parent, program child) errname Program.inherits; optflags OPT_TRY_OPTIMIZE;
767:
*! If it cannot be determined where the program was defined, @expr{0@} *! (zero) will be returned. */
+
PMOD_EXPORT
PIKEFUN string program_defined(program p) errname Program.defined; optflags OPT_TRY_OPTIMIZE;
804:
*! The string @[s] contains characters >= 65536. *! @endint */
+
PMOD_EXPORT
PIKEFUN int(8 .. 8)|int(16 .. 16)|int(32 .. 32) string_width(string s) errname String.width; optflags OPT_TRY_OPTIMIZE;
830:
*! @seealso *! @[mappingp()] */
+
PMOD_EXPORT
PIKEFUN mixed m_delete(object|mapping map, mixed index) efun; optflags OPT_SIDE_EFFECT;
866:
*! Returns the weak flag settings for @[m]. It's a combination of *! @[Pike.WEAK_INDICES] and @[Pike.WEAK_VALUES]. */
+
PMOD_EXPORT
PIKEFUN int get_weak_flag(array m) efun; optflags OPT_EXTERNAL_DEPEND;
873:
RETURN (m->flags & ARRAY_WEAK_FLAG) ? PIKE_WEAK_VALUES : 0; }
+
PMOD_EXPORT
PIKEFUN int get_weak_flag(mapping m) { RETURN mapping_get_flags(m) & MAPPING_WEAK; }
-
+
PMOD_EXPORT
PIKEFUN int get_weak_flag(multiset m) { RETURN multiset_get_flags(m) & MULTISET_WEAK;
908:
*! @seealso *! @[function_object()] */
+
PMOD_EXPORT
PIKEFUN string function_name(program|function func) efun; optflags OPT_TRY_OPTIMIZE;
991:
*! @seealso *! @[function_name()], @[function_program()] */
+
PMOD_EXPORT
PIKEFUN object function_object(function|program func) efun; optflags OPT_TRY_OPTIMIZE;
1034:
*! @seealso *! @[function_name()], @[function_object()] */
+
PMOD_EXPORT
PIKEFUN program function_program(program|function func) efun; optflags OPT_TRY_OPTIMIZE;
1093:
*! @[predef::random()] */
+
PMOD_EXPORT
PIKEFUN mixed random(object o) efun; optflags OPT_TRY_OPTIMIZE|OPT_EXTERNAL_DEPEND;
1111:
*! @[random_seed()] */
+
PMOD_EXPORT
PIKEFUN int random(int i) { if(i <= 0) RETURN 0; RETURN my_rand() % i; }
-
+
PMOD_EXPORT
PIKEFUN float random(float f) { if(f<=0.0) RETURN 0.0;
1130:
*! Returns a random element from @[x]. */
+
PMOD_EXPORT
PIKEFUN mixed random(array a) rawtype tFunc(tArr(tSetvar(0,tMix)),tVar(0)); {
1140:
pop_stack(); }
+
PMOD_EXPORT
PIKEFUN mixed random(multiset m) rawtype tFunc(tSet(tSetvar(1,tMix)),tVar(1)); {
1165:
*! Returns a random index-value pair from the mapping. */
+
PMOD_EXPORT
PIKEFUN array random(mapping m) { struct mapping_data *md=m->data;