C Programming Language C Functions List

The following C functions are presented:

C string

A series of characters terminated by a null (0x00) character usually used in C.

CPSTR

Defines the structure of a D3 data element manipulated from the C environment.

CPSTR*

Points to a string structure used by routines that access D3 from the C programming language.

_CP_alpha

Equivalent to the result = alpha(string) BASIC statement.

_CP_ascii

Equivalent to the result = ascii(string) BASIC statement.

_CP_at1

Equivalent to the result = @(x) BASIC statement.

_CP_at2

Equivalent to the result = @(x,y) BASIC statement.

_CP_break

Equivalent to the break expression BASIC statement.

_CP_build_msg

Queues up arguments for _CP_out_msg. This function, in conjunction with _CP_out_msg, is equivalent to the BASIC error statement.

_CP_call

Equivalent to the call name( {string1 {, string2 {, ...}}}) BASIC statement.

_CP_casing

Equivalent to the casing expression BASIC statement.

_CP_cat

Equivalent to the result = string1:string2 BASIC statement.

_CP_clearfile

Equivalent to the clearfile BASIC statement.

_CP_clearselect

Equivalent to the clearselect BASIC statement.

_CP_close

Equivalent to the close BASIC statement.

_CP_col1

Equivalent to the result = col1 BASIC statement.

_CP_col2

Equivalent to the result = col2 BASIC statement.

_CP_compare

Equivalent to the result = (string1 = string2) BASIC statement.

_CP_convert

Equivalent to the convert string1 to string2 in result BASIC statement.

_CP_count

Equivalent to the result = count(string1, string2) BASIC statement.

_CP_crt

Equivalent to the crt BASIC statement.

_CP_crt_n

Equivalent to the crt BASIC statement.

_CP_data

Equivalent to the data string BASIC statement.

_CP_date

Equivalent to the result = date() BASIC statement.

_CP_dcount

Equivalent to the result = dcount(string1, string2) BASIC statement.

_CP_debug

Equivalent to the debug  BASIC statement.

_CP_delete

Equivalent to the result = delete(string, ac.expression, vc.expression, sc.expression) BASIC statement.

_CP_delete_item

Equivalent to the delete expression,string BASIC statement.

_CP_dtx

Equivalent to the result = dtx(expression) BASIC statement.

_CP_ebcdic

Equivalent to the result = ebcdic(string) BASIC statement.

_CP_echo

Equivalent to the echo expression BASIC statement.

_CP_execute

Equivalent to the execute command capturing string1 returning string2 BASIC statement.

_CP_extract

Equivalent to the result = extract(string, ac.expression, vc.expression, sc.expression) BASIC statement.

_CP_field

Equivalent to the result = field(string1, string2, expression) BASIC statement.

_CP_field_store

Equivalent to the result[string2, expression1, expression2] = string1 BASIC statement.

_CP_filelock

Equivalent to the filelock expression BASIC statement.

_CP_fileunlock

Equivalent to the fileunlock expression BASIC statement.

_CP_fold

Equivalent to the result = fold(string1, string2, string3) BASIC statement.

_CP_footing

Equivalent to the footing string BASIC statement.

_CP_get

Equivalent to the get BASIC statement.

_CP_heading

Equivalent to the heading string BASIC statement.

_CP_iconv

Equivalent to the result = iconv(string1, string2) BASIC statement.

_CP_in

Equivalent to the in result for expression BASIC statement.

_CP_index

Equivalent to the result = index(string1, string2, expression) BASIC statement.

_CP_input

Equivalent to the input BASIC statement.

_CP_insert

Equivalent to the result = insert(string1, ac.expression, vc.expression, sc.expression, string2) BASIC statement.

_CP_interrupt

Global C integer which contains the last D3 interrupt that occurred. This value is the same as that returned by the BASIC function system(37).

_CP_is_

Converts an integer into a CPSTR.

_CP_key

Equivalent to the key(string1, expression, string2, string3) BASIC statement.

_CP_load

An optional function for preloading BASIC subroutines, before they are needed.

_CP_locate

Equivalent to the locate BASIC statement.

_CP_lock

Equivalent to the lock BASIC statement.

_CP_logon

Logs in to D3 from a C main program. This function must be called prior to any other function.

_CP_match

Equivalent to the result = string1 match string2 BASIC statement.

_CP_mkstr

Dynamically allocates a CPSTR* and fills it with a copy of cstring.

_CP_mkstrl

Dynamically allocates a CPSTR* of length expression and fills it with a copy of cstring.

_CP_num

Equivalent to the result = num(string) BASIC function.

_CP_occurs

Equivalent to the result = occurs(string, expression) BASIC function.

