Branch: Tag:

2000-08-30

2000-08-30 21:58:17 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Begun support for having OPT_??? flags on non-efuns.

Rev: src/language.yacc:1.209
Rev: src/las.c:1.199
Rev: src/las.h:1.42
Rev: src/program.c:1.268
Rev: src/program.h:1.109

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.267 2000/08/28 19:35:04 hubbe Exp $"); + RCSID("$Id: program.c,v 1.268 2000/08/30 21:58:17 grubba Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
2553:    */   INT32 define_function(struct pike_string *name,    struct pike_string *type, -  INT16 flags, -  INT8 function_flags, -  union idptr *func) +  unsigned INT8 flags, +  unsigned INT8 function_flags, +  union idptr *func, +  unsigned INT16 opt_flags)   {    struct identifier *funp,fun;    struct reference ref;
2641:       funp->identifier_flags=function_flags;    +  funp->opt_flags = opt_flags; +     free_string(funp->type);    copy_shared_string(funp->type, type);    }else{
2675:    else    fun.func.offset = -1;    +  fun.opt_flags = opt_flags; +     ref.identifier_offset=Pike_compiler->new_program->num_identifiers;    add_to_identifiers(fun);    }
2740:    else    fun.func.offset = -1;    +  fun.opt_flags = opt_flags; +     i=Pike_compiler->new_program->num_identifiers;       add_to_identifiers(fun);
3429:    return p;   }    - PMOD_EXPORT int pike_add_function(char *name,void (*cfun)(INT32),char *type,INT16 flags) + PMOD_EXPORT int pike_add_function2(char *name, void (*cfun)(INT32), +  char *type, unsigned INT8 flags, +  unsigned INT16 opt_flags)   {    int ret;    struct pike_string *name_tmp,*type_tmp;
3445:    type_tmp,    flags,    IDENTIFIER_C_FUNCTION, -  &tmp); +  &tmp, +  opt_flags);    }else{    ret=define_function(name_tmp,    type_tmp,    flags,    IDENTIFIER_C_FUNCTION, -  0); +  0, +  opt_flags);    }    free_string(name_tmp);    free_string(type_tmp);
3463:    void (*cfun)(INT32),    char *type,    int type_length, -  INT16 flags, -  int opt_flags) +  unsigned INT8 flags, +  unsigned INT16 opt_flags)   {    int ret;    struct pike_string *name_tmp,*type_tmp;    union idptr tmp;   /* fprintf(stderr,"ADD_FUNC: %s\n",name); */ -  name_tmp=make_shared_binary_string(name,name_length); -  type_tmp=make_shared_binary_string(type,type_length); +  name_tmp = make_shared_binary_string(name,name_length); +  type_tmp = make_shared_binary_string(type,type_length);       if(cfun)    {
3480:    type_tmp,    flags,    IDENTIFIER_C_FUNCTION, -  &tmp); +  &tmp, +  opt_flags);    }else{    ret=define_function(name_tmp,    type_tmp,    flags,    IDENTIFIER_C_FUNCTION, -  0); +  0, +  opt_flags);    }    free_string(name_tmp);    free_string(type_tmp);
3921:    f->recur_label=-1;    f->is_inline=0;    f->num_args=-1; +  f->opt_flags = OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND; /* FIXME: Should be 0. */    Pike_compiler->compiler_frame=f;   }