Seed7 
 FAQ 
 Manual 
 Screenshots 
 Examples 
 Algorithms 
 Download 
 Links 

 Manual 
 Introduction 
 Tutorial 
 Declarations 
 Statements 
 Types 
 Parameters 
 Objects 
 File System 
 Syntax 
 Tokens 
 Expressions 
 OS access 
 Actions 
 Errors 

 Actions 
 ACTION 
 array 
 bigInteger 
 boolean 
 bstring 
 char 
 commands 
 declarations 
 graphic 
 enumeration 
 external_file 
 float 
 graphic keybd 
 hash 
 integer 
 interface 
 console keybd 
 list 
 statements 
 program 
 reference 
 ref_list 
 console output 
 struct 
 set 
 socket 
 string 
 time 
 type 
 utf8_file 
 Manual 
Actions
 previous   up   next 

13. PRIMITIVE ACTIONS

Not all functions can be described by calling other functions of the same language. For this reason and for performance reasons several functions are defined using a mechanism called action. For example: It is easy to define the 'while' statement by using recursion. But this would hurt performance and it would also use a huge amount of memory for the runtime stack. In practise an implementation of the 'while' statement can use a conditional jump instead of a subroutine call. Since Seed7 has no 'goto' statement, this is not an option. Instead the primitive action PRC_WHILE can be used. The 'while' statement is defined in the basic Seed7 library 'seed7_05.s7i' with:

    const proc: while (in func boolean param) do
        (in proc param) end while is action "PRC_WHILE";

This declaration shows the types and the position of the parameters of a 'while' statement. Such an action declaration contains enough information to use the defined construct. The semantic of all primitive actions is hard coded in the interpreter and in the compiler. The parameters of the hard coded actions and the corresponding definitions in Seed7 must match. If you are interested in the Seed7 definitions of primitive actions just look into the file 'seed7_05.s7i'.

Currently there are several hundred primitive actions predefined in the interpreter. They all have names in upper case characters which have the form:

    TYPE_ACTION

Which means that for example all 'integer' actions start with INT_ and all assignment actions end with _CPY . The following list shows actions which are used with more than one type:

    _ABS      Absolute value
    _ADD      Addition
    _CAT      Concatenation
    _CMP      Compare
    _CPY      Copy (Assignment)
    _CREATE   Initialize (Construct)
    _DESTR    Destroy (Destruct)
    _DECR     Decrement
    _DIV      Division
    _EQ       Equal
    _GE       Greater equal
    _GETC     Get one character from a file
    _GETS     Get string with maximum length from a file
    _GT       Greater than
    _HASHCODE Compute a hashCode
    _HEAD     Head of ref_list, array, string
    _ICONV    Conversion of integer to another type
    _IDX      Index (Element) of ref_list, array, string
    _INCR     Increment
    _LE       Less equal
    _LNG      Length
    _LOG2     Base 2 logarithm
    _LOWER    Convert to lower case
    _LSHIFT   Shift left
    _LT       Less than
    _MDIV     Modulo division (Integer division truncated towards negative infinity)
    _MINUS    Change sign
    _MOD      Modulo (Reminder of _MDIV integer division)
    _MULT     Multiply
    _NE       Not equal
    _ODD      Odd number
    _ORD      Ordinal number
    _PARSE    Conversion of string to another type
    _PLUS     Positive sign (noop)
    _POW      Power
    _PRED     Predecessor
    _RAND     Random value
    _RANGE    Range of ref_list, array, string
    _REM      Remainder (Reminder of _DIV integer division)
    _RSHIFT   Arithmetic shift right
    _SBTR     Subtract
    _SCAN     Convert from string to another type
    _SEEK     Set actual file position of a file
    _SQRT     Square root
    _STR      Convert to string
    _SUCC     Successor
    _TAIL     Tail of ref_list, array, string
    _TELL     Return the actual file position
    _UPPER    Convert to upper case
    _VALUE    Dereference a reference
    _WRITE    Write string to file

Primitive actions are defined for many types. The functions which implement the primitive actions are grouped together in *lib.c files. The following list contains the action prefix, the file containing the functions and a description:

    ACT_  actlib.c  ACTION operations
    ARR_  arrlib.c  array operations
    BIG_  biglib.c  bigInteger operations
    BLN_  blnlib.c  boolean operations
    BST_  bstlib.c  Operations for byte strings
    CHR_  chrlib.c  char operations
    CMD_  cmdlib.c  Various directory, file and other commands
    DCL_  dcllib.c  Declaration operations
    DRW_  drwlib.c  Drawing operations
    ENU_  enulib.c  Enumeration operations
    FIL_  fillib.c  PRIMITIVE_FILE operations
    FLT_  fltlib.c  float operations
    HSH_  hshlib.c  hash operations
    INT_  intlib.c  integer operations
    ITF_  itflib.c  Operations for interface types
    KBD_  kbdlib.c  Keyboard operations
    LST_  lstlib.c  List operations
    PRC_  prclib.c  proc operations and statements
    PRG_  prglib.c  Program operations
    REF_  reflib.c  reference operations
    RFL_  rfllib.c  ref_list operations
    SCR_  scrlib.c  Screen operations
    SCT_  sctlib.c  struct operations
    SET_  setlib.c  set operations
    SOC_  soclib.c  PRIMITIVE_SOCKET operations
    STR_  strlib.c  string operations
    TIM_  timlib.c  time and duration operations
    TYP_  typlib.c  type operations
    UT8_  ut8lib.c  utf8_file operations

The C functions which implement primitive actions have lowercase names. E.g.: The action 'PRC_WHILE' is implemented with the C function 'prc_while()' in the file 'prclib.c'. The parameter list for all C action functions is identical. Every *lib.c file has a corresponding *lib.h file which contains the prototypes for the action functions.

