Mapping assembler macros to C functions

The following section is provided for those programmers who are making the transition from z/TPF application programming in assembler, to C language. Many assembler macros do not have an equivalent in the C language. This is because they are not relevant to C language programming, or there are applicable existing C library functions. Conversely, there are many C functions that have no assembler equivalent.

The entries that appear in the Assembler Service column include macros, as well as program segments that are commonly entered to perform certain common system functions, such as date conversion and message transmission.

The following table lists the C functions that perform equivalent services to their assembler counterparts, either in whole or in part.

Table 1. Mapping z/TPF assembler services to C functions
Assembler Service Corresponding C Functions
ADDLC addlc
ALPHA scanf, sscanf
ATTAC attac, attac_ext
CALOC calloc, calloc64
CCIDC tpf_cpuid_to_ordinal, tpf_cpuord_to_id
CEBIC cebic_save, cebic_restore, cebic_goto_bss, cebic_goto_dbi, cebic_goto_ssu
CINFC cinfc, cinfc_fast, cinfc_fast_ss
CONKC tpf_conk
CORHC corhc
CORUC coruc
CRASC printf, routc
CRATC cratc
CREDC credc
CREEC creec
CREMC cremc
CRESC tpf_cresc
CRETC cretc, cretc_level
CREXC crexc
CROSC crosc_entrc
CRUSA crusa, relcc
CSONC csonc
DBSAC dbsac
DBSDC dbsdc.h
DECBC tpf_decb_create, tpf_decb_locate, tpf_decb_release, tpf_decb_swapblk, tpf_decb_validate
DEFRC defrc
DEQC deqc
DETAC detac, detac_ext
DLAYC dlayc
ECBMC tpf_ecbmc
EDITA scanf, sscanf
ENQC enqc, tpf_enqc_timeout, tpf_enqc_qtime
ENTDC entdc
ENTRC entrc, TPF_CALL_BY_NAME, normal external function call.
ESFAC tpf_esfac
EVINC evinc
EVNQC evnqc
EVNTC evntc, tpf_evntc_timeout
EVNWC evnwc, evnwc_cond
EXITC abort, exit
FA4X4C tpf_fa4x4c
FAC8C tpf_fac8c
FACZC tpf_faczc
FILEC file_record, file_record_ext, filec, filec_ext
FILKW global, tpf_filkw
FILNC filnc, filnc_ext, file_record_ext
FILUC file_record, filuc, filuc_ext, file_record_ext
FINDC findc, findc_ext, find_record_ext
FINHC find_record, finhc, finhc_ext, find_record_ext
FINSCD find_record_ext
FINSCP find_record_ext
FINWC find_record, finwc, finwc_ext, find_record_ext
FIWHC find_record, fiwhc, fiwhc_ext, find_record_ext
FLIPC flipc
FMSG printf, puts, sprintf
FREEC free
GDSNC gdsnc
GDSRC gdsrc
GETCC getcc
GETFC getfc
GETPC getpc
GFGATC tpf_gfgatc
GLBLUC tpf_glbluc
GLOBLC tpf_glClose, tpf_glCntl, tpf_glOpen, tpf_glStat, tpf_glWrite
GL0BY glob, global
GLMOD global, tpf_glmod
GLOBZ glob, global
GLOUC global, glob_keypoint, glob_update
INQRC inqrc
ITRPC tpf_itrpc
KEYRC keyrc
LEVTA levtest
LOCKC lockc
LODIC lodic, lodic_ext
LONGC longc
MALOC malloc, malloc64
MOVEC tpf_movec, tpf_movec_EVM, tpf_movec_EVM_return, tpf_movec_return
MYCALOC mycalloc
MYFREEC myfree
MYMALOC mymalloc
MYRALOC myrealloc
NDSPC tpf_ndsp_mark, tpf_ndsp_unmark
PAUSC pausc
PDIRC tpf_pdirc
PROGC progc
POSTC postc
RAISA raisa
RALOC realloc, realloc64
RCRFC tpf_rcrfc
RCUNC rcunc
REHKA rehka
RELCC relcc
RELFC relfc, tpf_relfc_ext
RIDCC ridcc
RLCHA rlcha
ROUTC printf, puts, routc
RTCUC tpf_rtcuc_cton, tpf_rtcuc_deactivated_segments, tpf_rtcuc_extents, tpf_rtcuc_ntoc, tpf_rtcuc_poolsegments, tpf_rtcuc_splits
RVTCC rvtcc
SELEC selec
SENDC printf, puts, routc
SERRC serrc_op
SNAPC snapc
SONIC sonic
STPOC tpf_stpoc
SWCHC tpf_swchc
SYNCC global, glob, glob_sync, glob_update
SYSTC systc
TASNC tasnc
TANCC tancc
TBSPC tape_cntl, tbspc
TCLSC tape_close, tclsc
TDSPC tdspc, tdspc_q
TGETC tpf_tgetc
TLOGC tpf_tracelog_on, tpf_tracelog_off
TMCNA ctime, time, gmtime
TMSLC tmslc
TOPNC tape_open, topnc
TOURC tourc
TOUTC toutc
TPCNC tape_cntl
TPPCC tppc_activate_on_confirmation, tppc_activate_on_receipt, tppc_allocate, tppc_confirm, tppc_confirmed, tppc_deallocate, tppc_flush, tppc_get_attributes, tppc_get_type, tppc_post_on_receipt, tppc_prepare_to_receive, tppc_receive, tppc_request_to_send, tppc_send_data, tppc_send_error, tppc_test, tppc_wait
TPRDC tape_read, tprdc
TPUTC tpf_tputc
TREWC tape_cntl, trewc
TRSVC trsvc
TSYNC tape_close, tsync
TWRTC tape_write, twrtc
TXBGC tx_begin
TXCMC tx_commit
TXRBC tx_rollback
TXRSC tx_resume_tpf
TXSPC tx_suspend_tpf
TYCVA ctime, time, gmtime
UATBC uatbc
UCDR gmtime, ctime
UIO1 puts
UNFRC unfrc, unfrc_ext
UNHKA unhka
UNLKC unlkc
WAITC waitc
WGTAC wgtac
WTOPC wtopc, wtopc_text
VIPAC tpf_vipac

Function prototypes are found in header files. Prototypes for the z/TPF C functions are normally found in tpfapi.h. The z/TPF system find and file function prototypes are found in tpfio.h, while the C language I/O function prototypes are in stdio.h.