pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:349:    *! When read the fields are always normalized.    *!    *! Unlike the system struct tm the 'year' field is not year-1900,    *! instead it is the actual year.    */    PIKEFUN int(0..60) `sec() { FIX_THIS();RETURN THIS->t.tm_sec; }    PIKEFUN int(0..59) `min() { FIX_THIS();RETURN THIS->t.tm_min; }    PIKEFUN int(0..23) `hour() { FIX_THIS();RETURN THIS->t.tm_hour; }    PIKEFUN int(1..31) `mday() { FIX_THIS();RETURN THIS->t.tm_mday; }    PIKEFUN int(0..11) `mon() { FIX_THIS();RETURN THIS->t.tm_mon; } -  PIKEFUN int `year() { FIX_THIS();RETURN THIS->t.tm_year+1900; } +     -  +  PIKEFUN int `year() { FIX_THIS();RETURN THIS->t.tm_year+1900; }    PIKEFUN int `sec=(int a) { MODIFY(tm_sec=a); }    PIKEFUN int `min=(int a) { MODIFY(tm_min=a); }    PIKEFUN int `hour=(int a){ MODIFY(tm_hour=a); }    PIKEFUN int `mday=(int a){ MODIFY(tm_mday=a); }    PIKEFUN int `year=(int a){ MODIFY(tm_year=a-1900); }    PIKEFUN int `mon=(int a){ MODIFY(tm_mon=a); }       /*! @decl int isdst    *!    *! True if daylight savings are in effect. If this field is -1
pike.git/src/builtin.cmod:444:    Pike_error("Can not format as %c", flag );    }    if( post_sum )    {    push_text(")");    f_add(3);    }       }    -  PIKEFUN mixed cast( string to ) +  /*! @decl int|string cast(string to) +  *! +  *! Casted to an integer @[unix_time] will be returned. +  *! +  *! Casting to a string will call @[asctime]. +  */ +  PIKEFUN int|string cast( string to )    flags ID_PROTECTED;    {    if( to == literal_int_string )    {    f_TM_unix_time(0);    return;    }    if( to == literal_string_string )    {    f_TM_asctime(0);
pike.git/src/builtin.cmod:3037:    }    return;       case 't':    RETURN make_shared_binary_string("Buffer",6);    }    pop_n_elems( args );    push_undefined();    }    -  /*! @decl mixed cast( string type ) +  /*! @decl string|int cast( string type )    *! It is possible to cast a String.Buffer object to    *! a @expr{string@} and an @expr{int@}.    */ -  PIKEFUN mixed cast( string type ) +  PIKEFUN string|int cast( string type )    flags ID_PROTECTED;    {    if( type == literal_string_string )    {    pop_stack();    if( Pike_fp->current_object->refs != 1 )    f_Buffer_get_copy( 0 );    else    f_Buffer_get( 0 );    return;
pike.git/src/builtin.cmod:5503:    if (THIS->num_elems) {    struct pike_list_node *node = THIS->head;    int i;    for (i = 0; i < THIS->num_elems; i++) {    assign_svalue_no_free(ITEM(a) + i, &node->val);    node = node->next;    }    }    }    -  /*! @decl mixed cast(string type) +  /*! @decl array cast(string type)    *! -  *! Cast the lists. @expr{array@} and @expr{object@} are the only -  *! supported types. +  *! Cast the lists. @expr{array@} is the only +  *! supported type.    */ -  PIKEFUN mixed cast(string type) +  PIKEFUN array cast(string type)    flags ID_PROTECTED;    {    pop_stack(); /* type as at least one more reference. */    if (type == literal_array_string)    apply_current(f_List_cq__values_fun_num, 0); -  else if (type == literal_object_string) -  ref_push_object(Pike_fp->current_object); +     else    push_undefined();    }          /*! @decl mixed `[](mixed key) */    PIKEFUN mixed `[](mixed key)    flags ID_PROTECTED;    {    struct pike_list_node *node;