pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:420:
push_undefined(); } } PIKEFUN void _sprintf( int flag, mapping options ) { int post_sum = 1; switch( flag ) { case 'O':
-
push_text("System.TM(");
+
push_
static_
text("System.TM(");
post_sum = 1; /* fallthrough */ case 's': f_TM_asctime(0);
-
push_text("\n");
+
push_
static_
text("\n");
if( GET_ZONE(&(THIS->t)) ) {
-
push_text(" ");
+
push_
static_
text(" ");
push_text( GET_ZONE(&(THIS->t)) ); f_add( 2 ); } else
-
push_text("");
+
push_
static_
text("");
f_replace( 3 ); break; case 'd': f_TM_unix_time(0); break; default: Pike_error("Can not format as %c", flag ); } if( post_sum ) {
-
push_text(")");
+
push_
static_
text(")");
f_add(3); } } /*! @decl int|string cast(string to) *! *! Casted to an integer @[unix_time] will be returned. *! *! Casting to a string will call @[asctime].
pike.git/src/builtin.cmod:739:
case T_INT: ref_push_string(literal_int_string); break; case T_MAPPING: ref_push_string(literal_mapping_string); break; case T_MULTISET: ref_push_string(literal_multiset_string); break; case T_OBJECT: ref_push_string(literal_object_string); break; case T_PROGRAM: ref_push_string(literal_program_string); break; case T_STRING: ref_push_string(literal_string_string); break; case T_TYPE: ref_push_string(literal_type_string); break; case T_ZERO: push_constant_text("zero"); break; case T_VOID: push_constant_text("void"); break; /* The following are internal and shouldn't be applicable in normal use. */
-
case T_SVALUE_PTR: push_text("svalue_ptr"); break;
-
case T_OBJ_INDEX: push_text("obj_index"); break;
-
case T_MAPPING_DATA: push_text("mapping_data"); break;
-
case T_PIKE_FRAME: push_text("pike_frame"); break;
-
case T_MULTISET_DATA: push_text("multiset_data"); break;
-
default: push_text("unknown"); break;
+
case T_SVALUE_PTR: push_
static_
text("svalue_ptr"); break;
+
case T_OBJ_INDEX: push_
static_
text("obj_index"); break;
+
case T_MAPPING_DATA: push_
static_
text("mapping_data"); break;
+
case T_PIKE_FRAME: push_
static_
text("pike_frame"); break;
+
case T_MULTISET_DATA: push_
static_
text("multiset_data"); break;
+
default: push_
static_
text("unknown"); break;
} } /*! @decl string int2char(int x) *! @appears String.int2char *! *! Same as sprintf("%c",x); *! *! @seealso
pike.git/src/builtin.cmod:1718:
{ INT_TYPE line; struct pike_string *tmp = low_get_program_line(p, &line); pop_n_elems(args); if (tmp) { push_string(tmp); if(line >= 1) {
-
push_text(":");
+
push_
static_
text(":");
push_int(line); f_add(3); } } else push_int(0); } /*! @decl int(8..8)|int(16..16)|int(32..32) width(string s) *! @belongs String
pike.git/src/builtin.cmod:2482:
*/ PIKEFUN string _sprintf(int c, mapping|void opts) { pop_n_elems(args); if (c != 'O') { push_undefined (); return; }
-
push_text("backtrace_frame(");
+
push_
static_
text("backtrace_frame(");
if (THIS->lineno == -1) fill_in_file_and_line(); if (THIS->filename) { ref_push_string(THIS->filename);
-
push_text(":");
+
push_
static_
text(":");
push_int(THIS->lineno);
-
push_text(", ");
+
push_
static_
text(", ");
f_add(4); } else {
-
push_text("Unknown file, ");
+
push_
static_
text("Unknown file, ");
} if (TYPEOF(THIS->_fun) == PIKE_T_FUNCTION) { if (THIS->_fun.u.object->prog) { #ifdef PIKE_DEBUG if (THIS->_fun.u.object->prog != THIS->oprog) { struct identifier *id = ID_FROM_INT(THIS->oprog, SUBTYPEOF(THIS->_fun)); /* FIXME: Dump dmalloc info for the object? */ Pike_fatal("Lost track of function pointer! Function name was %s.\n", id->name?id->name->str:"<no name>"); } #endif push_svalue(&THIS->_fun); f_function_name(1);
-
push_text("(), ");
+
push_
static_
text("(), ");
f_add(2); } else { free_svalue(&THIS->_fun); SET_SVAL(THIS->_fun, PIKE_T_INT, NUMBER_DESTRUCTED, integer, 0);
-
push_text("destructed_function(), ");
+
push_
static_
text("destructed_function(), ");
} } else if (TYPEOF(THIS->_fun) == PIKE_T_PROGRAM) { /* FIXME: Use the master? */
-
push_text("program(), ");
+
push_
static_
text("program(), ");
} else if (TYPEOF(THIS->_fun) == PIKE_T_STRING) { push_svalue(&THIS->_fun);
-
push_text("(), ");
+
push_
static_
text("(), ");
f_add(2); } else {
-
push_text("destructed_function(), ");
+
push_
static_
text("destructed_function(), ");
} if (THIS->args) {
-
push_text("Args: ");
+
push_
static_
text("Args: ");
push_int(THIS->args->size); f_add(2); } else {
-
push_text("No args");
+
push_
static_
text("No args");
}
-
push_text(")");
+
push_
static_
text(")");
f_add(5); } /*! @decl int(3..) _sizeof() */ PIKEFUN int(3..) _sizeof() { if (THIS->args) { push_int(THIS->args->size + 3); } else {
pike.git/src/builtin.cmod:2715:
*! Usually @expr{32@} or @expr{64@}. *! @member int(0..1) "auto_bignum" *! Present if integers larger than the native size are automatically *! converted into bignums. *! @endmapping */ PIKEFUN mapping(string:int|string) get_runtime_info() optflags OPT_TRY_OPTIMIZE; { pop_n_elems(args);
-
push_text("bytecode_method");
+
push_
static_
text("bytecode_method");
push_text(PIKE_BYTECODE_METHOD_NAME);
-
push_text("abi");
+
push_
static_
text("abi");
push_int(sizeof(void *) * 8);
-
push_text("native_byteorder");
+
push_
static_
text("native_byteorder");
push_int(PIKE_BYTEORDER);
-
push_text("int_size");
+
push_
static_
text("int_size");
push_int(sizeof(INT_TYPE) * 8);
-
push_text("float_size");
+
push_
static_
text("float_size");
push_int(sizeof(FLOAT_TYPE) * 8);
-
push_text("auto_bignum");
+
push_
static_
text("auto_bignum");
push_int(1); f_aggregate_mapping(6*2); } /*! @endmodule */ void low_backtrace(struct Pike_interpreter_struct *i) { struct svalue *stack_top = i->stack_pointer;
pike.git/src/builtin.cmod:4088:
THIS->depth=d; } PIKEFUN string _sprintf(int mode, mapping flags) { pop_n_elems(args); if (mode != 'O') { push_undefined (); return; }
-
push_text("%O%*'[*]'n");
+
push_
static_
text("%O%*'[*]'n");
if(THIS->arg) ref_push_array(THIS->arg); else push_int(0); push_int(THIS->depth*3); f_sprintf(3); } } /*! @endclass
pike.git/src/builtin.cmod:4264:
} object_low_set_index(THIS->o, THIS->f, Pike_sp-1); pop_n_elems(args); push_int(0); } PIKEFUN string _sprintf(int c, mapping|void opts) flags ID_PROTECTED; { struct program *prog; if (!THIS->o) {
-
push_text("Setter()");
+
push_
static_
text("Setter()");
} else if ((prog = THIS->o->prog)) {
-
push_text("%O->`%s=");
+
push_
static_
text("%O->`%s=");
ref_push_object(THIS->o); ref_push_string(ID_FROM_INT(prog, THIS->f)->name); f_sprintf(3); } else {
-
push_text("Setter(destructed object)");
+
push_
static_
text("Setter(destructed object)");
} stack_pop_n_elems_keep_top(args); } } /*! @endclass */ PMOD_EXPORT struct object *get_setter(struct object *o, int f) {
pike.git/src/builtin.cmod:4367:
flags ID_PROTECTED; { RETURN 1; } PIKEFUN string _sprintf(int fmt, mixed ... extras) flags ID_PROTECTED; { pop_n_elems(args); if (fmt == 'O') {
-
push_text("Val.null");
+
push_
static_
text("Val.null");
} else { push_undefined(); } } PIKEFUN int __hash() flags ID_PROTECTED; { pop_n_elems(args); push_int(17);
pike.git/src/builtin.cmod:5137:
*! *! Describe the list. *! *! @seealso *! @[sprintf()], @[lfun::_sprintf()] */ PIKEFUN string _sprintf(int c, mapping(string:mixed)|void attr) flags ID_PROTECTED; { if (!THIS->num_elems) {
-
push_text("ADT.List(/* empty */)");
+
push_
static_
text("ADT.List(/* empty */)");
} else if (c == 'O') { struct pike_list_node *node = THIS->head; if (THIS->num_elems == 1) {
-
push_text("ADT.List(/* 1 element */\n");
+
push_
static_
text("ADT.List(/* 1 element */\n");
} else {
-
push_text("ADT.List(/* %d elements */\n");
+
push_
static_
text("ADT.List(/* %d elements */\n");
push_int(THIS->num_elems); f_sprintf(2); } while (node->next) { if (node->next->next) {
-
push_text(" %O,\n");
+
push_
static_
text(" %O,\n");
} else {
-
push_text(" %O\n");
+
push_
static_
text(" %O\n");
} push_svalue(&node->val); f_sprintf(2); node = node->next; }
-
push_text(")");
+
push_
static_
text(")");
f_add(THIS->num_elems + 2); } else { if (THIS->num_elems == 1) {
-
push_text("ADT.List(/* 1 element */)");
+
push_
static_
text("ADT.List(/* 1 element */)");
} else {
-
push_text("ADT.List(/* %d elements */)");
+
push_
static_
text("ADT.List(/* %d elements */)");
push_int(THIS->num_elems); f_sprintf(2); } } stack_pop_n_elems_keep_top(args); } /*! @decl mixed head() *! *! Get the element at the head of the list.