Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Manual Introduction Tutorial Declarations Statements Types Parameters Objects File System Syntax Tokens Expressions OS access Actions Foreign funcs Errors
Actions ACTION array bigInteger boolean bstring char commands console output declarations graphic enumeration clib_file float graphic keybd hash integer interface console keybd list pollData statements program reference ref_list struct set socket string time type utf8_file
 previous   up   next 


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 practice 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:


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 string, array or ref_list
_ICONV Conversion of integer to another type
_IDX Index (Element) of string, array or ref_list
_INCR Increment
_IPOW Power with integer exponent
_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)
_MOD Modulo (Reminder of _MDIV integer division)
_MULT Multiply
_NE Not equal
_NEGATE Change sign
_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 string, array or ref_list
_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 string, array or ref_list
_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 clib_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.

In a Seed7 program the operator + is used to add two integer values. The primitive action, which describes the addition of two integers, is 'INT_ADD'. The connection between + and 'INT_ADD' is done in the library "integer.s7i" with the definition:

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

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

objectType int_add (listType arguments)

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

The function int_add() adds the first and the third argument (the second argument contains the + symbol. The file "objutl.h" contains several macros and functions which help to handle the arguments (parameter list) of a C primitive action function.

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

objectType int_add (listType arguments);

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 s7 interpreter understands a primitive action.

To allow a primitive function in a compiled Seed7 program the Seed7 compiler (s7c) 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

    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:

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_LOG2' is such an action. The definition of the function int_log2() in the file "intlib.c" is:

objectType int_log2 (listType arguments)

  { /* int_log2 */
    return bld_int_temp(
  } /* int_log2 */

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

 *  Compute the truncated base 2 logarithm of an integer number.
 *  @return the truncated base 2 logarithm.
 *  @exception NUMERIC_ERROR The number is negative.
intType intLog2 (intType number)

    int result;

  /* intLog2 */
    if (unlikely(number < 0)) {
      result = 0;
    } else {
      result = uintMostSignificantBit((uintType) number);
    } /* if */
    return result;
  } /* intLog2 */

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

intType intLog2 (intType number);

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

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

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

The compiler writes a prototype of intLog2() in the function write_prototypes:

declareExtern("intType     intLog2 (intType);");

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 (s7c) 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_PUSH arr_push arrPush
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_MOD big_mod bigMod
BIG_MULT big_mult bigMult
BIG_MULT_ASSIGN big_mult_assign bigMultAssign
BIG_NE big_ne bigNe
BIG_NEGATE big_negate bigNegate
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_CMP bst_cmp bstCmp
BST_CPY bst_cpy bstCpy
BST_CREATE bst_create bstCreate
BST_DESTR bst_destr bstDestr
BST_EMPTY bst_empty  
BST_EQ bst_eq a->size==b->size && memcmp(a,b,a->size*sizeof(unsigned char))==0
BST_HASHCODE bst_hashcode bstHashCode
BST_IDX bst_idx a->mem[b-1]
BST_LNG bst_lng a->size
BST_NE bst_ne a->size!=b->size || memcmp(a,b,a->size*sizeof(unsigned char))!=0
BST_PARSE bst_parse bstParse
BST_STR bst_str bstStr
BST_VALUE bst_value bstValue

13.6 Actions for the type char

Action name chrlib.c function chr_rtl.c function
CHR_CHR chr_chr (charType)
CHR_CLIT chr_clit chrCLit
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)((scharType)a)
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_ENVIRONMENT cmd_environment cmdEnvironment
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_GETENV cmd_getenv cmdGetenv
CMD_GET_ATIME cmd_get_atime cmdGetATime
CMD_GET_CTIME cmd_get_ctime cmdGetCTime
CMD_GET_MTIME cmd_get_mtime cmdGetMTime
CMD_GET_SEARCH_PATH cmd_getSearchPath cmdGetSearchPath
CMD_HOME_DIR cmd_homeDir cmdHomeDir
CMD_LS cmd_ls cmdLs
CMD_MKDIR cmd_mkdir cmdMkdir
CMD_MOVE cmd_move cmdMove
CMD_PIPE2 cmd_pipe2 cmdPipe2
CMD_PTY cmd_pty cmdPty
CMD_READLINK cmd_readlink cmdReadlink
CMD_REMOVE cmd_remove cmdRemove
CMD_REMOVE_ANY_FILE cmd_remove_any_file cmdRemoveAnyFile
CMD_SETENV cmd_setenv cmdSetenv
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_SHELL_ESCAPE cmd_shell_escape cmdShellEscape
CMD_START_PROCESS cmd_start_process cmdStartProcess
CMD_SYMLINK cmd_symlink cmdSymlink
CMD_TO_OS_PATH cmd_to_os_path cmdToOsPath

