1 /* ====== BEGIN INCLUDE SEGMENT         apl_external_function.incl.pl1 ============================ */
 2 
 3 /* This include segment contains all of the Version 2 apl declarations necessary for an external apl
 4    function to interface to apl. */
 5 
 6 /* automatic */
 7 
 8 declare   data_elements fixed binary (21);        /* number of elements for arrays */
 9 
10 /* entries */
11 
12 declare   apl_allocate_words_ entry (fixed binary (19), unaligned pointer);
13                     /* param 1          (input)   number of words to allocate */
14                     /* param 2          (output)  word-aligned packed pointer to allocated bead,
15                                                   with general_bead.size and general_bead.reference_count set. */
16 
17 declare   apl_free_words_ entry (fixed binary (19), unaligned pointer);
18                     /* param 1          (input)   number of words to free */
19                     /* param 2          (input)   word-aligned packed pointer to bead to be freed. */
20 
21 declare   apl_free_bead_ entry (unaligned pointer);
22                     /* param 1          (input)   word-aligned packed pointer to bead to be freed. */
23                     /*                            if reference count is non-zero, a system error will result. */
24 
25 declare   apl_get_value_stack_ entry (fixed binary (19));
26                     /* param 1          (input)   number of words needed in a value stack. */
27                     /* (implicit)       (output)  sets ws_info.value_stack_ptr to point to new value stack. */
28 
29 declare   apl_subsystem_ entry (fixed bin (35), bit (*) aligned, char (*), char (*), char (*), char (*),
30                     fixed bin (35));
31                     /* param 1          (input)   user number */
32                     /* param 2          (input)   control switches (1 like ws_info.switches) */
33                     /* param 3          (input)   initial ws pathname */
34                     /* param 4          (input)   terminal conversion table to use */
35                     /* param 5          (output)  user-specified signoff lock ("*" = no lock) */
36                     /* param 6          (output)  0 = normal termination,
37                                                   apl_error_table_$off_hold = )OFF HOLD,
38                                                   apl_error_table_$cant_load_ws = could not load initial ws */
39 
40 declare   apl_system_error_ entry (fixed bin (35));
41                     /* param 1          (input)   status code of error to be printed. */
42                     /*                            system errors will not return to caller. */
43 
44 /* external static */
45 
46 declare   (apl_error_table_$cant_load_ws,         /* status code returned by apl_subsystem_ if ws not found */
47           apl_error_table_$domain,                /* status code for DOMAIN ERROR */
48           apl_error_table_$function,              /* status code for FUNCTION ERROR - IN EXTERNAL FUNCTION */
49           apl_error_table_$index,                 /* status code for INDEX ERROR */
50           apl_error_table_$length,                /* status code for LENGTH ERROR */
51           apl_error_table_$no_type_bits,          /* status code for SYSTEM ERROR - VALUE HAS NO TYPE BITS */
52           apl_error_table_$rank,                  /* status code for RANK ERROR */
53           apl_error_table_$result_size,           /* status code for RESULT SIZE ERROR - OBJECT WOULD BE LARGER THAN A SEGMENT */
54           apl_error_table_$system_error,          /* status code for SYSTEM ERROR */
55           apl_error_table_$off_hold)              /* status code returned by apl_subsystem_ after )OFF HOLD */
56           fixed binary (35) external static;
57 
58 /* include files */
59 
60 %include apl_number_data;
61 %include apl_ws_info;
62 %include apl_bead_format;
63 %include apl_value_bead;
64 %include apl_operators_argument;
65 
66 /* ------ END INCLUDE SEGMENT           apl_external_function.incl.pl1 ---------------------------- */