Subversion Repositories Kolibri OS

Rev

Rev 8535 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include "tinypy.h"
  2. #include "bitwise.c"
  3.  
  4. #define EXPORT(MOD_NAME, F_NAME, F_POINT) tp_set(tp, MOD_NAME , tp_string(F_NAME), tp_fnc(tp, F_POINT))
  5.  
  6. void bitwise_init(TP)
  7. {
  8.     tp_obj bit_mod = tp_dict(tp);
  9.  
  10.     EXPORT(bit_mod, "add" , _add);
  11.     EXPORT(bit_mod, "mul" , _mul);
  12.  
  13.     tp_set(tp, bit_mod, tp_string("__doc__"), tp_string("Bitwise operations for large numbers"));
  14.     tp_set(tp, bit_mod, tp_string("__name__"), tp_string("bitwise"));
  15.     tp_set(tp, bit_mod, tp_string("__file__"), tp_string(__FILE__));
  16.  
  17.     tp_set(tp, tp->modules, tp_string("bitwise"), bit_mod);
  18. }
  19.