13.8 Actions for text (console) screen output

Action name scrlib.c function con_inf.c/con_rtl.c/con_win.c function
CON_CLEAR con_clear conClear
CON_CURSOR con_cursor conCursor
CON_FLUSH con_flush conFlush
CON_HEIGHT con_height conHeight
CON_H_SCL con_h_scl conHScroll
CON_OPEN con_open conOpen
CON_SETPOS con_setpos conSetpos
CON_V_SCL con_v_scl conVScroll
CON_WIDTH con_width conWidth
CON_WRITE con_write conWrite

13.9 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_FWDVAR dcl_fwdvar
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_PARAM_ATTR dcl_param_attr
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.10 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_CMP drw_cmp uintCmpGeneric((genericType)(a))
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_GETPIXEL drw_getPixel drwGetPixel
DRW_HASHCODE drw_hashcode (intType)(((memSizeType)a)>>6)
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_PIXELTORGB drw_pixelToRgb drwPixelToRgb
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_SETCONTENT drw_setContent drwSetContent
DRW_SETPOS drw_setPos drwSetPos
DRW_SETTRANSPARENTCOLOR drw_setTransparentColor drwSetTransparentColor
DRW_TEXT drw_text drwText
DRW_TOBOTTOM drw_toBottom drwToBottom
DRW_TOTOP drw_toTop drwToTop
DRW_WIDTH drw_width drwWidth
DRW_XPOS drw_xpos drwXPos
DRW_YPOS drw_ypos drwYPos

13.11 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_VALUE enu_value enuValue

13.12 Actions for the type clib_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_INPUT_READY fil_input_ready filInputReady
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_PCLOSE fil_pclose filPclose
FIL_POPEN fil_popen filPopen
FIL_PRINT fil_print filPrint
FIL_SEEK fil_seek filSeek
FIL_SETBUF fil_setbuf filSetbuf
FIL_TELL fil_tell filTell
FIL_VALUE fil_value filValue
FIL_WORD_READ fil_word_read filWordRead
FIL_WRITE fil_write filWrite

13.13 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_ISNEGATIVEZERO flt_isnegativezero fltIsNegativeZero
FLT_LE flt_le <=
FLT_LOG flt_log log
FLT_LOG10 flt_log10 log10
FLT_LT flt_lt <
FLT_MULT flt_mult *
FLT_MULT_ASSIGN flt_mult_assign *=
FLT_NE flt_ne !=
FLT_NEGATE flt_negate -
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_SCI flt_sci fltSci
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.14 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_BUTTON_PRESSED gkb_button_pressed gkbButtonPressed
GKB_BUTTON_XPOS gkb_button_xpos gkbButtonXpos
GKB_BUTTON_YPOS gkb_button_ypos gkbButtonYpos
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

