Skip Navigation Links | |
Exit Print View | |
man pages section 3: Extended Library Functions, Volume 3 Oracle Solaris 11 Information Library |
Extended Library Functions, Volume 3
nvlist_add_boolean_array(3NVPAIR)
nvlist_add_boolean_value(3NVPAIR)
nvlist_add_byte_array(3NVPAIR)
nvlist_add_int16_array(3NVPAIR)
nvlist_add_int32_array(3NVPAIR)
nvlist_add_int64_array(3NVPAIR)
nvlist_add_int8_array(3NVPAIR)
nvlist_add_nvlist_array(3NVPAIR)
nvlist_add_string_array(3NVPAIR)
nvlist_add_uint16_array(3NVPAIR)
nvlist_add_uint32_array(3NVPAIR)
nvlist_add_uint64_array(3NVPAIR)
nvlist_add_uint8_array(3NVPAIR)
nvlist_lookup_boolean(3NVPAIR)
nvlist_lookup_boolean_array(3NVPAIR)
nvlist_lookup_boolean_value(3NVPAIR)
nvlist_lookup_byte_array(3NVPAIR)
nvlist_lookup_int16_array(3NVPAIR)
nvlist_lookup_int32_array(3NVPAIR)
nvlist_lookup_int64_array(3NVPAIR)
nvlist_lookup_int8_array(3NVPAIR)
nvlist_lookup_nv_alloc(3NVPAIR)
nvlist_lookup_nvlist_array(3NVPAIR)
nvlist_lookup_string_array(3NVPAIR)
nvlist_lookup_uint16_array(3NVPAIR)
nvlist_lookup_uint32_array(3NVPAIR)
nvlist_lookup_uint64_array(3NVPAIR)
nvlist_lookup_uint8_array(3NVPAIR)
nvpair_value_boolean_array(3NVPAIR)
nvpair_value_boolean_value(3NVPAIR)
nvpair_value_byte_array(3NVPAIR)
nvpair_value_int16_array(3NVPAIR)
nvpair_value_int32_array(3NVPAIR)
nvpair_value_int64_array(3NVPAIR)
nvpair_value_int8_array(3NVPAIR)
nvpair_value_nvlist_array(3NVPAIR)
nvpair_value_string_array(3NVPAIR)
nvpair_value_uint16_array(3NVPAIR)
nvpair_value_uint32_array(3NVPAIR)
nvpair_value_uint64_array(3NVPAIR)
nvpair_value_uint8_array(3NVPAIR)
papiAttributeListAddBoolean(3PAPI)
papiAttributeListAddCollection(3PAPI)
papiAttributeListAddDatetime(3PAPI)
papiAttributeListAddInteger(3PAPI)
papiAttributeListAddMetadata(3PAPI)
papiAttributeListAddRange(3PAPI)
papiAttributeListAddResolution(3PAPI)
papiAttributeListAddString(3PAPI)
papiAttributeListAddValue(3PAPI)
papiAttributeListDelete(3PAPI)
papiAttributeListFromString(3PAPI)
papiAttributeListGetBoolean(3PAPI)
papiAttributeListGetCollection(3PAPI)
papiAttributeListGetDatetime(3PAPI)
papiAttributeListGetInteger(3PAPI)
papiAttributeListGetMetadata(3PAPI)
papiAttributeListGetRange(3PAPI)
papiAttributeListGetResolution(3PAPI)
papiAttributeListGetString(3PAPI)
papiAttributeListGetValue(3PAPI)
papiAttributeListToString(3PAPI)
papiJobGetAttributeList(3PAPI)
papiJobSubmitByReference(3PAPI)
papiLibrarySupportedCall(3PAPI)
papiLibrarySupportedCalls(3PAPI)
papiPrinterGetAttributeList(3PAPI)
papiServiceGetAttributeList(3PAPI)
papiServiceGetEncryption(3PAPI)
papiServiceGetServiceName(3PAPI)
papiServiceGetStatusMessage(3PAPI)
papiServiceSetEncryption(3PAPI)
picld_plugin_register(3PICLTREE)
picl_get_frutree_parent(3PICL)
picl_get_propinfo_by_name(3PICL)
picl_get_propval_by_name(3PICL)
picl_set_propval_by_name(3PICL)
picl_walk_tree_by_class(3PICL)
pool_get_owning_resource(3POOL)
pool_get_resource_binding(3POOL)
pool_query_pool_resources(3POOL)
pool_query_resource_components(3POOL)
pool_resource_type_list(3POOL)
pool_resource_xtransfer(3POOL)
ptree_add_row_to_table(3PICLTREE)
ptree_create_and_add_node(3PICLTREE)
ptree_create_and_add_prop(3PICLTREE)
ptree_get_first_prop(3PICLTREE)
ptree_get_frutree_parent(3PICLTREE)
ptree_get_next_by_col(3PICLTREE)
ptree_get_next_by_row(3PICLTREE)
ptree_get_next_prop(3PICLTREE)
ptree_get_node_by_path(3PICLTREE)
ptree_get_prop_by_name(3PICLTREE)
ptree_get_propinfo_by_name(3PICLTREE)
ptree_get_propval_by_name(3PICLTREE)
ptree_init_propinfo(3PICLTREE)
ptree_register_handler(3PICLTREE)
ptree_unregister_handler(3PICLTREE)
ptree_update_propval(3PICLTREE)
ptree_update_propval_by_name(3PICLTREE)
- manage PAPI attribute lists
cc [ flag… ] file… -lpapi [ library… ] #include <papi.h> papi_status_t papiAttributeListAddValue(papi_attribute_t ***attrs, int flags, char *name, papi_attribute_value_type_t type, papi_attribute_value_t *value);
papi_status_t papiAttributeListAddString(papi_attribute_t ***attrs, int flags, char *name, char *string);
papi_status_t papiAttributeListAddInteger(papi_attribute_t ***attrs, int flags, char *name, int integer);
papi_status_t papiAttributeListAddBoolean(papi_attribute_t ***attrs, int flags, char *name, char boolean);
papi_status_t papiAttributeListAddRange(papi_attribute_t ***attrs, int flags, char *name, int lower, int upper);
papi_status_t papiAttributeListAddResolution(papi_attribute_t ***attrs, int flags, char *name, int xres, int yres, papi_resolution_unit_t units);
papi_status_t papiAttributeListAddDatetime(papi_attribute_t ***attrs, int flags, char *name, time_t datetime);
papi_status_t papiAttributeListAddCollection(papi_attribute_t ***attrs, int flags, char *name, papi_attribute_t **collection);
papi_status_t papiAttributeListAddMetadata(papi_attribute_t ***attrs, int flags, char *name, papi_metadata_t metadata);
papi_status_t papiAttributeListDelete(papi_attribute_t ***attributes, char *name);
papi_status_t papiAttributeListGetValue(papi_attribute_t **list, void **iterator, char *name, papi_attribute_value_type_t type, papi_attribute_value_t **value);
papi_status_t papiAttributeListGetString(papi_attribute_t **list, void **iterator, char *name, char **vptr);
papi_status_t papiAttributeListGetInteger(papi_attribute_t **list, void **iterator, char *name, int *vptr);
papi_status_t papiAttributeListGetBoolean(papi_attribute_t **list, void **iterator, char *name, char *vptr);
papi_status_t papiAttributeListGetRange(papi_attribute_t **list, void **iterator, char *name, int *min, int *max);
papi_status_t papiAttributeListGetResolution(papi_attribute_t **list, void **iterator, char *name, int *x, int *y, papi_resolution_unit_t *units);
papi_status_t papiAttributeListGetDatetime(papi_attribute_t **list, void **iterator, char *name, time_t *dt);
papi_status_t papiAttributeListGetCollection(papi_attribute_t **list, void **iterator, char *name, papi_attribute_t ***collection);
papi_status_t papiAttributeListGetMetadata(papi_attribute_t **list, void **iterator, char *name, papi_metadata_t *vptr);
papi_attribute_t *papiAttributeListFind(papi_attribute_t **list, char *name);
papi_attribute_t *papiAttributeListGetNext(papi_attribute_t **list, void **iterator);
void papiAttributeListFree(papi_attribute_t **attributes);
papi_status_t papiAttributeListFromString(papi_attribute_t ***attrs, int flags, char *string);
papi_status_t papiAttributeListToString(papi_attribute_t **attrs, char *delim, char *buffer, size_t buflen);
address of array of pointers to attributes
a list of attributes (of type papi_attribute_t **) contained in a collection. Lists can be hierarchical.
boolean value (PAPI_TRUE or PAPI_FALSE)
buffer to fill
length of supplied buffer
list of attributes
attribute time value specified in time_t representation
delimiter used in construction of a string representation of an attribute list
date and time represented as a time_t
Specify bit fields defining how actions will be performed:
Free any existing value(s) and replace it with the supplied value(s).
Add the supplied value to the attribute.
Add the supplied value to the attribute, if the attribute was not previously defined.
integer value
iterator for enumerating multiple values of multi-value attributes
array of pointers to attributes (attribute list)
lower bound for a range of integer
maximum value in a range
pseudo-values for specialized attributes PAPI_UNSUPPORTED, PAPI_DEFAULT, PAPI_UNKNOWN, PAPI_NO_VALUE, PAPI_NOT_SETTABLE, PAPI_DELETE
minimum value in a range
attribute name
string value
attribute type (PAPI_STRING, PAPI_INTEGER, PAPI_BOOLEAN, PAPI_RANGE, PAPI_RESOLUTION, PAPI_DATETIME, PAPI_COLLECTION, PAPI_METADATA)
resolution unit of measure (PAPI_RES_PER_INCH or PAPI_RES_PER_CM)
upper bound for a range of integer
attribute value
pointer to arbitrary data
horizontal (x) resolution
horizontal (x) component of a resolution
vertical (y) resolution
vertical (y) component of a resolution
The papiAttributeListAdd*() functions add new attributes and/or values to the attribute list passed in. If necessary, the attribute list passed in is expanded to contain a new attribute pointer for any new attributes added to the list. The list is null-terminated. Space for the new attributes and values is allocated and the name and value are copied into this allocated space.
If PAPI_ATTR_REPLACE is specified in flags, any existing attribute values are freed and replaced with the supplied value.
If PAPI_ATTR_APPEND is specified, the supplied value is appended to the attribute's list of values.
If PAPI_ATTR_EXCL is specified, the operation succeeds only if the attribute was not previously defined.
The papiAttributeListGet*() functions retrieve an attribute value from an attribute list. If the attribute is a multi-valued attribute, the first call to retrieve a value should pass in an iterator and attribute name. Subsequent calls to retrieve additional values should pass in the iterator and a null value for the attribute name. If a single-valued attribute is to be retrieved, NULL can be used in place of the iterator.
Upon successful completion of a get operation, the value passed in (string, integer, boolean, ...) is changed to the value from the attribute list. If the operation fails for any reason (type mismatch, not found, ...), the value passed in remains untouched.
The resulting value returned from a get operation is returned from the attribute list's allocated memory. It is not guaranteed to be available after the attribute list has been freed.
The papiAttributeListDelete() function removes an attribute from a supplied list.
The papiAttributeListFind() function allows an application to retrieve an entire attribute structure from the passed-in attribute list.
The papiAttributeListGetNext() function allows an application to walk through an attribute list returning subsequent attributes from the list. With the first call, the iterator should be initialized to NULL and subsequent calls should use NULL for the list argument.
The papiAttributeListFree() function deallocates all memory associated with an attribute list, including values that might have been retrieved previously using papiAttributeListGet*() calls.
The papiAttributeListFromString() function takes in a string representation of a set of attributes, parses the string and adds the attributes to the passed in attribute list using the flags to determine how to add them. String values are specified with “key=value”. Integer values are specified with “key=number”. Boolean values are specified with either “key=(true|false)” or “[no]key”. Multiple attributes can be specified in the string by separating them with a whitespace character.
The papiAttributeListToString() function converts an attribute list to a string representation that can be displayed to a user. The delimiter value is placed between attributes in the string.
These functions return PAPI_OK upon successful completion and one of the following on failure:
The supplied arguments were not valid.
There was an attribute type mismatch.
The requested attribute could not be found.
The requested operation could not be performed due to buffer overflow.
Memory could not be allocated to add to the attribute list.
Example 1 The following example manipulates a PAPI attribute list.
/* * program to manipulate a PAPI attribute list */ #include <stdio.h> #include <papi.h> /*ARGSUSED*/ int main(int ac, char *av[]) { char buf[BUFSIZ]; papi_status_t status; papi_attribute_t **list = NULL; void *iter = NULL; char *string = NULL; int32_t integer = 0; /* build an attribute list */ (void) papiAttributeListAddString(&list, PAPI_ATTR_EXCL, "job-title", "example"); (void) papiAttributeListAddInteger(&list, PAPI_ATTR_EXCL, "copies", 1); (void) papiAttributeListFromString(&list, PAPI_ATTR_REPLACE, av[1]); status = papiAttributeListAddString(&list, PAPI_ATTR_EXCL, "document-format", "text/plain"); if (status != PAPI_OK) printf("failed to set document-format to text/plain: %s\n", papiStatusString(status)); /* dump the list */ status = papiAttributeListToString(list, "\n\t", buf, sizeof (buf)); if (status == PAPI_OK) printf("Attributes: %s\n", buf); else printf("Attribute list to big to dump\n"); /* retreive various elements */ integer = 12; (void) papiAttributeListGetInteger(list, NULL, "copies", &integer); printf("copies: %d\n", integer); string = NULL; for (status = papiAttributeListGetString(list, &oter, "job-files", &string); status == PAPI_OK; status = papiAttributeListGetString(list, &iter, NULL, &string)) printf("file: %s\n", string); papiAttributeListFree(list); }
See attributes(5) for descriptions of the following attributes:
|