Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/builtin.c

    rc5cb943d r051bc69a  
    4242#include "builtin/bi_boxed.h"
    4343#include "builtin/bi_error.h"
    44 #include "builtin/bi_char.h"
    4544#include "builtin/bi_fun.h"
    46 #include "builtin/bi_int.h"
    4745#include "builtin/bi_textfile.h"
    4846#include "builtin/bi_string.h"
     
    5452#include "os/os.h"
    5553#include "parse.h"
    56 #include "rdata.h"
    5754#include "run.h"
    5855#include "stree.h"
     
    9289
    9390        bi_error_declare(bi);
    94         bi_char_declare(bi);
    9591        bi_fun_declare(bi);
    96         bi_int_declare(bi);
    9792        bi_textfile_declare(bi);
    9893        bi_string_declare(bi);
     
    110105        bi_boxed_bind(bi);
    111106        bi_error_bind(bi);
    112         bi_char_bind(bi);
    113107        bi_fun_bind(bi);
    114         bi_int_bind(bi);
    115108        bi_textfile_bind(bi);
    116109        bi_string_bind(bi);
     
    257250{
    258251        stree_symbol_t *fun_sym;
     252        builtin_t *bi;
    259253        builtin_proc_t bproc;
    260254
     
    263257#endif
    264258        fun_sym = proc->outer_symbol;
     259        bi = run->program->builtin;
    265260
    266261        bproc = proc->bi_handler;
     
    303298}
    304299
    305 /** Return string value from builtin procedure.
    306  *
    307  * Makes it easy for a builtin procedure to return value of type @c string.
    308  *
    309  * @param run           Runner object
    310  * @param str           String value. Must be allocated from heap and its
    311  *                      ownership is hereby given up.
    312  */
    313 void builtin_return_string(run_t *run, const char *astr)
    314 {
    315         rdata_string_t *rstring;
    316         rdata_var_t *rvar;
    317         rdata_value_t *rval;
    318         rdata_item_t *ritem;
    319 
    320         run_proc_ar_t *proc_ar;
    321 
    322 #ifdef DEBUG_RUN_TRACE
    323         printf("Return string '%s' from builtin function.\n", astr);
    324 #endif
    325         rstring = rdata_string_new();
    326         rstring->value = astr;
    327 
    328         rvar = rdata_var_new(vc_string);
    329         rvar->u.string_v = rstring;
    330         rval = rdata_value_new();
    331         rval->var = rvar;
    332 
    333         ritem = rdata_item_new(ic_value);
    334         ritem->u.value = rval;
    335 
    336         proc_ar = run_get_current_proc_ar(run);
    337         proc_ar->retval = ritem;
    338 }
    339 
    340 /** Declare a static builtin function in @a csi.
     300/** Declare a builtin function in @a csi.
    341301 *
    342302 * Declare a builtin function member of CSI @a csi. Deprecated in favor
     
    354314        stree_csimbr_t *csimbr;
    355315        stree_symbol_t *fun_sym;
    356         stree_symbol_attr_t *sym_attr;
    357316
    358317        ident = stree_ident_new();
     
    374333        fun_sym->u.fun = fun;
    375334        fun_sym->outer_csi = csi;
    376 
    377         sym_attr = stree_symbol_attr_new(sac_static);
    378         list_append(&fun_sym->attr, sym_attr);
    379 
    380335        fun->symbol = fun_sym;
    381336        fun->proc->outer_symbol = fun_sym;
Note: See TracChangeset for help on using the changeset viewer.