gtpc2m87 | C/C++ Language Support User's Guide |
This function is used to generate data item lists to be used with
event-type or sipcc function requests. A data item list is
used to identify a list of items associated with a particular event or a list
of destination processor ordinal numbers.
Format
#include <tpfapi.h>
int tpf_genlc(void *list_ptr,
enum t_genlc_fmt type,
enum t_genlc_fmt func,
enum t_genlc_opts data,
enum t_genlc_opts options,
void *data_ptr,
unsigned short count,
unsigned short size,
long int retvalue);
- list_ptr
- A pointer to the storage area where the data item list is to be
returned. The specified value of the type parameter
determines if the storage area is either a struct
tpf_ev0bk_list_data defined area or a user-defined area.
- type
- Specifies whether the data item list is defined by struct
tpf_ev0bk_list_data or is user-defined. Valid types are:
- TPF_GENLC_BLOCK
- Indicates that the area pointed to by the list_ptr parameter is
defined as struct tpf_ev0bk_list_data. The data list is
returned at location list_ptr->evnblki.
- TPF_GENLC_AREA
- Indicates that the area pointed to by the list_ptr parameter is
a user-defined area. The data list is returned at the start of the
user-defined data area.
- func
- Specifies the operation to perform. Valid operations are:
- TPF_GENLC_CREATE
- Create a new data item list by using the parameters specified.
- TPF_GENLC_MODIFY
- Modify an existing data item list by using parameters specified.
- data
- Specifies the type of data contained in the data items. Valid types
are:
- TPF_GENLC_PROCESSOR
- Indicates that the data items are processor ordinal numbers as defined in
processor ID table struct pi1dt in C header file
c$pi1dt. The count and size parameters
are not valid when this data type is specified. The count is determined
by the option specified for the options parameter and the size is
fixed.
- TPF_GENLC_POINTER
- Specifies the address where data items can be found. This data type
requires that you also specify the count and size
parameters.
- options
- Specifies how the data items identified by the data parameter
are to be processed against the data item list pointed to by the
list_ptr parameter. Valid options are:
- TPF_GENLC_INCLUDE_ALL
- Include or add all of the specified data items to the list.
- TPF_GENLC_INCLUDE_ACTIVE
- Include or add only active processor ordinal numbers to the data
list.
- TPF_GENLC_INCLUDE_INACTIVE
- Include or add only inactive processor ordinal numbers to the data
list.
- TPF_GENLC_EXCLUDE_ALL
- Exclude or remove all of the specified data items from the list.
- TPF_GENLC_EXCLUDE_ACTIVE
- Exclude or remove only active processor ordinal numbers from the data
list.
- TPF_GENLC_EXCLUDE_INACTIVE
- Exclude or remove only inactive processor ordinal numbers from the data
list.
- Note:
- The options that contain _ACTIVE or _INACTIVE are valid
only when you specify TPF_GENLC_PROCESSOR for the data
parameter. These options do not include or exclude the originating
processor.
- data_ptr
- A pointer to the address where data items can be found when you specify
TPF_GENLC_POINTER for the data parameter;
otherwise, specify a value of 0.
- count
- Specifies the count of input data items at the location specified in the
data_ptr parameter when you specify TPF_GENLC_POINTER
for the data parameter; otherwise, specify a value of
0.
- size
- Specifies the size, from 1 to 250 bytes, of input data items at the
location specified in the data_ptr parameter when you specify
TPF_GENLC_POINTER for the data parameter;
otherwise, specify a value of 0.
- retvalue
- Specifies a 4-byte return value to be built into the specified list
items. This parameter is valid only when you specify
TPF_GENLC_POINTER for the data parameter. If a
return value is indicated, it is built into one or more list data items as
specified in the count parameter.
Normal Return
An integer value of 0.
- If you specify TPF_GENLC_BLOCK for the type
parameter, the data items are returned in struct
tpf_ev0bk_list_data at list_ptr->evnbkli.
- If you specify TPF_GENLC_AREA for the type
parameter, the data list is returned at the beginning of the
list_ptr parameter.
Error Return
If unsuccessful, there is no return to the application. The system
ends the application and a system error dump occurs.
Programming Considerations
- This function uses information from processor ID table struct
pi1dt when working with processor lists.
- The ev0bk and tpf_ev0bk_data_list structures
describe the user area that is used as a parameter to the following C
functions:
- evnqc
- evntc
- evnwc
- postc
- tpf_genlc
- tpf_sawnc.
Examples
The following example builds a processor data list in the event block that
consists of only active processors.
#include <tpfeq.h>
#include <tpfapi.h>
struct tpf_ev0bk_list_data event_blk;
enum t_evn_typ event_type = EVENT_LIST;
char caller_provided_name;
int event_timeout;
enum t_state event_state;
enum t_genlc_fmt func = TPF_GENLC_CREATE;
enum t_genlc_fmt type = TPF_GENLC_BLOCK;
enum t_genlc_data data = TPF_GENLC_PROCESSOR;
enum t_genlc_data options = TPF_GENLC_INCLUDE_ALL;
·
·
·
tpf_genlc(&event_blk,type,func,data, options,0,0,0,0) ;
evntc(&event_blk, event_type, caller_provided_name, event_timeout
event_state) ;
evnwc(&event_blk, event_type) ;
·
·
·
Related Information