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)
papiAttributeListGetNext(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)
- service context manipulation
cc [ flag… ] file… -lpapi [ library… ] #include <papi.h> papi_status_t papiServiceCreate(papi_service_t *handle, char *service_name, char *user_name, char *password, int (*authCB)(papi_service_t svc, void *app_data), papi_encryption_t encryption, void *app_data);
void papiServiceDestroy(papi_service_t handle);
papi_status_t papiServiceSetUserName(papi_service_t handle, char *user_name);
papi_status_t papiServiceSetPassword(papi_service_t handle, char *password);
papi_status_t papiServiceSetEncryption(papi_service_t handle, papi_encryption_t encryption);
papi_status_t papiServiceSetAuthCB(papi_service_t handle, int (*authCB)(papi_service_t s, void *app_data));
papi_status_t papiServiceSetAppData(papi_service_t handle, void *app_data);
char *papiServiceGetServiceName(papi_service_t handle);
char *papiServiceGetUserName(papi_service_t handle);
char *papiServiceGetPassword(papi_service_t handle);
papi_encryption_t papiServiceGetEncryption(papi_service_t handle);
void *papiServiceGetAppData(papi_service_t handle);
papi_attribute_t **papiServiceGetAttributeList(papi_service_t handle);
char *papiServiceGetStatusMessage(papi_service_t handle);
a set of additional data to be passed to the authCB if/when it is called
a callback routine use to gather additional authentication information on behalf of the print service
whether or not encryption should be used for communication with the print service, where applicable. If PAPI_ENCRYPT_IF_REQUESTED is specified, encryption will be used if the print service requests it. If PAPI_ENCRYPT_NEVER is specified, encryption will not be used while communicating with the print service. If PAPI_ENCRYPT_REQUIRED or PAPI_ENCRYPT_ALWAYS is specified, encryption will be required while communicating with the print service
a pointer to a handle to be used for all libpapi operations. This handle should be initialized to NULL prior to creation
a plain text password to be used during any required user authentication with the print service function set with papiServiceSetAuthCB(). This provides the callback function a means of interrogating the service context for user information and setting a password.
the service context passed into the the authentication callback
the name of a print service to contact. This can be NULL, a print service name like “lpsched”, a resolvable printer name, or a printer-uri like ipp://server/printers/queue.
a handle (service context) used by subsequent PAPI calls to keep/pass information across PAPI calls. It generally contains connection, state, and authentication information.
the name of the user to act on behalf of while contacting the print service. If a value of NULL is used, the user name associated with the current processes UID will be used. Specifying a user name might require further authentication with the print service.
The papiServiceCreate() function creates a service context for use in subsequent calls to libpapi functions. The context is returned in the handle argument. This context must be destroyed using papiServiceDestroy() even if the papiServiceCreate() call failed.
The papiServiceSet*() functions modifies the requested value in the service context passed in. It is recommended that these functions be avoided in favor of supplying the information when the context is created.
The papiServiceGetStatusMessage() function retrieves a detailed error message associated with the service context. This message will apply to the last failed operation.
The remaining papiServiceGet*() functions return the requested information associated with the service context. A value of NULL indicates that the requested value was not initialized or is unavailable.
Upon successful completion, papiServiceCreate() and the papiServiceSet*() functions return PAPI_OK. Otherwise, they return an appropriate papi_status_t indicating the type of failure.
Upon successful completion, the papiServiceGet*() functions return a pointer to the requested data. Otherwise, they return NULL.
Example 1 Create a PAPI service context.
/* * program to create a PAPI service context. */ #include <stdio.h> #include <papi.h> static int authCB(papi_service_t svc, void *app_data) { char prompt[BUFSIZ]; char *user, *svc_name, *passphrase; /* get the name of the service we are contacting */ if ((svc_name = papiServiceGetServiceName(svc)) == NULL) return (-1); /* find out who we are supposed to be */ if ((user = papiServiceGetUserName(svc)) == NULL) { struct passwd *pw; if ((pw = getpwuid(getuid())) != NULL) user = pw->pw_name; else user = "nobody"; } /* build the prompt string */ snprintf(prompt, sizeof (prompt), gettext("passphrase for %s to access %s: "), user, svc_name); /* ask for the passphrase */ if ((passphrase = getpassphrase(prompt)) != NULL) papiServiceSetPassword(svc, passphrase); return (0); } /*ARGSUSED*/ int main(int ac, char *av[]) { char buf[BUFSIZ]; papi_status_t status; papi_service_t *svc = NULL; status = papiServiceCreate(&svc, av[1], NULL, NULL, authCB, PAPI_ENCRYPT_NEVER, NULL); if (status != PAPI_OK) { /* do something */ } else printf("Failed(%s): %s: %s\n", av[1], papiStatusString(status), papiStatusMessage(svc)); papiServiceDestroy(svc); }
See attributes(5) for descriptions of the following attributes:
|