13.15 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.16 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_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_NEGATE int_negate -
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_RADIX int_RADIX intRadix
INT_RAND int_rand intRand
INT_REM int_rem %
INT_RSHIFT int_rshift a>>b /* C with arithmetic shift */
a<0?~(~a>>b):a>>b /* C with logical shift */
INT_RSHIFT_ASSIGN int_rshift_assign a>>=b /* C with arithmetic shift */
if (a<0) a= ~(~a>>b); else a>>=b; /* C with logical shift */
INT_SBTR int_sbtr -
INT_SHRINK int_shrink -=
INT_SQRT int_sqrt intSqrt
INT_STR int_str intStr
INT_SUCC int_succ +1
INT_VALUE int_value intValue
INT_radix int_radix intRadix

13.17 Actions for interface types

Action name itflib.c function  
ITF_CMP itf_cmp uintCmpGeneric
ITF_CONV2 itf_conv2 (noop)
ITF_CPY itf_cpy =
ITF_CPY2 itf_cpy2 =
ITF_CREATE itf_create  
ITF_CREATE2 itf_create2  
ITF_DESTR itf_destr itfDestr
ITF_EQ itf_eq ==
ITF_HASHCODE itf_hashcode (intType)(((memSizeType)a)>>6)
ITF_NE itf_ne !=
ITF_TO_HEAP itf_to_heap  
ITF_TO_INTERFACE itf_to_interface  

13.18 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.19 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.20 Actions for the type pollData

Action name pollib.c function pol_unx.c/pol_sel.c function
POL_ADD_CHECK pol_addCheck polAddCheck
POL_CLEAR pol_clear polClear
POL_CPY pol_cpy polCpy
POL_CREATE pol_create polCreate
POL_DESTR pol_destr polDestr
POL_EMPTY pol_empty polEmpty
POL_GET_CHECK pol_getCheck polGetCheck
POL_GET_FINDING pol_getFinding polGetFinding
POL_HAS_NEXT pol_hasNext polHasNext
POL_ITER_CHECKS pol_iterChecks polIterChecks
POL_ITER_FINDINGS pol_iterFindings polIterFindings
POL_NEXT_FILE pol_nextFile polNextFile
POL_POLL pol_poll polPoll
POL_REMOVE_CHECK pol_removeCheck polRemoveCheck
POL_VALUE pol_value polValue

13.21 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.22 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_MATCH_EXPR prg_match_expr prgMatchExpr
PRG_NAME prg_name arg_0
PRG_NE prg_ne !=
PRG_PATH prg_path programPath
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.23 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_CAST ref_cast  
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)(((memSizeType)a)>>6)
REF_HSHDATATOLIST ref_hshdatatolist refHshDataToList
REF_HSHKEYTOLIST ref_hshkeytolist refHshKeyToList
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_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.24 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_FOR_UNTIL rfl_for_until 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.25 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.26 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_NEXT set_next setNext
SET_NOT_ELEM set_not_elem !setElem
SET_RAND set_rand setRand
SET_RANGELIT set_rangelit setRangelit
SET_SCONV set_sconv setSConv
SET_SYMDIFF set_symdiff setSymdiff
SET_UNION set_union setUnion
SET_VALUE set_value setValue

13.27 Actions for the type PRIMITIVE_SOCKET

Action name strlib.c function str_rtl.c function
SOC_ACCEPT soc_accept socAccept
SOC_ADDR_FAMILY soc_addr_family socAddrFamily
SOC_ADDR_NUMERIC soc_addr_numeric socAddrNumeric
SOC_ADDR_SERVICE soc_addr_service socAddrService
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_GET_ADDR soc_get_addr socGetAddr
SOC_GET_HOSTNAME soc_get_hostname socGetHostname
SOC_HAS_NEXT soc_has_next socHasNext
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_INPUT_READY soc_input_ready socInputReady
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.28 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_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_POSCPY str_poscpy memcpy
STR_PUSH str_push strPush
STR_RANGE str_range strRange
STR_RCHIPOS str_rchipos strRChIpos
STR_RCHPOS str_rchpos strRChPos
STR_REPL str_repl strRepl
STR_RIPOS str_ripos strRIPos
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.29 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.30 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)(((memSizeType)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.31 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