_CP_oconv

Equivalent to the result = oconv(string1, string2) BASIC statement.

_CP_open

Equivalent to the open string1,string2 to fd BASIC statement.

_CP_out

Equivalent to the out BASIC statement.

_CP_out_msg

Outputs an error message which has been previously queued by _CP_build_msg.

_CP_ovfly_subs

Equivalent to the result[expression1, expression2] = string1 BASIC statement.

_CP_page

Equivalent to the page BASIC statement.

_CP_page_n

Equivalent to the page expression BASIC statement.

_CP_pick_break

Causes all subsequent breaks to push a level or drop into the debugger as is standard in D3.

_CP_pick_env

Sets the application to a standard D3 environment. When using this setting, all terminal input and output must be done via D3 routines only (execute, print, crt).

_CP_precision

Equivalent to the precision number BASIC statement.

_CP_print

Equivalent to the print string BASIC statement.

_CP_printer

Equivalent to the printer expression BASIC statement.

_CP_print_n

Equivalent to the print string BASIC statement.

_CP_print_on

Equivalent to the print on expression BASIC statement.

_CP_prompt

Equivalent to the prompt BASIC statement.

_CP_read

Equivalent to the read, readu and readu locked BASIC statements (depending upon type):

_CP_readnext

Equivalent to the readnext result,value from list BASIC statement.

_CP_readt

Equivalent to the readt BASIC statement.

_CP_readv

Equivalent to the readv BASIC statement.

_CP_release

Equivalent to the release expression,string BASIC statement.

_CP_release_all

Equivalent to the release BASIC statement.

_CP_replace

Equivalent to the result = replace(string1, ac.expression, vc.expression, sc.expression, string2) BASIC statement.

_CP_replace_bridge

Equivalent to the replace expression,string1 with string2 BASIC statement.

_CP_rewind

Equivalent to the rewind BASIC statement.

_CP_root

Equivalent to the root string1, string2 to result BASIC statement.

_CP_rs_

Converts a double floating point number into a CPSTR.

_CP_SADDR

Returns a standard char* pointing to the first character of the string buffer within a CPSTR structure.

_CP_select

Equivalent to the select expression1 to list BASIC statement.

_CP_send

Equivalent to the send{x} string{:} to port.number BASIC statement.

_CP_si_

Converts a CPSTR into an integer.

_CP_sleep

Equivalent to the sleep(string) BASIC statement.

_CP_SLEN

Returns the length of the CPSTR*, string.

_CP_sort

Equivalent to the result = sort(string) BASIC statement.

_CP_soundex

Equivalent to the result = soundex(string, type) BASIC statement.

_CP_space

Equivalent to the result = space(expression) BASIC statement.

_CP_sr_

Converts a CPSTR into a double-float number.

_CP_str

Equivalent to the result = str(string, expression) BASIC statement.

_CP_str0

A static CPSTR* that points to a single character string which contains 0. It should be used for reading only.

_CP_str_alloc

Allocates space for a CPSTR. It is the equivalent of malloc(), but returns a CPSTR*.

_CP_str_copy

Makes a copy of a CPSTR. The actual contents of the string are copied rather than just the pointer.

_CP_str_free

Releases the CPSTR* string back to the string pool to be allocated at a later time.

_CP_str_null

Points to a null length string. It should be used for reading only, to initialize a pointer with a pointer to a null string.

_CP_str_realloc

Reallocates a CPSTR* to a new length.

_CP_substr

Equivalent to the result = string[beg.pos.expression, len.expression] BASIC statement.

_CP_sum

Equivalent to the result = sum(string) BASIC statement.

_CP_system

Equivalent to the result = system(expression) BASIC statement.

_CP_TERM

Terminates a CPSTR* string with a null character.

_CP_time

Equivalent to the result = time() BASIC statement.

_CP_timedate

Equivalent to the result = timedate() BASIC statement.

_CP_trans

Equivalent to one of several BASIC transaction processing statements depending on the op parameter.

_CP_trim

Equivalent to the result = trim(string) BASIC statement.

_CP_unix_break

Causes all subsequent breaks to terminate the process as is standard in UNIX applications.

_CP_unix_env

Sets the application to a standard UNIX environment.

_CP_unlock

Equivalent to the unlock expression BASIC statement.

_CP_unlock_all

Equivalent to the unlock BASIC statement.

_CP_weof

Equivalent to the weof BASIC statement.

_CP_write

Equivalent to the write or writeu BASIC statements.

_CP_writet

Equivalent to the writet BASIC statement.

_CP_writev

Equivalent to the writev and writevu BASIC statements.

_CP_xtd

Equivalent to the result = xtd(string) BASIC statement.