gtpc2m09C/C++ Language Support User's Guide

Mapping Assembler Macros to C Functions

The following section is provided for those programmers who are making the transition from 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 3. Mapping TPF Assembler Services to C Functions

Assembler Service Corresponding C Functions
ADDLC addlc
ALPHA scanf, sscanf
ATTAC attac, attac_ext
CALOC calloc
CEBIC cebic_save, cebic_restore, cebic_goto_bss, cebic_goto_dbi, cebic_goto_ssu
CENVC getenv, setenv, unsetenv
CIFRC cifrc
CINFC cinfc, cinfc_fast, cinfc_fast_ss
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
EDITA scanf, sscanf
ENQC enqc
ENTDC entdc
ENTRC entrc, TPF_CALL_BY_NAME, normal external function call.
ESFAC tpf_esfac
EVINC evinc
EVNQC evnqc
EVNTC evntc
EVNWC evnwc
EXITC abort, exit
FA4X4C tpf_fa4x4c
FAC8C tpf_fac8c
FACZC tpf_faczc
FILEC file_record, file_record_ext, filec, filec_ext
FILKW global
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
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
GL0BY glob, global
GLMOD global
GLOBZ glob, global
GLOUC global, glob_keypoint, glob_update
INQRC inqrc
KEYRC keyrc
LEVTA levtest
$LOCKC lockc
LODIC lodic, lodic_ext
LONGC longc
MALOC malloc
MOVEC tpf_movec
PAUSC pausc
PROGC progc
POSTC postc
RAISA raisa
RALOC realloc
RCRFC tpf_rcrfc
RCUNC rcunc
REHKA rehka
RELCC relcc
RELFC relfc
RELPC relpc
RIDCC ridcc
RLCHA rlcha
ROUTC printf, puts, routc
RVTCC rvtcc
SELEC selec
SENDC printf, puts, routc
SERRC serrc_op
SNAPC snapc
SONIC sonic
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
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
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

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