The primitive action which describes the addition of two integers is 'INT_ADD'. The Seed7 interface to the action 'INT_ADD' is defined in the file 'seed7_05.s7i' with:

    const func integer: (in integer param) + (in integer param) is action "INT_ADD";

To execute an action a corresponding C function must be present in the hi interpreter. The function for the action 'INT_ADD' is 'int_add()'. The function 'int_add()' is defined in the file 'intlib.c' with:

    #ifdef ANSI_C

    objecttype int_add (listtype arguments)
    #else

    objecttype int_add (arguments)
    listtype arguments;
    #endif

      { /* int_add */
        isit_int(arg_1(arguments));
        isit_int(arg_3(arguments));
        return(bld_int_temp(
            take_int(arg_1(arguments)) +
            take_int(arg_3(arguments))));
      } /* int_add */

The action functions use ANSI C prototypes and K&R function headers. The function 'int_add()' adds the first and the third argument (the second argument contains the + symbol. The file 'memory.h' contains several macros and functions which help to handle the arguments (parameter list) of a C primitive action function.

  • The macros 'arg_1', 'arg_2', 'arg_3', etc. can be used to get an individual argument (E.g.: 'arg_3(arguments)' ).
  • The macros 'isit_int', 'isit_stri', 'isit_file', etc. can be used to check for the correct category of an argument (E.g.: 'isit_int(arg_1(arguments))' ).
  • The macros 'take_char', 'take_float', 'take_bigint', etc. can be used to get the corresponding value of an argument (E.g.: 'take_int(arg_1(arguments))' ).
  • The functions 'bld_int_temp', 'bld_array_temp', 'bld_win_temp', etc. can be used to create the (objecttype) result of a primitive action (E.g.: 'return(bld_int_temp(0))' ).

The file 'intlib.h' contains the prototype for the 'int_add()' function:

    objecttype int_add (listtype);

and also a definition for the K&R C language:

    objecttype int_add ();

Additionally every primitive action is registered in the file 'primitive.c'. The line which incorporates 'INT_ADD' is:

    { "INT_ADD",             int_add,             },

The entries of the primitive action in the file 'primitive.c' are sorted alphabetically. With this definitions the hi interpreter understands a primitive action.

To allow a primitive function in a compiled Seed7 program the Seed7 compiler (comp.sd7) needs to know the action also. The compiler function which creates code for the 'INT_ADD' action is:

    const proc: process_int_add (in ref_list: params, inout expr_type: c_expr) is func

      begin
        c_expr.expr &:= "(";
        process_expr(params[1], c_expr);
        c_expr.expr &:= ") + (";
        process_expr(params[3], c_expr);
        c_expr.expr &:= ")";
      end func;

This function is called from the function 'process_action' with the line:

    elsif action_name = "INT_ADD" then
      process_int_add(params, c_expr);

Some primitive actions are more complicated and inline code would not be the best solution for it. In this case an additional helper function is used. The action 'INT_STR' is such an action. The definition of the function 'int_str()' in the file 'intlib.c' is:

    #ifdef ANSI_C

    objecttype int_str (listtype arguments)
    #else

    objecttype int_str (arguments)
    listtype arguments;
    #endif

      { /* int_str */
        isit_int(arg_1(arguments));
        return(bld_stri_temp(intStr(
            take_int(arg_1(arguments)))));
      } /* int_str */

The main work for the primitive action 'INT_STR' is done in the helper function 'intStr()'. The helper function 'intStr()' can be found in the file 'int_rtl.c':

    #ifdef ANSI_C

    stritype intStr (inttype number)
    #else

    stritype intStr (number)
    inttype number;
    #endif

      {
        uinttype unsigned_number;
        booltype sign;
        strelemtype buffer_1[50];
        strelemtype *buffer;
        memsizetype len;
        stritype result;

      /* intStr */
        if ((sign = (number < 0))) {
          unsigned_number = -number;
        } else {
          unsigned_number = number;
        } /* if */
        buffer = &buffer_1[50];
        do {
          *(--buffer) = (strelemtype) (unsigned_number % 10 + '0');
        } while ((unsigned_number /= 10) != 0);
        if (sign) {
          *(--buffer) = (strelemtype) '-';
        } /* if */
        len = &buffer_1[50] - buffer;
        if (!ALLOC_STRI(result, len)) {
          raise_error(MEMORY_ERROR);
          return(NULL);
        } else {
          result->size = len;
          memcpy(result->mem, buffer, (SIZE_TYPE) (len * sizeof(strelemtype)));
          return(result);
        } /* if */
      } /* intStr */

The file 'int_rtl.h' contains a prototype definition for the 'intStr()' helper function:

    stritype intStr (inttype number);

and also a definition for the K&R C language:

    stritype intStr ();

The helper functions are also used in the code generated by the Seed7 compiler:

    const proc: process_int_str (in ref_list: params, inout expr_type: c_expr) is func

      begin
        prepare_stri_result(c_expr);
        c_expr.result_expr &:= "intStr(";
        getStdParamToResultExpr(params[1], c_expr);
        c_expr.result_expr &:= ")";
      end func;

All the *lib.c files containing primitive actions and various other files with their functions are grouped together in the 's7_comp.a' library (Licensed under GPL). Furthermore the C primitive action functions (E.g.: int_parse) of the *lib.c files may use corresponding functions (E.g.: intParse) which can be found in *_rtl.c files (E.g.: 'int_rtl.c'). The *_rtl.c files are grouped together in the 'seed7_05.a' library (Licensed under LGPL). When a Seed7 program is compiled with the Seed7 compiler (comp.sd7) inline code is generated for many primitive actions. To implement the remaining primitive actions the functions of the 'seed7_05.a' library are used.

13.1 Actions for the type ACTION

Action name actlib.c function act_comp.c function
ACT_ILLEGAL act_illegal
ACT_CPY act_cpy =
ACT_CREATE act_create
ACT_GEN act_gen
ACT_STR act_str actStr
ACT_VALUE act_value actValue

13.2 Actions for array types

Action name arrlib.c function arr_rtl.c function
ARR_APPEND arr_append arrAppend
ARR_ARRLIT arr_arrlit arrArrlit
ARR_ARRLIT2 arr_arrlit2 arrArrlit2
ARR_BASELIT arr_baselit arrBaselit
ARR_BASELIT2 arr_baselit2 arrBaselit2
ARR_CAT arr_cat arrCat
ARR_CONV arr_conv (noop)
ARR_CPY arr_cpy cpy_ ...
ARR_CREATE arr_create create_ ...
ARR_DESTR arr_destr destr_ ...
ARR_EMPTY arr_empty
ARR_EXTEND arr_extend arrExtend
ARR_GEN arr_gen arrGen
ARR_HEAD arr_head arrHead
ARR_IDX arr_idx a->arr[b-a->min_position]
ARR_LNG arr_lng a->max_position-a->min_position + 1
ARR_MAXIDX arr_maxidx a->max_position
ARR_MINIDX arr_minidx a->min_position
ARR_RANGE arr_range arrRange
ARR_REMOVE arr_remove arrRemove
ARR_SORT arr_sort arrSort
ARR_TAIL arr_tail arrTail
ARR_TIMES arr_times times_ ...

13.3 Actions for the type bigInteger

Action name biglib.c function big_rtl.c function
BIG_ABS big_abs bigAbs
BIG_ADD big_add bigAdd, bigAddTemp
BIG_BIT_LENGTH big_bit_length bigBitLength
BIG_CLIT big_clit bigCLit
BIG_CMP big_cmp bigCmp
BIG_CPY big_cpy bigCpy
BIG_CREATE big_create bigCreate
BIG_DECR big_decr bigDecr
BIG_DESTR big_destr bigDestr
BIG_DIV big_div bigDiv
BIG_EQ big_eq bigEq
BIG_GCD big_gcd bigGcd
BIG_GE big_ge bigCmp >= 0
BIG_GROW big_grow bigGrow
BIG_GT big_gt bigCmp > 0
BIG_HASHCODE big_hashcode bigHashCode
BIG_ICONV big_iconv bigIConv
BIG_INCR big_incr bigIncr
BIG_IPOW big_ipow bigIPow
BIG_LE big_le bigCmp <= 0
BIG_LOG2 big_log2 bigLog2
BIG_LOWEST_SET_BIT big_lowest_set_bit bigLowestSetBit
BIG_LSHIFT big_lshift bigLShift
BIG_LSHIFT_ASSIGN big_lshift_assign bigLShiftAssign
BIG_LT big_lt bigCmp < 0
BIG_MDIV big_mdiv bigMDiv
BIG_MINUS big_minus bigMinus
BIG_MOD big_mod bigMod
BIG_MULT big_mult bigMult
BIG_MULT_ASSIGN big_mult_assign bigMultAssign
BIG_NE big_ne bigNe
BIG_ODD big_odd bigOdd
BIG_ORD big_ord bigOrd
BIG_PARSE big_parse bigParse
BIG_PLUS big_plus (noop)
BIG_PRED big_pred bigPred
BIG_RAND big_rand bigRand
BIG_REM big_rem bigRem
BIG_RSHIFT big_rshift bigRShift
BIG_RSHIFT_ASSIGN big_rshift_assign bigRShiftAssign
BIG_SBTR big_sbtr bigSbtr, bigSbtrTemp
BIG_SHRINK big_shrink bigShrink
BIG_STR big_str bigStr
BIG_SUCC big_succ bigSucc
BIG_VALUE big_value bigValue

13.4 Actions for the type boolean

Action name blnlib.c function bln_rtl.c function
BLN_AND bln_and &&
BLN_CPY bln_cpy blnCpy
BLN_CREATE bln_create blnCreate
BLN_GE bln_ge >=
BLN_GT bln_gt >
BLN_ICONV bln_iconv & 1
BLN_LE bln_le <=
BLN_LT bln_lt <
BLN_NOT bln_not !
BLN_OR bln_or ||
BLN_ORD bln_ord (inttype)

13.5 Actions for byte strings

Action name bstlib.c function bst_rtl.c function
BST_APPEND bst_append bstAppend
BST_CAT bst_cat bstCat
BST_CPY bst_cpy bstCpy
BST_CREATE bst_create bstCreate
BST_DESTR bst_destr bstDestr
BST_EMPTY bst_empty

13.6 Actions for the type char

Action name chrlib.c function chr_rtl.c function
CHR_CHR chr_chr (chartype)
CHR_CMP chr_cmp chrCmp
CHR_CONV chr_conv (noop)
CHR_CPY chr_cpy chrCpy
CHR_CREATE chr_create chrCreate
CHR_DECR chr_decr --
CHR_EQ chr_eq ==
CHR_GE chr_ge >=
CHR_GT chr_gt >
CHR_HASHCODE chr_hashcode (inttype)
CHR_ICONV chr_iconv (chartype)
CHR_INCR chr_incr ++
CHR_LE chr_le <=
CHR_LOW chr_low chrLow
CHR_LT chr_lt <
CHR_NE chr_ne !=
CHR_ORD chr_ord (inttype)
CHR_PRED chr_pred -1
CHR_STR chr_str chrStr
CHR_SUCC chr_succ +1
CHR_UP chr_up chrUp
CHR_VALUE chr_value chrValue

13.7 Actions for various directory, file and other commands

Action name cmdlib.c function cmd_rtl.c function
CMD_BIG_FILESIZE cmd_big_filesize cmdBigFileSize
CMD_CHDIR cmd_chdir cmdChdir
CMD_CLONE_FILE cmd_clone_file cmdCloneFile
CMD_CONFIG_VALUE cmd_config_value cmdConfigValue
CMD_COPY_FILE cmd_copy_file cmdCopyFile
CMD_FILEMODE cmd_filemode cmdFileMode
CMD_FILESIZE cmd_filesize cmdFileSize
CMD_FILETYPE cmd_filetype cmdFileType
CMD_FILETYPE_SL cmd_filetype_sl cmdFileTypeSL
CMD_GETCWD cmd_getcwd cmdGetcwd
CMD_GET_ATIME cmd_get_atime cmdGetATime
CMD_GET_CTIME cmd_get_ctime cmdGetCTime
CMD_GET_MTIME cmd_get_mtime cmdGetMTime
CMD_LS cmd_ls cmdLs
CMD_MKDIR cmd_mkdir cmdMkdir
CMD_MOVE cmd_move cmdMove
CMD_READLINK cmd_readlink cmdReadlink
CMD_REMOVE cmd_remove cmdRemove
CMD_REMOVE_ANY_FILE cmd_remove_any_file cmdRemoveAnyFile
CMD_SET_ATIME cmd_set_atime cmdSetATime
CMD_SET_FILEMODE cmd_set_filemode cmdSetFileMode
CMD_SET_MTIME cmd_set_mtime cmdSetMTime
CMD_SHELL cmd_shell cmdShell
CMD_SYMLINK cmd_symlink cmdSymlink

13.8 Actions for declarations

Action name dcllib.c function
DCL_ATTR dcl_attr
DCL_CONST dcl_const
DCL_ELEMENTS dcl_elements
DCL_FWD dcl_fwd
DCL_GETFUNC dcl_getfunc
DCL_GETOBJ dcl_getobj
DCL_GLOBAL dcl_global
DCL_IN1VAR dcl_in1var
DCL_IN2VAR dcl_in2var
DCL_INOUT1 dcl_inout1
DCL_INOUT2 dcl_inout2
DCL_REF1 dcl_ref1
DCL_REF2 dcl_ref2
DCL_SYMB dcl_symb
DCL_VAL1 dcl_val1
DCL_VAL2 dcl_val2
DCL_VAR dcl_var

13.9 Actions to do graphic output

Action name drwlib.c function drw_rtl.c/drw_x11.c/drw_win.c function
DRW_ARC drw_arc drwArc
DRW_ARC2 drw_arc2 drwArc2
DRW_BACKGROUND drw_background drwBackground
DRW_CIRCLE drw_circle drwCircle
DRW_CLEAR drw_clear drwClear
DRW_COLOR drw_color drwColor
DRW_COPYAREA drw_copyarea drwCopyArea
DRW_CPY drw_cpy drwCpy
DRW_CREATE drw_create drwCreate
DRW_DESTR drw_destr drwDestr
DRW_EMPTY drw_empty
DRW_EQ drw_eq ==
DRW_FARCCHORD drw_farcchord drwFArcChord
DRW_FARCPIESLICE drw_farcpieslice drwFArcPieSlice
DRW_FCIRCLE drw_fcircle drwFCircle
DRW_FELLIPSE drw_fellipse drwFEllipse
DRW_FLUSH drw_flush drwFlush
DRW_FPOLYLINE drw_fpolyLine drwFPolyLine
DRW_GENPOINTLIST drw_genPointList drwGenPointList
DRW_GET drw_get drwGet
DRW_HEIGHT drw_height drwHeight
DRW_IMAGE drw_image drwImage
DRW_LINE drw_line drwLine
DRW_NE drw_ne !=
DRW_NEW_PIXMAP drw_new_pixmap drwNewPixmap
DRW_OPEN drw_open drwOpen
DRW_OPEN_SUB_WINDOW drw_open_sub_window drwOpenSubWindow
DRW_PARC drw_parc drwPArc
DRW_PCIRCLE drw_pcircle drwPCircle
DRW_PFARCCHORD drw_pfarcchord drwPFArcChord
DRW_PFARCPIESLICE drw_pfarcpieslice drwFArcPieSlice
DRW_PFCIRCLE drw_pfcircle drwPFCircle
DRW_PFELLIPSE drw_pfellipse drwPFEllipse
DRW_PLINE drw_pline drwPLine
DRW_POINT drw_point drwPoint
DRW_POINTER_XPOS drw_pointer_xpos drwPointerXpos
DRW_POINTER_YPOS drw_pointer_ypos drwPointerYpos
DRW_POLYLINE drw_polyLine drwPolyLine
DRW_PPOINT drw_ppoint drwPPoint
DRW_PRECT drw_prect drwPRect
DRW_PUT drw_put drwPut
DRW_RECT drw_rect drwRect
DRW_RGBCOL drw_rgbcol drwRgbColor
DRW_SETPOS drw_setPos drwSetPos
DRW_SETTRANSPARENTCOLOR drw_setTransparentColor drwSetTransparentColor
DRW_TEXT drw_text drwText
DRW_WIDTH drw_width drwWidth
DRW_XPOS drw_xpos drwXPos
DRW_YPOS drw_ypos drwYPos

13.10 Actions for enumeration types

Action name enulib.c function
ENU_CONV enu_conv (noop)
ENU_CPY enu_cpy =
ENU_CREATE enu_create
ENU_EQ enu_eq ==
ENU_GENLIT enu_genlit
ENU_ICONV2 enu_iconv2 (noop)
ENU_NE enu_ne !=
ENU_ORD2 enu_ord2 (noop)
ENU_SIZE enu_size
ENU_VALUE enu_value enuValue

13.11 Actions for the type PRIMITIVE_FILE

Action name fillib.c function fil_rtl.c function
FIL_BIG_LNG fil_big_lng filBigLng
FIL_BIG_SEEK fil_big_seek filBigSeek
FIL_BIG_TELL fil_big_tell filBigTell
FIL_CLOSE fil_close fclose
FIL_CPY fil_cpy fltCpy
FIL_CREATE fil_create fltCreate
FIL_EMPTY fil_empty
FIL_EOF fil_eof feof
FIL_EQ fil_eq ==
FIL_ERR fil_err stderr
FIL_FLUSH fil_flush fflush
FIL_GETC fil_getc fgetc
FIL_GETS fil_gets filGets
FIL_HAS_NEXT fil_has_next filHasNext
FIL_IN fil_in stdin
FIL_LINE_READ fil_line_read filLineRead
FIL_LIT fil_lit filLit
FIL_LNG fil_lng filLng
FIL_NE fil_ne !=
FIL_OPEN fil_open filOpen
FIL_OUT fil_out stdout
FIL_POPEN fil_popen filPopen
FIL_PRINT fil_print filPrint
FIL_SEEK fil_seek filSeek
FIL_TELL fil_tell filTell
FIL_VALUE fil_value filValue
FIL_WORD_READ fil_word_read filWordRead
FIL_WRITE fil_write filWrite

13.12 Actions for the type float

Action name fltlib.c function flt_rtl.c function
FLT_A2TAN flt_a2tan atan2
FLT_ABS flt_abs fabs
FLT_ACOS flt_acos acos
FLT_ADD flt_add +
FLT_ASIN flt_asin asin
FLT_ATAN flt_atan atan
FLT_CAST flt_cast (x.floatvalue=a, x.intvalue)
FLT_CEIL flt_ceil ceil
FLT_CMP flt_cmp fltCmp
FLT_COS flt_cos cos
FLT_COSH flt_cosh cosh
FLT_CPY flt_cpy fltCpy
FLT_CREATE flt_create fltCreate
FLT_DGTS flt_dgts fltDgts
FLT_DIV flt_div /
FLT_DIV_ASSIGN flt_div_assign /=
FLT_EQ flt_eq ==
FLT_EXP flt_exp exp
FLT_FLOOR flt_floor floor
FLT_GE flt_ge >=
FLT_GROW flt_grow +=
FLT_GT flt_gt >
FLT_HASHCODE flt_hashcode (x.floatvalue=a, x.intvalue)
FLT_ICAST flt_icast (x.intvalue=a, x.floatvalue)
FLT_ICONV flt_iconv (float)
FLT_IFLT flt_iflt (float)
FLT_IPOW flt_ipow fltIPow
FLT_ISNAN flt_isnan isnan
FLT_LE flt_le <=
FLT_LOG flt_log log
FLT_LOG10 flt_log10 log10
FLT_LT flt_lt <
FLT_MINUS flt_minus -
FLT_MULT flt_mult *
FLT_MULT_ASSIGN flt_mult_assign *=
FLT_NE flt_ne !=
FLT_PARSE flt_parse fltParse
FLT_PLUS flt_plus (noop)
FLT_POW flt_pow pow
FLT_RAND flt_rand fltRand
FLT_ROUND flt_round a<0.0?-((inttype)(0.5-a)):(inttype)(0.5+a)
FLT_SBTR flt_sbtr -
FLT_SHRINK flt_shrink -=
FLT_SIN flt_sin sin
FLT_SINH flt_sinh sinh
FLT_SQRT flt_sqrt sqrt
FLT_STR flt_str fltStr
FLT_TAN flt_tan tan
FLT_TANH flt_tanh tanh
FLT_TRUNC flt_trunc (inttype)
FLT_VALUE flt_value fltValue

13.13 Actions to support the graphic keyboard

Action name drwlib.c function kbd_rtl.c/drw_x11.c/drw_win.c function
GKB_BUSY_GETC gkb_busy_getc gkbKeyPressed() ? gkbGetc() : 512
GKB_GETC gkb_getc gkbGetc
GKB_GETS gkb_gets gkbGets
GKB_KEYPRESSED gkb_keypressed gkbKeyPressed
GKB_LINE_READ gkb_line_read gkbLineRead
GKB_RAW_GETC gkb_raw_getc gkbRawGetc
GKB_WINDOW gkb_window gkbWindow
GKB_WORD_READ gkb_word_read gkbWordRead
GKB_XPOS gkb_xpos gkbXpos
GKB_YPOS gkb_ypos gkbYpos

13.14 Actions for hash types

Action name hshlib.c function hsh_rtl.c function
HSH_CONTAINS hsh_contains hshContains
HSH_CPY hsh_cpy hshCpy
HSH_CREATE hsh_create hshCreate
HSH_DESTR hsh_destr hshDestr
HSH_EMPTY hsh_empty hshEmpty
HSH_EXCL hsh_excl hshExcl
HSH_FOR hsh_for for
HSH_FOR_DATA_KEY hsh_for_data_key for
HSH_FOR_KEY hsh_for_key for
HSH_IDX hsh_idx hshIdx, hshIdxAddr
HSH_IDX2 hsh_idx2
HSH_INCL hsh_incl hshIncl
HSH_KEYS hsh_keys hshKeys
HSH_LNG hsh_lng a->size
HSH_REFIDX hsh_refidx
HSH_VALUES hsh_values hshValues

13.15 Actions for the type integer

Action name intlib.c function int_rtl.c function
INT_ABS int_abs labs
INT_ADD int_add +
INT_BINOM int_binom intBinom
INT_BIT_LENGTH int_bit_length intBitLength
INT_CMP int_cmp intCmp
INT_CONV int_conv (noop)
INT_CPY int_cpy intCpy
INT_CREATE int_create intCreate
INT_DECR int_decr --
INT_DIV int_div /
INT_EQ int_eq ==
INT_FACT int_fact fact[a]
INT_GE int_ge >=
INT_GROW int_grow +=
INT_GT int_gt >
INT_HASHCODE int_hashcode (noop)
INT_INCR int_incr ++
INT_LE int_le <=
INT_LOG2 int_log2 intLog2
INT_LOWEST_SET_BIT int_lowest_set_bit intLowestSetBit
INT_LPAD0 int_lpad0 intLpad0
INT_LSHIFT int_lshift <<
INT_LSHIFT_ASSIGN int_lshift_assign <<=
INT_LT int_lt <
INT_MDIV int_mdiv a>0&&b<0?(a-1)/b-1:a<0&&b>0?(a+1)/b-1:a/b
INT_MINUS int_minus -
INT_MOD int_mod c=a%b,((a>0&&b<0)||(a<0&&b>0))&&c!=0?c+b:c
INT_MULT int_mult *
INT_MULT_ASSIGN int_mult_assign *=
INT_NE int_ne !=
INT_ODD int_odd &1
INT_ORD int_ord (noop)
INT_PARSE int_parse intParse
INT_PLUS int_plus (noop)
INT_POW int_pow intPow
INT_PRED int_pred --
INT_RAND int_rand intRand
INT_REM int_rem %
INT_RSHIFT int_rshift a>>b
a<0?~(~a>>b):a>>b
INT_RSHIFT_ASSIGN int_rshift_assign a>>=b
if (a<0) a= ~(~a>>b); else a>>=b;
INT_SBTR int_sbtr -
INT_SHRINK int_shrink -=
INT_SQRT int_sqrt intSqrt
INT_STR int_str intStr
INT_STR_BASED int_str_based intStrBased
INT_SUCC int_succ +1
INT_VALUE int_value intValue

13.16 Actions for interface types

Action name itflib.c function
ITF_CONV2 itf_conv2 (noop)
ITF_CPY itf_cpy =
ITF_CPY2 itf_cpy2 =
ITF_CREATE itf_create
ITF_CREATE2 itf_create2
ITF_EQ itf_eq ==
ITF_NE itf_ne !=
ITF_SELECT itf_select

13.17 Actions to support the text (console) screen keyboard

Action name kbdlib.c function kbd_rtl.c/kbd_inf.c function
KBD_BUSY_GETC kbd_busy_getc kbdKeyPressed() ? kbdGetc() : 512
KBD_GETC kbd_getc kbdGetc
KBD_GETS kbd_gets kbdGets
KBD_KEYPRESSED kbd_keypressed kbdKeyPressed
KBD_LINE_READ kbd_line_read kbdLineRead
KBD_RAW_GETC kbd_raw_getc kbdRawGetc
KBD_WORD_READ kbd_word_read kbdWordRead

13.18 Actions for the list type

Action name lstlib.c function
LST_CAT lst_cat
LST_CPY lst_cpy
LST_CREATE lst_create
LST_DESTR lst_destr
LST_ELEM lst_elem
LST_EMPTY lst_empty
LST_EXCL lst_excl
LST_HEAD lst_head
LST_IDX lst_idx
LST_INCL lst_incl
LST_LNG lst_lng
LST_RANGE lst_range
LST_TAIL lst_tail

13.19 Actions for proc operations and statements

Action name prclib.c function
PRC_ARGS prc_args
PRC_BEGIN prc_begin
PRC_BLOCK prc_block
PRC_BLOCK_DEF prc_block_def
PRC_CASE prc_case switch
PRC_CASE_DEF prc_case_def switch
PRC_CPY prc_cpy
PRC_CREATE prc_create
PRC_DECLS prc_decls
PRC_DYNAMIC prc_dynamic
PRC_EXIT prc_exit exit
PRC_FOR_DOWNTO prc_for_downto for
PRC_FOR_TO prc_for_to for
PRC_HEAPSTAT prc_heapstat
PRC_HSIZE prc_hsize heapsize
PRC_IF prc_if if
PRC_IF_ELSIF prc_if_elsif if
PRC_INCLUDE prc_include
PRC_LOCAL prc_local
PRC_NOOP prc_noop prcNoop
PRC_RAISE prc_raise raise_error
PRC_REPEAT prc_repeat do
PRC_RES_BEGIN prc_res_begin
PRC_RES_LOCAL prc_res_local
PRC_RETURN prc_return
PRC_RETURN2 prc_return2
PRC_SETTRACE prc_settrace
PRC_TRACE prc_trace
PRC_VARFUNC prc_varfunc
PRC_VARFUNC2 prc_varfunc2
PRC_WHILE prc_while while

13.20 Actions for the type program

Action name prglib.c function prg_comp.c function
PRG_CPY prg_cpy prgCpy
PRG_CREATE prg_create
PRG_DECL_OBJECTS prg_decl_objects prgDeclObjects
PRG_DESTR prg_destr
PRG_EMPTY prg_empty
PRG_EQ prg_eq ==
PRG_ERROR_COUNT prg_error_count prgErrorCount
PRG_EVAL prg_eval prgEval
PRG_EXEC prg_exec prgExec
PRG_FIL_PARSE prg_fil_parse prgFilParse
PRG_FIND prg_find
PRG_MATCH prg_match prgMatch
PRG_NAME prg_name arg_0
PRG_NE prg_ne !=
PRG_PROG prg_prog
PRG_STR_PARSE prg_str_parse prgStrParse
PRG_SYOBJECT prg_syobject prgSyobject
PRG_SYSVAR prg_sysvar prgSysvar
PRG_VALUE prg_value prgValue

13.21 Actions for the type reference

Action name reflib.c function ref_data.c function
REF_ADDR ref_addr &
REF_ALLOC ref_alloc refAlloc
REF_ARRMAXIDX ref_arrmaxidx refArrmaxidx
REF_ARRMINIDX ref_arrminidx refArrminidx
REF_ARRTOLIST ref_arrtolist refArrtolist
REF_BODY ref_body refBody
REF_BUILD ref_build
REF_CATEGORY ref_category refCategory
REF_CAT_PARSE ref_cat_parse refCatParse
REF_CAT_STR ref_cat_str refCatStr
REF_CMP ref_cmp refCmp
REF_CONTENT ref_content
REF_CONV ref_conv (noop)
REF_CPY ref_cpy refCpy
REF_CREATE ref_create refCreate
REF_DEREF ref_deref
REF_EQ ref_eq ==
REF_FILE ref_file refFile
REF_FIND ref_find
REF_HASHCODE ref_hashcode (inttype)(((uinttype)a)>>6)
REF_ISSYMB ref_issymb
REF_ISVAR ref_isvar refIsvar
REF_ITFTOSCT ref_itftosct refItftosct
REF_LINE ref_line refLine
REF_LOCAL_CONSTS ref_local_consts refLocalConsts
REF_LOCAL_VARS ref_local_vars refLocalVars
REF_MKREF ref_mkref
REF_NAME ref_name
REF_NE ref_ne !=
REF_NIL ref_nil
REF_NUM ref_num refNum
REF_PARAMS ref_params refParams
REF_PROG ref_prog
REF_RESINI ref_resini refResini
REF_RESULT ref_result refResult
REF_SCAN ref_scan
REF_SCTTOLIST ref_scttolist refScttolist
REF_SELECT ref_select a->stru[b]
REF_SETCATEGORY ref_setcategory refSetCategory
REF_SETPARAMS ref_setparams refSetParams
REF_SETTYPE ref_settype refSetType
REF_STR ref_str refStr
REF_SYMB ref_symb
REF_TRACE ref_trace printf
REF_TYPE ref_type refType
REF_VALUE ref_value refValue

13.22 Actions for the type ref_list

Action name rfllib.c function rfl_data.c function
RFL_APPEND rfl_append rflAppend
RFL_CAT rfl_cat rflCat
RFL_CPY rfl_cpy rflCpy
RFL_CREATE rfl_create rflCreate
RFL_DESTR rfl_destr rflDestr
RFL_ELEM rfl_elem rflElem
RFL_ELEMCPY rfl_elemcpy rflElemcpy
RFL_EMPTY rfl_empty
RFL_EQ rfl_eq rflEq
RFL_EXCL rfl_excl
RFL_EXPR rfl_expr
RFL_FOR rfl_for for
RFL_HEAD rfl_head rflHead
RFL_IDX rfl_idx rflIdx
RFL_INCL rfl_incl rflIncl
RFL_IPOS rfl_ipos rflIpos
RFL_LNG rfl_lng rflLng
RFL_MKLIST rfl_mklist rflMklist
RFL_NE rfl_ne rflNe
RFL_NOT_ELEM rfl_not_elem !rflElem
RFL_POS rfl_pos rflPos
RFL_RANGE rfl_range rflRange
RFL_SETVALUE rfl_setvalue rflSetvalue
RFL_TAIL rfl_tail rflTail
RFL_TRACE rfl_trace
RFL_VALUE rfl_value rflValue

13.23 Actions for text (console) screen output

Action name scrlib.c function scr_inf.c/scr_rtl.c/scr_win.c function
SCR_CLEAR scr_clear scrClear
SCR_CURSOR scr_cursor scrCursor
SCR_FLUSH scr_flush scrFlush
SCR_HEIGHT scr_height scrHeight
SCR_H_SCL scr_h_scl scrHScroll
SCR_OPEN scr_open scrOpen
SCR_SETPOS scr_setpos scrSetpos
SCR_V_SCL scr_v_scl scrVScroll
SCR_WIDTH scr_width scrWidth
SCR_WRITE scr_write scrWrite

13.24 Actions for struct types

Action name sctlib.c function
SCT_ALLOC sct_alloc
SCT_CAT sct_cat
SCT_CONV sct_conv
SCT_CPY sct_cpy cpy_ ...
SCT_CREATE sct_create create_ ...
SCT_DESTR sct_destr destr_ ...
SCT_ELEM sct_elem
SCT_EMPTY sct_empty
SCT_INCL sct_incl
SCT_LNG sct_lng
SCT_REFIDX sct_refidx
SCT_SELECT sct_select a->stru[b]

13.25 Actions for set types

Action name setlib.c function set_rtl.c function
SET_ARRLIT set_arrlit setArrlit
SET_BASELIT set_baselit setBaselit
SET_CARD set_card setCard
SET_CMP set_cmp setCmp
SET_CONV set_conv (noop)
SET_CPY set_cpy setCpy
SET_CREATE set_create setCreate
SET_DESTR set_destr setDestr
SET_DIFF set_diff setDiff
SET_ELEM set_elem setElem
SET_EMPTY set_empty
SET_EQ set_eq setEq
SET_EXCL set_excl setExcl
SET_GE set_ge setIsSubset(b, a)
SET_GT set_gt setIsProperSubset(b, a)
SET_HASHCODE set_hashcode setHashCode
SET_ICONV set_iconv setIConv
SET_INCL set_incl setIncl
SET_INTERSECT set_intersect setIntersect
SET_LE set_le setIsSubset
SET_LT set_lt setIsProperSubset
SET_MAX set_max setMax
SET_MIN set_min setMin
SET_NE set_ne setNe
SET_NOT_ELEM set_not_elem setNotElem
SET_RAND set_rand setRand
SET_SCONV set_sconv setSConv
SET_SYMDIFF set_symdiff setSymdiff
SET_UNION set_union setUnion
SET_VALUE set_value setValue

13.26 Actions for the type PRIMITIVE_SOCKET

Action name strlib.c function str_rtl.c function
SOC_ACCEPT soc_accept socAccept
SOC_BIND soc_bind socBind
SOC_CLOSE soc_close socClose
SOC_CONNECT soc_connect socConnect
SOC_CPY soc_cpy =
SOC_CREATE soc_create
SOC_EMPTY soc_empty
SOC_EQ soc_eq ==
SOC_GETC soc_getc socGetc
SOC_GETS soc_gets socGets
SOC_INET_ADDR soc_inet_addr socInetAddr
SOC_INET_LOCAL_ADDR soc_inet_local_addr socInetLocalAddr
SOC_INET_SERV_ADDR soc_inet_serv_addr socInetServAddr
SOC_LINE_READ soc_line_read socLineRead
SOC_LISTEN soc_listen socListen
SOC_NE soc_ne !=
SOC_RECV soc_recv socRecv
SOC_RECVFROM soc_recvfrom socRecvfrom
SOC_SEND soc_send socSend
SOC_SENDTO soc_sendto socSendto
SOC_SOCKET soc_socket socSocket
SOC_WORD_READ soc_word_read socWordRead
SOC_WRITE soc_write socWrite

13.27 Actions for the type string

Action name strlib.c function str_rtl.c function
STR_APPEND str_append strAppend
STR_CAT str_cat strConcat, strConcatTemp
STR_CHIPOS str_chipos strChIpos
STR_CHPOS str_chpos strChPos
STR_CHSPLIT str_chsplit strChSplit
STR_CLIT str_clit strCLit
STR_CMP str_cmp strCompare
STR_CPY str_cpy strCopy
STR_CREATE str_create strCreate
STR_DESTR str_destr strDestr
STR_ELEMCPY str_elemcpy a->mem[b-1]=c
STR_EQ str_eq a->size==b->size&&memcmp(a,b,a->size*sizeof(strelemtype))==0
STR_GE str_ge strGe
STR_GETENV str_getenv strGetenv
STR_GT str_gt strGt
STR_HASHCODE str_hashcode strHashCode
STR_HEAD str_head strHead
STR_IDX str_idx a->mem[b-1]
STR_IPOS str_ipos strIpos
STR_LE str_le strLe
STR_LIT str_lit strLit
STR_LNG str_lng a->size
STR_LOW str_low strLow, strLowTemp
STR_LPAD str_lpad strLpad
STR_LPAD0 str_lpad0 strLpad0, strLpad0Temp
STR_LT str_lt strLt
STR_MULT str_mult strMult
STR_NE str_ne a->size==b->size&&memcmp(a,b,a->size*sizeof(strelemtype))==0
STR_POS str_pos strPos
STR_PUSH str_push strPush
STR_RANGE str_range strRange
STR_RCHPOS str_rchpos strRChPos
STR_REPL str_repl strRepl
STR_RPAD str_rpad strRpad
STR_RPOS str_rpos strRpos
STR_SPLIT str_split strSplit
STR_STR str_str (noop)
STR_SUBSTR str_substr strSubstr
STR_TAIL str_tail strTail
STR_TOUTF8 str_toutf8 strToUtf8
STR_TRIM str_trim strTrim
STR_UP str_up strUp, strUpTemp
STR_UTF8TOSTRI str_utf8tostri strUtf8ToStri
STR_VALUE str_value strValue

13.28 Actions for the type time

Action name timlib.c function tim_unx.c/tim_win.c function
TIM_AWAIT tim_await timAwait
TIM_FROM_TIMESTAMP tim_from_timestamp timFromTimestamp
TIM_NOW tim_now timNow
TIM_SET_LOCAL_TZ tim_set_local_tz timSetLocalTZ

13.29 Actions for the type type

Action name typlib.c function typ_data.c function
TYP_ADDINTERFACE typ_addinterface
TYP_CMP typ_cmp typCmp
TYP_CPY typ_cpy typCpy
TYP_CREATE typ_create typCreate
TYP_DESTR typ_destr typDestr
TYP_EQ typ_eq ==
TYP_FUNC typ_func typFunc
TYP_GENSUB typ_gensub
TYP_GENTYPE typ_gentype
TYP_HASHCODE typ_hashcode (inttype)(((uinttype)a)>>6)
TYP_ISDECLARED typ_isdeclared
TYP_ISDERIVED typ_isderived typIsDerived
TYP_ISFORWARD typ_isforward
TYP_ISFUNC typ_isfunc typIsFunc
TYP_ISVARFUNC typ_isvarfunc typIsVarfunc
TYP_MATCHOBJ typ_matchobj typMatchobj
TYP_META typ_meta typMeta
TYP_NE typ_ne !=
TYP_NUM typ_num typNum
TYP_RESULT typ_result typResult
TYP_STR typ_str typStr
TYP_VALUE typ_value typValue
TYP_VARCONV typ_varconv
TYP_VARFUNC typ_varfunc typVarfunc

13.30 Actions for the type utf8_file

Action name ut8lib.c function ut8_rtl.c function
UT8_GETC ut8_getc ut8Getc
UT8_GETS ut8_gets ut8Gets
UT8_LINE_READ ut8_line_read ut8LineRead
UT8_SEEK ut8_seek ut8Seek
UT8_WORD_READ ut8_word_read ut8WordRead
UT8_WRITE ut8_write ut8Write


 previous   up   next