pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.60 2001/07/25 23:42:58 nilsson Exp $ +  * $Id: builtin.cmod,v 1.61 2001/07/26 15:21:08 nilsson Exp $    */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "opcodes.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"
pike.git/src/builtin.cmod:259:    optflags OPT_TRY_OPTIMIZE|OPT_EXTERNAL_DEPEND;   {    if(ind->size != val->size)    bad_arg_error("mkmapping", sp-args, args, 2, "array", sp+1-args,    "mkmapping called on arrays of different sizes (%d != %d)\n",    ind->size, val->size);       RETURN mkmapping(ind, val);   }    - /*! @decl int String.count(string haystack, string needle) + /*! @decl int count(string haystack, string needle) +  *! @belongs String    *!    *! Count the number of non-overlapping times the string @[needle] occurrs    *! in the string @[haystack].    *!    *! @seealso    *! @[search()], @[`/()]    */   PIKEFUN int string_count(string haystack, string needle)    errname String.count;    optflags OPT_TRY_OPTIMIZE;
pike.git/src/builtin.cmod:299:    j=string_search(haystack,needle,i);    if (j==-1) break;    i=j+needle->len-1;    c++;    }    break;    }    RETURN DO_NOT_WARN((INT_TYPE)c);   }    - /*! @decl string String.trim_whites (string s) + /*! @decl string trim_whites (string s) +  *! @belongs String    *!    *! Trim leading and trailing spaces and tabs from the string @[s].    */   PIKEFUN string string_trim_whites (string s)    errname String.trim_whites;    optflags OPT_TRY_OPTIMIZE;   {    ptrdiff_t start = 0, end = s->len;    int chr;    switch (s->size_shift) {
pike.git/src/builtin.cmod:329:    } \    }    case 0: DO_IT (p_wchar0); break;    case 1: DO_IT (p_wchar1); break;    case 2: DO_IT (p_wchar2); break;   #undef DO_IT    }    RETURN string_slice (s, start, end + 1 - start);   }    - /*! @decl string String.trim_all_whites (string s) + /*! @decl string trim_all_whites (string s) +  *! @belongs String    *!    *! Trim leading and trailing white spaces characters (space, tab,    *! newline and carriage return) from the string @[s].    */   PIKEFUN string string_trim_all_whites (string s)    errname String.trim_all_whites;    optflags OPT_TRY_OPTIMIZE;   {    ptrdiff_t start = 0, end = s->len;    int chr;
pike.git/src/builtin.cmod:362:    } \    }    case 0: DO_IT (p_wchar0); break;    case 1: DO_IT (p_wchar1); break;    case 2: DO_IT (p_wchar2); break;   #undef DO_IT    }    RETURN string_slice (s, start, end + 1 - start);   }    - /*! @decl int Program.implements(program prog, program api) + /*! @decl int implements(program prog, program api) +  *! @belongs Program    *!    *! Returns 1 if @[prog] implements @[api].    */   PIKEFUN int program_implements(program prog, program api)    errname Program.implements;    optflags OPT_TRY_OPTIMIZE;   {    RETURN implements(prog, api);   }    - /*! @decl int Program.inherits(program child, program parent) + /*! @decl int inherits(program child, program parent) +  *! @belongs Program    *!    *! Returns 1 if @[child] has inherited @[parent].    */   PIKEFUN int program_inherits(program parent, program child)    errname Program.inherits;    optflags OPT_TRY_OPTIMIZE;   {    RETURN low_get_storage(parent, child) != -1;   }    - /*! @decl string Program.defined(program p) + /*! @decl string defined(program p) +  *! @belongs Program    *!    *! Returns a string with filename and linenumber describing where    *! the program @[p] was defined.    *!    *! The returned string is of the format @tt{"@i{filename@}:@i{linenumber@}"@}.    *!    *! If it cannot be determined where the program was defined, @tt{0@} (zero)    *! will be returned.    */   PIKEFUN string program_defined(program p)
pike.git/src/builtin.cmod:419:    push_int(line);    f_add(3);    }    return;    }       pop_n_elems(args);    push_int(0);   }    - /*! @decl int(8..8)|int(16..16)|int(32..32) String.width(string s) + /*! @decl int(8..8)|int(16..16)|int(32..32) width(string s) +  *! @belongs String    *!    *! Returns the width of a string.    *!    *! Three return values are possible:    *! @int    *! @value 8    *! The string @[s] only contains characters <= 255.    *! @value 16    *! The string @[s] only contains characters <= 65535.    *! @value 32