Skip Navigation Links | |
Exit Print View | |
man pages section 3: Extended Library Functions, Volume 1 Oracle Solaris 11.1 Information Library |
Extended Library Functions, Volume 1
CIRCLEQ_HEAD_INITIALIZER(3EXT)
cpc_walk_generic_events_all(3CPC)
cpc_walk_generic_events_pic(3CPC)
ct_dev_status_get_aset(3CONTRACT)
ct_dev_status_get_dev_state(3CONTRACT)
ct_dev_status_get_minor(3CONTRACT)
ct_dev_status_get_noneg(3CONTRACT)
ct_dev_tmpl_clear_noneg(3CONTRACT)
ct_dev_tmpl_get_aset(3CONTRACT)
ct_dev_tmpl_get_minor(3CONTRACT)
ct_dev_tmpl_get_noneg(3CONTRACT)
ct_dev_tmpl_set_aset(3CONTRACT)
ct_dev_tmpl_set_minor(3CONTRACT)
ct_dev_tmpl_set_noneg(3CONTRACT)
ct_event_read_critical(3CONTRACT)
ct_pr_event_get_exitstatus(3CONTRACT)
ct_pr_event_get_gcorefile(3CONTRACT)
ct_pr_event_get_pcorefile(3CONTRACT)
ct_pr_event_get_pid(3CONTRACT)
ct_pr_event_get_ppid(3CONTRACT)
ct_pr_event_get_sender(3CONTRACT)
ct_pr_event_get_senderct(3CONTRACT)
ct_pr_event_get_signal(3CONTRACT)
ct_pr_event_get_zcorefile(3CONTRACT)
ct_pr_status_get_contracts(3CONTRACT)
ct_pr_status_get_fatal(3CONTRACT)
ct_pr_status_get_members(3CONTRACT)
ct_pr_status_get_param(3CONTRACT)
ct_pr_status_get_svc_aux(3CONTRACT)
ct_pr_status_get_svc_creator(3CONTRACT)
ct_pr_status_get_svc_ctid(3CONTRACT)
ct_pr_status_get_svc_fmri(3CONTRACT)
ct_pr_tmpl_get_fatal(3CONTRACT)
ct_pr_tmpl_get_param(3CONTRACT)
ct_pr_tmpl_get_svc_aux(3CONTRACT)
ct_pr_tmpl_get_svc_fmri(3CONTRACT)
ct_pr_tmpl_get_transfer(3CONTRACT)
ct_pr_tmpl_set_fatal(3CONTRACT)
ct_pr_tmpl_set_param(3CONTRACT)
ct_pr_tmpl_set_svc_aux(3CONTRACT)
ct_pr_tmpl_set_svc_fmri(3CONTRACT)
ct_pr_tmpl_set_transfer(3CONTRACT)
ct_status_get_cookie(3CONTRACT)
ct_status_get_critical(3CONTRACT)
ct_status_get_holder(3CONTRACT)
ct_status_get_informative(3CONTRACT)
ct_status_get_nevents(3CONTRACT)
ct_status_get_nevid(3CONTRACT)
ct_status_get_ntime(3CONTRACT)
ct_status_get_qtime(3CONTRACT)
ct_status_get_state(3CONTRACT)
ct_status_get_zoneid(3CONTRACT)
ct_tmpl_get_critical(3CONTRACT)
ct_tmpl_get_informative(3CONTRACT)
ct_tmpl_set_critical(3CONTRACT)
ct_tmpl_set_informative(3CONTRACT)
dat_evd_clear_unwaitable(3DAT)
dat_get_consumer_context(3DAT)
dat_registry_add_provider(3DAT)
dat_registry_list_providers(3DAT)
dat_registry_remove_provider(3DAT)
dat_set_consumer_context(3DAT)
devid_deviceid_to_nmlist(3DEVID)
di_link_next_by_lnode(3DEVINFO)
di_link_next_by_node(3DEVINFO)
di_lnode_private_get(3DEVINFO)
di_lnode_private_set(3DEVINFO)
di_minor_private_get(3DEVINFO)
di_minor_private_set(3DEVINFO)
di_path_client_devfs_path(3DEVINFO)
di_path_client_next_path(3DEVINFO)
di_path_phci_next_path(3DEVINFO)
di_path_prop_lookup_bytes(3DEVINFO)
di_path_prop_lookup_int64s(3DEVINFO)
di_path_prop_lookup_ints(3DEVINFO)
di_path_prop_lookup_strings(3DEVINFO)
di_path_prop_strings(3DEVINFO)
di_prom_prop_lookup_bytes(3DEVINFO)
di_prom_prop_lookup_ints(3DEVINFO)
di_prom_prop_lookup_strings(3DEVINFO)
di_prop_lookup_bytes(3DEVINFO)
di_prop_lookup_int64(3DEVINFO)
di_prop_lookup_strings(3DEVINFO)
ea_match_object_catalog(3EXACCT)
- auto encoding finder functions
cc [ flag ... ] file... -lauto_ef [ library... ] #include <auto_ef.h> size_t auto_ef_file(auto_ef_t **info, const char *filename, int flags);
size_t auto_ef_str(auto_ef_t **info, const char *buffer, size_t bufsize, int flags);
void auto_ef_free(auto_ef_t *info);
char *auto_ef_get_encoding(auto_ef_t info);
double auto_ef_get_score(auto_ef_t info);
Auto encoding finder provides functions that find the encoding of given file or string.
The auto_ef_file() function examines text in the file specified with filename and returns information on possible encodings.
The info argument is a pointer to a pointer to an auto_ef_t, the location at which the pointer to the auto_ef_t array is stored upon return.
The flags argument specifies the level of examination. Currently only one set of flags, exclusive each other, is available: AE_LEVEL_0, AE_LEVEL_1, AE_LEVEL_2, and AE_LEVEL_3. The AE_LEVEL_0 level is fastest but the result can be less accurate. The AE_LEVEL_3 level produces best result but can be slow. If the flags argument is unspecified, the default is AE_LEVEL_0. When another flag or set of flags are defined in the future, use the inclusive-bitwise OR operation to specify multiple flags.
Information about encodings are stored in data typeauto_ef_t in the order of possibility with the most possible encoding stored first. To examine the information, use the auto_ef_get_encoding() and auto_ef_get_score() access functions. For a list of encodings with which auto_ef_file() can examine text, see auto_ef(1).
If auto_ef_file() cannot determine the encoding of text, it returns 0 and stores NULL at the location pointed by info.
The auto_ef_get_encoding() function returns the name of the encoding. The returned string is vaild until until the location pointed to by info is freed with auto_ef_free(). Applications should not use free(3C) to free the pointer returned by auto_ef_get_encoding().
The auto_ef_get_score() function returns the score of this encoding in the range between 0.0 and 1.0.
The auto_ef_str() function is identical to auto_ef_file(), except that it examines text in the buffer specified by buffer with a maximum size of bufsize bytes, instead of text in a file.
The auto_ef_free() function frees the area allocated by auto_ef_file() or by auto_ef_str(), taking as its argument the pointer stored at the location pointed to by info.
Upon successful completion, the auto_ef_file() and auto_ef_str() functions return the number of possible encodings for which information is stored. Otherwise, -1 is returned.
The auto_ef_get_encoding() function returns the string that stores the encoding name.
the auto_ef_get_score() function returns the score value for encoding the name with the examined text data.
The auto_ef_file() and auto_ef_str() will fail if:
Search permission is denied on a component of the path prefix, the file exists and the permissions specified by mode are denied, the file does not exist and write permission is denied for the parent directory of the file to be created, or libauto_ef cannot find the internal hashtable.
A signal was caught during the execution.
Failed to allocate area to store the result.
Too many files descriptors are currently open in the calling process.
Too many files are currently open in the system.
Example 1 Specify the array index to examine stored information.
Since auto_ef_file() stores the array whose elements hold information on each possible encoding, the following example specifies the array index to examine the stored information.
#include <auto_ef.h> auto_ef_t *array_info; size_t number; char *encoding; number = auto_ef_file(&array_info, filename, flags); encoding = auto_ef_get_encoding(array_info[0]); auto_ef_free(array_info);
See attributes(5) for descriptions of the following attributes:
|