Branch: Tag:

2002-04-24

2002-04-24 12:29:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added __builtin.set_close_on_exec().
Improved output from __builtin._describe_program().

Rev: src/builtin.cmod:1.84

1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.83 2002/04/08 01:17:05 mast Exp $ +  * $Id: builtin.cmod,v 1.84 2002/04/24 12:29:45 grubba Exp $    */      #include "global.h"
28:   #include "builtin_functions.h"   #include "fsort.h"   #include "port.h" + #include "fd_control.h"    -  + /*! @decl int(0..1) set_close_on_exec(int fd, int which) +  *! +  *! Raw set_close_on_exec(). +  *! +  *! @seealso +  *! @[Stdio.File()->set_close_on_exec() +  */ + PIKEFUN int set_close_on_exec(int fd, int which) + { +  int retval = set_close_on_exec(fd, which); +  RETURN retval; + }      /*! @decl array(array(int|string)) _describe_program(program p)    *!
48:    for (i=0; i < (int)p->num_identifier_references;i++) {    struct reference *ref = p->identifier_references + i;    struct identifier *id = ID_FROM_PTR(p, ref); +  struct inherit *inh = INHERIT_FROM_PTR(p, ref);    push_int(ref->id_flags);    ref_push_string(id->name); -  f_aggregate(2); +  push_int(id->identifier_flags); +  if (id->identifier_flags & IDENTIFIER_C_FUNCTION) { +  push_int(-2); +  } else { +  push_int(id->func.offset);    } -  +  push_int(ref->inherit_offset); +  push_int(inh->inherit_level); +  f_aggregate(6); +  }    f_aggregate(p->num_identifier_references);    res = sp[-1].u.array;    sp--;