Support This Project Get i5/OS Programmer's Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads

Specifications of EMI Builtins

Here we describe all EMI builtin implemented by now.

Terminology used here confirms to IBM's convension, see the following documentation for details:

Builtin list

%memcpy (copy memory area)

Prototye of %memcpy
/* builtin number: hex 0000 */
%memcpy(
        target_ptr, : space pointer, points to target data object
        source_ptr, : space pointer, points to source data object
        len         : numeric scalar, specifies the number of bytes to copy from
                      source data object to target data object
)

Builtin %memcpy copies len bytes from the data object that source_ptr addressed to to the data object that target_ptr addressed to. The source and target data objects may not overlap.

%sendmsg (send a program message)

Builtin %sendmsg sends a program message containing message text stored in msg to a program's caller.

Prototye of %sendmsg

/* builtin number: hex 0001 */
%sendmsg(
        msg,     : character scalar, message to send
        msg_len  : length of message in bytes to send
)

%stmf-creat (open and possibly create a stream file)

Prototype
/* builtin number: hex 0002 */
%stmf-creat(
        path_name, : character scalar, *STMF path name
        acess_mode : bin(4), access mode of the newly created *STMF
) : bin(4), returned file descriptor

%stmf-creat creates a new IFS stream file or truncate an existing IFS stream file. %stmf-creat returns a new file descriptor or -1 if an error occured.

See Operate Stream Files using EMI Stream File Bulitins for example.

%stmf-close (close a file descriptor)

Prototype
/* builtin number: hex 0003 */
%stmf-close(
        file_descriptor : bin(4), file descriptor to close
)

%stmf-close closes a file descriptor. Since this builtin calls the unix-type API close(), feel free to use it to close file descriptors created by socket() or pipe(). :p

See Operate Stream Files using EMI Stream File Bulitins for example.

%stmf-write (write to a file descriptor)

Prototype
/* builtin number: hex 0003 */
%stmf-write(
        file_descriptor, : bin(4), file descriptor to close
        buf,             : character scalar,
        len              : bin(4)
) : bin(4), bytes written to the stream file

%stmf-write writes up to len bytes to file_descriptor from the beginning of buf.

See Operate Stream Files using EMI Stream File Bulitins for example.

%system (execute a CL command)

/* builtin number: hex 0005 */
%system(
        cl_command : null-terminated character scalar, CL command to execute
) : bin(4), return value

%system executes a CL command specified in parameter cl_command and returns an integer walue to indicates whether or not the CL command has been executed successfully. %system returns nonzero if the specified CL command failed, and zero if not.

%uim-opnda (initiate a UIM display application)

/* builtin number: hex 0006 */
%uim-opnda(
        pnlgrp_name, : char(20), qualified panel group name
        app_scope,   : bin(4), application scope
        parm_interface, : bin(4), exit parameter interface
        full_screen_help, : char(1), display help information in full-screen or pop-up windows
        err_code     : character scalar, error code
) : char(8), unique application handle for the opened application.

%uim-opnda initiates a UIM display application. %uim-opnda encapsulates the functionalitiy of UIM (User Interface Manager) API QUIOPNDA. For UIM APIs, and API QUIOPNDA. Please refer to the following links:

%uim-opnda accepts parameters pnlgrp_name, app_scope, parm_interface, full_screen_help, err_code and returns a 8 bytes unique application handle for the opened application.

Remarks:
Parameter app_scope specifies the manner that UIM resources occupied by the opened application are mananged. See Open Display Application (QUIOPNDA) API for details.

Parameter err_code refers to the Error Code Parameter used by i5/OS APIs.

%uim-cloa (close a UIM application)

/* builtin number: hex 0007 */
%uim-cloa (
          apph,    : char(8), application handle
          option,  : char(1), close option
          err_code : character scalar, error code
)

%uim-cloa closes a UIM application that was opened using the Open Display Application (QUIOPNDA) API or the Open Print Application (QUIOPNPA) API.

%uim-dspp (display a UIM panel)

/* builtin number: hex 0008 */
%uim-dspp (
          apph,       : char(8), application handle
          panel,      : char(10), panel name to display
          redisp_opt, : char(1), redisplay option
          err_code    : character scalar, error code
) : bin(4), 

%uim-dspp displays a panel and waits for the user to press either a function key or the Enter key.

%uim-dspp encapsulates the functionalitiy of UIM (User Interface Manager) API QUIDSPP. For UIM APIs, and API QUIDSPP. Please refer to the following links:

%uim-putv (update UIM variables)

/* builtin number: hex 0009 */
%uim-putv (
          apph,        : char(8), application handle
          var_buffer,  : character scalar, variable buffer
          var_buf_len, : bin(4), variable buffer length
          var_rcd,     : char(10), variable record name
          err_code    : character scalar, error code
)

%uim-putv updates the value of one or more dialog variables by specifying variable buffer of the application program and naming the variable record defined in the panel group for the open application.

%uim-putv encapsulates the functionalitiy of UIM (User Interface Manager) API QUIPUTV. For UIM APIs, and API QUIPUTV. Please refer to the following links:

%uim-getv (obtain UIM variables)

/* builtin number: hex 000A */
%uim-getv (
          apph,        : char(8), application handle
          var_buffer,  : character scalar, variable buffer
          var_buf_len, : bin(4), variable buffer length
          var_rcd,     : char(10), variable record name
          err_code    : character scalar, error code
)

%uim-getv obtains the value of one or more dialog variables by specifying variable buffer of the application program and naming the variable record defined in the panel group for the open application.

%uim-getv encapsulates the functionalitiy of UIM (User Interface Manager) API QUIGETV. For UIM APIs, and API QUIGETV. Please refer to the following links:

%memset (propogate byte)

Prototype of %memset
/* builtin number: hex 000B */
%memset(
        target_ptr,  : space pointer, points to target data object
        source_byte, : character scalar, only the leftmost byte is used
        len          : numeric scalar, specifies the number of bytes to copy
                       into the target data object
)

Builtin %memset copies the byte value specified by source_byte into the storage specified by target string. len specifies the number of bytes of storage into which this value is stored.


Support This Project
Generated on Mon Aug 1 22:50:22 2011 for i5/OS Programmer's Toolkit: MIC - The Machine Instruction Language Compiler by  doxygen 1.5.9