iPXE
Functions
string.h File Reference

String functions. More...

#include <stddef.h>
#include <bits/string.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
void * generic_memset (void *dest, int character, size_t len) __nonnull
 Fill memory region.
void * generic_memcpy (void *dest, const void *src, size_t len) __nonnull
 Copy memory region.
void * generic_memmove (void *dest, const void *src, size_t len) __nonnull
 Copy (possibly overlapping) memory region.
void * memset (void *dest, int character, size_t len) __nonnull
void * memcpy (void *dest, const void *src, size_t len) __nonnull
void * memmove (void *dest, const void *src, size_t len) __nonnull
int __pure memcmp (const void *first, const void *second, size_t len) __nonnull
 Compare memory regions.
void *__pure memchr (const void *src, int character, size_t len) __nonnull
 Find character within a memory region.
void * memswap (void *dest, void *src, size_t len) __nonnull
 Swap memory regions.
int __pure strcmp (const char *first, const char *second) __nonnull
 Compare strings.
int __pure strncmp (const char *first, const char *second, size_t max) __nonnull
 Compare strings.
size_t __pure strlen (const char *src) __nonnull
 Get length of string.
size_t __pure strnlen (const char *src, size_t max) __nonnull
 Get length of string.
char *__pure strchr (const char *src, int character) __nonnull
 Find character within a string.
char *__pure strrchr (const char *src, int character) __nonnull
 Find rightmost character within a string.
char *__pure strstr (const char *haystack, const char *needle) __nonnull
 Find substring.
char * strcpy (char *dest, const char *src) __nonnull
 Copy string.
char * strncpy (char *dest, const char *src, size_t max) __nonnull
 Copy string.
char * strcat (char *dest, const char *src) __nonnull
 Concatenate string.
char *__malloc strdup (const char *src) __nonnull
 Duplicate string.
char *__malloc strndup (const char *src, size_t max) __nonnull
 Duplicate string.
char *__pure strpbrk (const char *string, const char *delim) __nonnull
 strpbrk - Find the first occurrence of a set of characters : The string to be searched : The characters to search for
char * strsep (char **string, const char *delim) __nonnull
 strsep - Split a string into tokens : The string to be searched : The characters to search for
char *__pure strerror (int errno)
 Retrieve string representation of error number.

Detailed Description

String functions.

Definition in file string.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
void* generic_memset ( void *  dest,
int  character,
size_t  len 
)

Fill memory region.

Parameters:
destDestination region
characterFill character
lenLength
Return values:
destDestination region

Definition at line 46 of file string.c.

References dest.

                                                                {
        uint8_t *dest_bytes = dest;

        while ( len-- )
                *(dest_bytes++) = character;
        return dest;
}
void* generic_memcpy ( void *  dest,
const void *  src,
size_t  len 
)

Copy memory region.

Parameters:
destDestination region
srcSource region
lenLength
Return values:
destDestination region

Definition at line 62 of file string.c.

References dest, and src.

Referenced by generic_memmove().

                                                                  {
        const uint8_t *src_bytes = src;
        uint8_t *dest_bytes = dest;

        while ( len-- )
                *(dest_bytes++) = *(src_bytes++);
        return dest;
}
void* generic_memmove ( void *  dest,
const void *  src,
size_t  len 
)

Copy (possibly overlapping) memory region.

Parameters:
destDestination region
srcSource region
lenLength
Return values:
destDestination region

Definition at line 79 of file string.c.

References dest, generic_memcpy(), and len.

                                                                   {
        const uint8_t *src_bytes = ( src + len );
        uint8_t *dest_bytes = ( dest + len );

        if ( dest < src )
                return generic_memcpy ( dest, src, len );
        while ( len-- )
                *(--dest_bytes) = *(--src_bytes);
        return dest;
}
void* memset ( void *  dest,
int  character,
size_t  len 
)

Referenced by __vxge_hw_fifo_create(), __vxge_hw_vp_initialize(), __vxge_hw_vp_terminate(), _print_label(), a3c90x_probe(), a3c90x_setup_tx_ring(), abft_install(), add_tls(), aes_setkey(), aes_wrap(), alloc_iob_okx(), amd8111e_probe(), amd8111e_transmit(), ansiesc_process(), aoecmd_ata_cmd(), aoecmd_cfg_cmd(), aoecmd_tx(), apply_dns_search(), ar5008_hw_spur_mitigate(), ar9002_hw_spur_mitigate(), ar9003_hw_proc_txdesc(), ar9003_hw_tx_iqcal_load_avg_2_passes(), arbel_alloc_icm(), arbel_cmd(), arbel_complete(), arbel_create_cq(), arbel_create_eq(), arbel_create_qp(), arbel_create_recv_wq(), arbel_create_send_wq(), arbel_destroy_eq(), arbel_dump_cqctx(), arbel_dump_qpctx(), arbel_free_icm(), arbel_ib_open(), arbel_map_vpm(), arbel_mcast_detach(), arbel_modify_qp(), arbel_post_send(), arbel_setup_mpt(), arbel_start(), arp_tx_request(), asn1_generalized_time(), atadev_command(), ath5k_attach(), ath5k_config(), ath5k_desc_alloc(), ath5k_handle_rx(), ath5k_hw_attach(), ath5k_hw_setup_2word_tx_desc(), ath5k_hw_setup_4word_tx_desc(), ath5k_hw_setup_rx_desc(), ath5k_hw_setup_tx_queue(), ath5k_hw_txpower(), ath5k_tx_processq(), ath9k_config(), ath9k_config_bss(), ath9k_hw_4k_set_txpower(), ath9k_hw_ar9287_set_txpower(), ath9k_hw_def_set_txpower(), ath9k_hw_get_gain_boundaries_pdadcs(), ath9k_hw_reset(), ath9k_hw_reset_txstatus_ring(), ath9k_hw_setuprxdesc(), ath9k_hw_setuptxqueue(), ath9k_tx(), ath_buf_set_rate(), ath_descdma_cleanup(), ath_descdma_setup(), ath_draintxq(), ath_get_next_rx_buf(), ath_hw_get_listen_time(), ath_rx_tasklet(), ath_tx_processq(), ath_txq_setup(), ath_update_survey_stats(), atl1e_clean_rx_ring(), atl1e_clean_tx_ring(), atl1e_get_tpd(), atl1e_setup_ring_resources(), axge_probe(), b44_init_rx_ring(), b44_init_tx_ring(), b44_probe(), base64_decode(), bigint_multiply_raw(), bitops_test_exec(), bnx2_alloc_mem(), bnx2_init_rx_ring(), bnx2_probe(), bnx2_transmit(), bofm_test_init(), bzimage_load_initrd(), bzimage_parse_header(), ccmp_cbc_mac(), chap_finish(), cipher_cost(), colour_exec(), cpair_exec(), deflate_alphabet(), deflate_inflate(), deflate_init(), dhcp_create_packet(), dhcppkt_store(), digest_cost(), dm96xx_probe(), dns_copy_fail_okx(), dns_copy_okx(), dns_encode_okx(), draw_editbox(), draw_menu_item(), draw_setting_row(), drbg_uninstantiate(), eapol_key_rx(), ecm_probe(), efab_alloc_resources(), efab_free_resources(), efab_probe(), efi_file_get_info(), efi_file_info(), efi_get_time(), efi_ifr_free(), efi_ifr_init(), efi_ifr_op(), efi_local_open_path(), efi_pxe_ip(), efi_pxe_ip_sockaddr(), efi_pxe_start(), efi_pxe_udp_write(), efi_snp_probe(), efi_snp_statistics(), efi_undi_get_init_info(), efi_undi_get_status(), efi_undi_receive(), efi_undi_station_address(), efi_usb_get_string_descriptor(), efx_hunt_ev_init(), ehci_bus_open(), ehci_ring_alloc(), eisabus_probe(), ena_admin_req(), ena_create_admin(), ena_create_cq(), ena_create_sq(), ena_probe(), enable_multicast(), eth_probe(), eth_slow_lacp_rx(), exanic_probe(), exanic_probe_port(), fbcon_init(), fc_els_echo_tx(), fc_els_flogi_tx(), fc_els_logo_tx(), fc_els_logo_tx_response(), fc_els_plogi_tx(), fc_els_prli_tx(), fc_els_rtv_tx_response(), fc_els_tx(), fc_els_unknown_tx_response(), fc_fill_sockaddr(), fc_ns_query_step(), fc_port_logout(), fc_xchg_rx(), fc_xchg_tx(), fcoe_deliver(), fcoe_fip_parse(), fcoe_fip_tx_keepalive(), fcoe_fip_tx_solicitation(), fcoe_fip_tx_vlan(), fcp_prli_tx(), fcpcmd_recv_rsp(), fcpcmd_send_cmnd(), fcpcmd_send_wrdata(), fetch_next_server_and_filename(), fetch_setting(), fetch_string_setting(), fiber_autoneg(), flexboot_nodnic_complete(), flexboot_nodnic_get_factory_mac(), flexboot_nodnic_is_supported(), fnrec_reset(), format_string_setting(), ftp_open(), gcc_implicit_memset(), gdbudp_send(), get_entropy_input_tmp(), golan_complete(), golan_create_qp_aux(), golan_post_recv(), golan_post_send(), hermon_alloc_mtt(), hermon_bofm_update(), hermon_cmd(), hermon_complete(), hermon_create_cq(), hermon_create_eq(), hermon_create_qp(), hermon_destroy_eq(), hermon_dump_cqctx(), hermon_dump_qpctx(), hermon_eth_open(), hermon_ib_open(), hermon_map_icm(), hermon_map_vpm(), hermon_mcast_detach(), hermon_mod_stat_cfg(), hermon_modify_qp(), hermon_post_send(), hermon_setup_mpt(), hermon_start(), hermon_unmap_icm(), hmac_drbg_instantiate(), hmac_final(), hmac_init(), http_connect(), http_open(), http_tx_request(), hunt_clear_udp_tunnel_ports(), hunt_probe(), hunt_rx_filter_insert(), hv_alloc_pages(), hv_map_synic(), hv_post_message(), hv_signal_event(), hv_wait_for_message(), ib_cached_path_complete(), ib_cm_path_complete(), ib_cm_send_drep(), ib_cm_send_rtu(), ib_create_conn(), ib_create_path(), ib_create_service_madx(), ib_mcast_mad(), ib_pull(), ib_resolve_path(), ib_sma_guid_info(), ib_sma_node_desc(), ib_sma_node_info(), ib_sma_pkey_table(), ib_sma_port_info(), ib_smc_mad(), ib_srp_open_uri(), ibft_alloc_string(), ibft_set_ipaddr(), icplus_create_ring(), icplus_probe(), ifec_pci_probe(), igbvf_probe(), igbvf_process_rx_packets(), igbvf_process_tx_packets(), igbvf_rar_set_vf(), igbvf_setup_rx_resources(), igbvf_setup_tx_resources(), inet6_aton(), init_editbox(), int13_cdrom_status_terminate(), int13_describe(), int13_extended_rw(), int13_get_extended_parameters(), int13con_find(), int13con_putchar(), intel_create_ring(), intel_open(), intel_probe(), intelvf_mbox_reset(), intelvf_mbox_set_mac(), intelvf_mbox_set_mtu(), intelx_open(), intelx_probe(), intelxl_admin_autoneg(), intelxl_admin_driver(), intelxl_admin_link(), intelxl_admin_promisc(), intelxl_admin_shutdown(), intelxl_admin_switch(), intelxl_admin_version(), intelxl_admin_vsi(), intelxl_context_rx(), intelxl_context_tx(), intelxl_create_admin(), intelxl_create_ring(), intelxl_open(), intelxl_probe(), intelxvf_mbox_queues(), intelxvf_mbox_version(), intelxvf_probe(), iob_pad(), ipoib_link_state_changed(), ipoib_probe(), ipoib_translate_rx_arp(), ipoib_translate_tx_arp(), ipoib_transmit(), ipv4_rx(), ipv4_tx(), ipv6_fetch(), ipv6_pshdr_chksum(), ipv6_rx(), ipv6_tx(), isabus_probe(), isapnp_try_isolate(), isapnpbus_probe(), iscsi_open_connection(), iscsi_rx_scsi_response(), iscsi_start_tx(), iscsi_tx_data_out(), iscsi_tx_login_request(), jme_alloc_rx_resources(), jme_alloc_tx_resources(), jme_free_tx_resources(), jme_init_tx_ring(), job_progress(), lan78xx_probe(), legacy_probe(), linda_complete_recv(), linda_create_recv_wq(), linda_fini_send(), linda_ib_epb_read(), linda_ib_epb_release(), linda_ib_epb_request(), linda_ib_epb_write(), linda_init_ib_serdes(), linda_init_recv(), linda_init_send(), linda_poll_eq(), linda_poll_recv_wq(), linda_post_recv(), linda_post_send(), linebuf_init_okx(), main_loop(), mcabus_probe(), memcpy_test_speed(), meme820(), memset_var(), memset_zero_0(), memset_zero_1(), memset_zero_10(), memset_zero_11(), memset_zero_12(), memset_zero_13(), memset_zero_14(), memset_zero_15(), memset_zero_16(), memset_zero_17(), memset_zero_18(), memset_zero_19(), memset_zero_2(), memset_zero_20(), memset_zero_21(), memset_zero_22(), memset_zero_23(), memset_zero_24(), memset_zero_25(), memset_zero_26(), memset_zero_27(), memset_zero_28(), memset_zero_29(), memset_zero_3(), memset_zero_30(), memset_zero_31(), memset_zero_4(), memset_zero_5(), memset_zero_6(), memset_zero_7(), memset_zero_8(), memset_zero_9(), mlx_memory_alloc_dma_priv(), mlx_memory_set_priv(), multiboot_build_memmap(), multiboot_exec(), myri10ge_net_close(), myri10ge_net_open(), myson_create_ring(), myson_open(), myson_probe(), natsemi_create_ring(), natsemi_probe(), ncm_open(), ncm_out_transmit(), ncm_probe(), ndp_rx_neighbour_solicitation_ll_source(), ndp_tx_request(), ndp_tx_router_solicitation(), net80211_ll_push(), netvsc_establish_buffer(), netvsc_initialise(), netvsc_ndis_version(), netvsc_revoke_buffer(), netvsc_transmit(), nfs_connect(), nii_initialise_flags(), nii_issue_cpb_db(), nii_poll(), nii_poll_rx(), nii_set_station_address(), nii_start_undi(), nii_transmit(), ntlm_authenticate(), ntlm_response(), ntp_request(), nv_process_rx_packets(), nv_process_tx_packets(), nvo_load(), oncrpc_iob_add_array(), parse_options(), parse_setting_name(), pbkdf2_sha1_f(), pci_find_next(), pci_settings_fetch(), pcnet32_process_rx_packets(), pcnet32_process_tx_packets(), pcnet32_setup_rx_resources(), pcnet32_setup_tx_resources(), peerblk_raw_open(), peerblk_retrieval_open(), peerdisc_socket_tx(), peerdist_info(), peerdist_info_block(), peerdist_info_segment(), phantom_clp_cmd(), phantom_create_rx_ctx(), phantom_create_tx_ctx(), phantom_open(), phantom_poll(), phantom_probe(), phantom_refill_rx_ring(), phantom_transmit(), phantom_update_macaddr(), ping_deliver(), ping_exec(), ping_rx(), pinger_expired(), prism2_probe(), prism2_transmit(), profile_okx(), pxe_fake_cached_info(), pxe_menu_parse(), pxe_tftp_open(), pxenv_udp_write(), pxenv_undi_clear_statistics(), pxenv_undi_get_iface_info(), pxenv_undi_get_nic_type(), qib7322_ahb_read(), qib7322_ahb_release(), qib7322_ahb_request(), qib7322_ahb_write(), qib7322_complete_recv(), qib7322_create_recv_wq(), qib7322_fini_send(), qib7322_init_ib_serdes(), qib7322_init_recv(), qib7322_init_send(), qib7322_poll_recv_wq(), qib7322_post_recv(), qib7322_post_send(), qib7322_reset(), readline_history(), realtek_create_ring(), realtek_probe(), reparse_options(), resize_dhcp_option(), resolv_setting(), rhine_create_ring(), rhine_probe(), rndis_tx_data(), rndis_tx_halt(), rndis_tx_initialise(), rndis_tx_oid(), rsa_encode_digest(), rsa_init(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), sanboot_core_exec(), scsi_parse_lun(), scsi_parse_sense(), scsicmd_command(), select_setting_row(), set_rx_mode(), shell(), shomron_fill_eth_send_wqe(), show_menu(), sis190_init_board(), sis190_init_ring(), sis630e_get_mac_addr(), skeleton_probe(), skge_up(), sky2_probe(), sky2_reset(), sky2_rx_clean(), sky2_set_multicast(), sky2_up(), slam_mc_socket_deliver(), slam_open(), slam_pull_header(), smsc75xx_probe(), smsc95xx_probe(), smsc95xx_vm3_fetch_mac(), smscusb_set_address(), smscusb_set_filter(), srp_cmd(), srp_login(), srp_rsp(), start_dhcpv6(), start_ntp(), string_test_exec(), t509bus_probe(), tcp_open_uri(), tcp_rx_opts(), tcp_sack(), tcp_xmit_reset(), tcp_xmit_sack(), tcpip_random_okx(), tftp_reopen(), tftp_rx_data(), tftp_timer_expired(), tftp_uri(), tg3_abort_hw(), tg3_alloc_consistent(), tg3_init_rings(), tg3_rings_reset(), tls_assemble_block(), tls_clear_cipher(), tls_send_client_hello(), tls_send_client_key_exchange(), tls_send_finished(), trivial_memset_user(), txnic_send(), udp_open_uri(), udp_rx(), uhci_bus_open(), uhci_enqueue(), uhci_ring_alloc(), undi_load(), undi_unload(), undinet_open(), undinet_probe(), undinet_remove(), undinet_transmit(), undipci_probe(), usb_control(), usb_describe(), usb_message(), usb_probe_all(), usb_score(), usbio_supported(), velocity_alloc_rings(), vmbus_close(), vmbus_establish_gpadl(), vmbus_gpadl_teardown(), vmbus_initiate_contact(), vmbus_open(), vmbus_reset(), vmxnet3_open(), vmxnet3_probe(), vmxnet3_set_ll_addr(), vxge_device_register(), vxge_hw_device_hw_info_get(), vxge_xmit_compl(), wpa_alloc_frame(), wpa_send_eapol(), wpa_send_final(), write_cmd(), x86_features(), x86_get_memmap(), xhci_context(), xhci_dcbaa_alloc(), xhci_device_open(), xhci_disable_slot(), xhci_enable_slot(), xhci_endpoint_message(), xhci_endpoint_stream(), xhci_event_alloc(), xhci_nop(), xhci_reset_endpoint(), xhci_ring_alloc(), xhci_ring_reset(), xhci_set_tr_dequeue_pointer(), xhci_stop_endpoint(), xsigo_xds_complete(), xsmp_rx_xve_modify(), xsmp_tx_session(), xsmp_tx_xve_notify(), xve_create(), and zalloc().

void* memcpy ( void *  dest,
const void *  src,
size_t  len 
)

Referenced by abft_install(), aes_decrypt(), aes_encrypt(), aes_setkey(), aes_unwrap(), aes_wrap(), amd8111e_poll(), amd8111e_transmit(), aoecmd_cfg_rsp(), aoedev_ata_command(), aoedev_open(), apply_dns_settings(), apply_syslog_settings(), ar5008_hw_attach_phy_ops(), ar5008_hw_process_ini(), ar9003_hw_attach_phy_ops(), ar9300_compress_decision(), ar9300_eeprom_restore_internal(), ar9300_uncompress_block(), arbel_cmd(), arbel_complete(), arbel_fill_ud_send_wqe(), arbel_mad(), arbel_mcast_attach(), arbel_modify_qp(), arp_rx(), arp_tx_request(), asn1_algorithm(), asn1_bit_string(), asn1_boolean(), asn1_generalized_time(), asn1_integer(), asn1_prepend(), asn1_prepend_raw(), asn1_shrink(), asn1_wrap(), ath5k_config(), ath5k_eeprom_read_mac(), ath5k_hw_get_lladdr(), ath5k_hw_set_bssid_mask(), ath5k_hw_set_lladdr(), ath5k_hw_set_tx_queueprops(), ath9k_bss_iter(), ath9k_hw_ar9300_set_txpower(), ath9k_init_channels_rates(), ath9k_init_misc(), ath9k_init_softc(), atl1e_clean_rx_irq(), atl1e_get_permanent_address(), atl1e_probe(), atl1e_read_mac_addr(), atl1e_up(), autovivify_child_settings(), axge_in_complete(), bigint_mod_exp_raw(), bnx2_poll(), bnx2_probe(), bnx2_transmit(), bofm_en(), bzimage_load_initrd(), cbc_decrypt(), cbc_encrypt(), cbc_setiv(), ccmp_cbc_mac(), ccmp_ctr_xor(), ccmp_decrypt(), ccmp_encrypt(), ccmp_kie_mic(), check_bios_interrupts(), cipher_null_decrypt(), cipher_null_encrypt(), cms_parse(), cms_parse_certificates(), cms_parse_content_type(), cms_parse_signature_value(), cms_parse_signer_identifier(), cms_parse_signer_info(), cpio_set_field(), cpuid_settings_fetch(), cs89x0_probe(), davicom_poll(), davicom_transmit(), denumerate_int_setting(), dhcp_create_packet(), dhcp_create_request(), dhcp_deliver(), dhcpopt_fetch(), dhcppkt_fetch(), dhcppkt_store(), dhcpv6_fetch(), dhcpv6_fetch_lease(), dhcpv6_iaaddr(), dhcpv6_register(), dhcpv6_rx(), dhcpv6_tx(), dhcpv6_user_class(), dmfe_poll(), dmfe_transmit(), dns_copy(), dns_copy_okx(), dns_decode(), dns_list_okx(), dns_resolv(), dns_xfer_deliver(), draw_editbox(), draw_menu_item(), eapol_key_rx(), efab_probe(), efi_apple_get_response(), efi_block_boot_image(), efi_block_hook(), efi_driver_start(), efi_file_open(), efi_file_varlen(), efi_guid_ntoa(), efi_ifr_form_set_op(), efi_ifr_guid_class_op(), efi_ifr_guid_subclass_op(), efi_ifr_package(), efi_ifr_varstore_name_value_op(), efi_image_path(), efi_pci_info(), efi_pxe_buf_write(), efi_pxe_install(), efi_pxe_ip(), efi_pxe_ip_sockaddr(), efi_pxe_set_ip_filter(), efi_pxe_set_packets(), efi_pxe_set_station_ip(), efi_pxe_udp_deliver(), efi_pxe_udp_read(), efi_pxe_udp_write(), efi_snp_hii_install(), efi_snp_hii_store(), efi_snp_probe(), efi_snp_receive(), efi_snp_set_mode(), efi_snp_station_address(), efi_snp_statistics(), efi_snp_transmit(), efi_undi_receive(), efi_undi_station_address(), efi_usb_get_config_descriptor(), efi_usb_get_device_descriptor(), efi_usb_get_endpoint_descriptor(), efi_usb_get_interface_descriptor(), efi_usb_install(), efi_usb_probe(), efi_usb_sync_transfer(), efi_wrap(), ena_get_device_attributes(), eoib_create(), eoib_create_peer(), eoib_duplicate(), eoib_rx_av(), eoib_set_gateway(), epic100_poll(), epic100_transmit(), errno_fetch(), eth_eth_addr(), eth_eui64(), eth_init_addr(), eth_mc_hash(), eth_push(), eth_slow_lacp_rx(), exanic_probe_port(), exanic_try_init_eeprom(), falcon_spi_rw(), fc_els_create(), fc_els_flogi_rx(), fc_els_flogi_tx(), fc_els_logo_tx(), fc_els_plogi_tx(), fc_els_prli_tx(), fc_els_rx(), fc_fill_sockaddr(), fc_ns_query_step(), fc_peer_create(), fc_peer_login(), fc_port_login(), fc_port_open(), fc_ulp_login(), fc_xchg_create(), fc_xchg_tx(), fcoe_deliver(), fcoe_fip_rx_advertisement(), fcoe_fip_rx_els_response(), fcoe_fip_tx_keepalive(), fcoe_fip_tx_solicitation(), fcoe_fip_tx_vlan(), fcoe_probe(), fcoe_reset(), fcoe_rx(), fcpcmd_send_cmnd(), fcpdev_edd_describe(), fcpdev_open(), fcpdev_scsi_command(), fetch_setting(), flexboot_nodnic_mcast_attach(), flexboot_nodnic_mcast_detach(), flexboot_nodnic_register_netdev(), format_string_setting(), fragment_reassemble(), gcc_implicit_memcpy(), gdbudp_recv(), gdbudp_send(), generic_settings_fetch(), generic_settings_store(), golan_complete(), golan_mcast_attach(), golan_mcast_detach(), golan_post_send(), golan_qry_hca_cap(), golan_query_vport_gid(), golan_set_hca_cap(), hash_df(), hermon_bofm_harvest(), hermon_bofm_update(), hermon_cmd(), hermon_complete(), hermon_fill_ud_send_wqe(), hermon_mad(), hermon_mcast_attach(), hermon_modify_qp(), hermon_register_netdev(), hmac_drbg_generate(), hmac_drbg_reseed(), hmac_final(), hmac_init(), http_open(), http_rx_chunk_data(), http_tx_request(), hunt_get_mac(), hunt_mac_addr(), hunt_mcdi_copyin(), hunt_mcdi_copyout(), hunt_mcdi_request_poll(), hunt_rx_filter_insert(), hunt_set_mac(), hv_post_message(), hv_wait_for_message(), ib_cm_path_complete(), ib_cm_send_drep(), ib_cm_send_rtu(), ib_cmrc_open(), ib_create_conn(), ib_create_madx(), ib_create_path(), ib_mcast_attach(), ib_mcast_mad(), ib_mi_send(), ib_post_send(), ib_pull(), ib_push(), ib_sbft_install(), ib_sma_guid_info(), ib_sma_node_info(), ib_sma_port_info(), ib_sma_set_port_info(), ib_smc_get(), ib_srp_open(), ib_srp_parse_initiator_hca_guid(), ib_srp_parse_sgid(), ibft_fill_target(), ibft_install(), ifec_net_open(), igbvf_open(), igbvf_probe(), igbvf_rar_set_vf(), igbvf_reset(), igbvf_reset_hw_vf(), imgdownload(), insert_delete(), int13_install(), int13con_find(), intel_fetch_mac(), intel_open(), intelvf_mbox_reset(), intelvf_mbox_set_mac(), intelx_open(), intelx_try_fetch_mac(), intelxl_admin_command(), intelxl_fetch_mac(), intelxl_open(), iob_concatenate(), iob_split(), ipoib_complete_recv(), ipoib_link_state_changed(), ipoib_map_remac(), ipoib_probe(), ipoib_translate_rx_arp(), ipoib_translate_tx_arp(), ipoib_transmit(), ipv6_add_miniroute(), ipv6_fetch(), ipv6_pshdr_chksum(), ipv6_route_okx(), ipv6_rx(), ipv6_sock_aton(), ipv6_solicited_node(), ipv6_tx(), iscsi_rx_bhs(), iscsi_rx_buffered_data(), iscsi_scsi_command(), iscsi_start_command(), iscsi_vredirect(), jme_load_macaddr(), linda_probe(), line_buffer(), loopback_test(), mac_address_from_string_specs(), md4_final(), md5_final(), memcpy_0(), memcpy_1(), memcpy_10(), memcpy_11(), memcpy_12(), memcpy_13(), memcpy_14(), memcpy_15(), memcpy_16(), memcpy_17(), memcpy_18(), memcpy_19(), memcpy_2(), memcpy_20(), memcpy_21(), memcpy_22(), memcpy_23(), memcpy_24(), memcpy_25(), memcpy_26(), memcpy_27(), memcpy_28(), memcpy_29(), memcpy_3(), memcpy_30(), memcpy_31(), memcpy_4(), memcpy_5(), memcpy_6(), memcpy_7(), memcpy_8(), memcpy_9(), memcpy_test_speed(), memcpy_var(), memmap_settings_fetch(), mlx_memory_cpy_priv(), myson_open(), myson_probe(), ncm_in_complete(), ndp_fetch(), ndp_prefix_fetch_gateway6(), ndp_prefix_fetch_ip6(), ndp_register_settings(), ndp_tx_ll_addr(), ndp_tx_request(), ne_poll(), neighbour_create(), neighbour_discover(), neighbour_discovered(), net80211_accum_frags(), net80211_handle_assoc_reply(), net80211_handle_auth(), net80211_ll_push(), net80211_marshal_request_info(), net80211_prepare_assoc(), net80211_probe_step(), net80211_process_ie(), net80211_register(), net80211_tx_mgmt(), netdev_fetch_busid(), netdev_fetch_busloc(), netdev_fetch_hwaddr(), netdev_fetch_mac(), netdev_store_mac(), nfs_iob_add_fh(), nfs_iob_get_fh(), nii_get_station_address(), nii_set_station_address(), nii_sync(), ns8390_poll(), ns8390_transmit(), ntlm_authenticate(), ntlm_response(), numeric_resolv(), ocsp_compare_responder_key_hash(), ocsp_parse_basic_response(), ocsp_parse_cert_id(), ocsp_parse_certs(), ocsp_parse_responder_id(), ocsp_parse_response(), ocsp_parse_response_bytes(), ocsp_parse_response_status(), ocsp_parse_response_type(), ocsp_parse_responses(), ocsp_parse_tbs_response_data(), ocsp_response(), ocsp_uri_string(), oncrpc_iob_add_array(), parse_eeprom(), parse_ipv4_setting(), parse_ipv6_setting(), parse_setting_name(), parse_settings_name(), parse_string_setting(), parse_uri(), pbkdf2_sha1(), pbkdf2_sha1_f(), pcnet32_setup_mac_addr(), peerblk_deliver(), peerblk_open(), peerblk_retrieval_open(), peerdisc_create(), peerdisc_socket_tx(), peerdist_info_segment_hash(), peerdist_info_v2_block(), phantom_clp_cmd(), phantom_post_cds(), phantom_post_rds(), ping_open(), prf_sha1(), prism2_transmit(), privkey_apply_settings(), pxe_menu_parse(), pxenv_undi_get_information(), pxenv_undi_isr(), pxenv_undi_set_station_address(), qib7322_probe(), realloc(), realtek_legacy_poll_rx(), register_netdev(), resolv(), resolve_uri(), rndis_rx_query_oid(), rndis_tx_oid(), rsa_decrypt(), rsa_encode_digest(), rsa_encrypt(), rsa_parse_integer(), rsa_parse_mod_exp(), rtl818x_probe(), sandev_command_capacity(), scsi_open(), scsi_parse_sense(), scsicmd_command(), sec80211_install(), send_test_pkt(), set_autoboot_ll_addr(), set_dhcp_option(), settings_name(), sha1_final(), sha256_family_init(), sha256_final(), sha512_family_init(), sha512_final(), shomron_fill_eth_send_wqe(), sis900_poll(), sis900_transmit(), skge_devinit(), sky2_init_netdev(), slam_open(), slam_parse_multicast_address(), slam_pull_header(), smbios_fetch(), smscusb_set_address(), smscusb_set_filter(), snpnet_start(), srp_cmd(), srp_login(), start_dhcpv6(), string_copy(), string_test_exec(), strndup(), sundance_poll(), sundance_transmit(), tcp_open(), tcp_process_tx_queue(), tcp_sack(), tftp_process_multicast(), tftp_rx(), tg3_get_device_address(), tkip_decrypt(), tkip_encrypt(), tkip_init(), tkip_kie_decrypt(), tkip_kie_mic(), tkip_michael(), tkip_mix_1(), tkip_mix_2(), tlan_poll(), tlan_transmit(), tls_assemble_block(), tls_assemble_stream(), tls_cipherstream_deliver(), tls_generate_keys(), tls_new_server_hello(), tls_p_hash_va(), tls_send_certificate(), tls_send_certificate_verify(), tls_send_client_hello(), tls_send_finished(), tls_send_plaintext(), tls_verify_handshake(), trivial_memcpy_user(), tulip_poll(), tulip_probe(), tulip_transmit(), txnic_lmac_probe(), udp_open_common(), undinet_call(), undinet_open(), undinet_probe(), undinet_transmit(), undipci_probe(), unixtime_fetch(), uri_copy_fields(), usb_control(), usb_describe(), usbio_interrupt_callback(), usbio_interrupt_poll(), usbio_path(), usbkbd_report(), vlan_create(), vlan_rx(), vlan_transmit(), vmbus_consume(), vmbus_probe_channels(), vmbus_produce(), vmxnet3_get_hw_addr(), vmxnet3_set_ll_addr(), vxge_device_register(), vxge_hw_vpath_poll_rx(), vxge_probe(), w89c840_poll(), w89c840_transmit(), wep_decrypt(), wep_encrypt(), wep_init(), wpa_derive_ptk(), wpa_handle_1_of_2(), wpa_handle_1_of_4(), wpa_maybe_install_gtk(), wpa_send_2_of_4(), wpa_send_final(), wpa_start(), x509_certificate(), x509_check_alt_name(), x509_check_name(), x509_name(), x509_parse(), x509_parse_access_description(), x509_parse_authority_info_access(), x509_parse_basic_constraints(), x509_parse_common_name(), x509_parse_extended_key_usage(), x509_parse_extension(), x509_parse_extensions(), x509_parse_issuer(), x509_parse_key_purpose(), x509_parse_ocsp(), x509_parse_public_key(), x509_parse_serial(), x509_parse_subject(), x509_parse_subject_alt_name(), x509_parse_tbscertificate(), x509_parse_validity(), x509_parse_version(), xcm_create(), xcm_reopen(), xfer_deliver_raw_meta(), xfer_open_named_socket(), xferbuf_malloc_read(), xferbuf_malloc_write(), xhci_complete(), xhci_endpoint_message(), xsigo_xds_complete(), xsmp_chassis_name(), xsmp_rx_xve_install(), xsmp_session_name(), xsmp_tx_session(), xsmp_tx_xve(), xsmp_tx_xve_notify(), and xve_create().

void* memmove ( void *  dest,
const void *  src,
size_t  len 
)
int __pure memcmp ( const void *  first,
const void *  second,
size_t  len 
)

Compare memory regions.

Parameters:
firstFirst region
secondSecond region
lenLength
Return values:
diffDifference

Definition at line 98 of file string.c.

References first.

Referenced by apply_syslog_settings(), asn1_compare(), asn1_okx(), base16_decode_okx(), base64_decode_okx(), bofm_en(), cachedhcp_probe(), ccmp_decrypt(), check_bios_interrupts(), cipher_decrypt_okx(), cipher_encrypt_okx(), com32_identify(), deflate_okx(), dhcp_deliver(), dhcpv6_check_duid(), digest_frag_okx(), dns_copy_okx(), dns_encode_okx(), eapol_key_rx(), efi_block_boot_image(), efi_file_get_info(), efi_find_table(), efi_guid_ntoa(), efi_pxe_ip_filter(), efi_pxe_udp_read(), elf_load(), elfboot_probe(), eoib_find(), eoib_find_peer(), eoib_rx_av(), eth_probe(), fc_els_logo_logout(), fc_peer_examine(), fc_peer_get_port_id(), fc_peer_get_wwn(), fc_peer_login(), fc_port_deliver(), fc_port_login(), fc_ulp_login(), fcels_exec(), fcoe_fip_rx(), fcoe_fip_rx_advertisement(), fcoe_rx(), find_ibdev(), find_netdev_by_ll_addr(), hvm_cpuid_base(), ib_find_path_cache_entry(), ib_find_qp_mgid(), ib_mcast_detach(), ib_mi_handle(), ib_path_complete(), inet6_aton_okx(), int13_parse_eltorito(), int13con_find(), ipoib_find_remac(), ipoib_map_remac(), ipv6_has_addr(), ipv6_is_fragment(), ipv6_route_okx(), is_autoboot_ll_addr(), iscsi_handle_chap_r_value(), linda_verify_uc_ram(), loopback_wait(), mac_address_from_string_specs(), memcpy_test_speed(), mlx_memory_cmp_priv(), ne_probe(), neighbour_find(), net80211_rx(), ntlm_authenticate_okx(), ntlm_data_okx(), ntlm_key_okx(), nvs_verify(), ocsp_compare_responder_key_hash(), pcnet32_setup_mac_addr(), peerblk_done(), peerblk_parse_block(), peerdist_discovery_reply(), peerdist_info_block_okx(), peerdist_info_passphrase_okx(), peerdist_info_segment_okx(), pem_marker(), png_probe(), rsa_verify(), rsdp_find_rsdt_range(), sandev_parse_iso9660(), script_probe(), slam_pull_header(), string_test_exec(), strstr(), tftp_rx(), tkip_decrypt(), tkip_mix_1(), tls_new_ciphertext(), tls_new_finished(), tls_new_server_hello(), trivial_memcmp_user(), udp_demux(), vmbus_find_driver(), wpa_derive_ptk(), wpa_handle_3_of_4(), x509_chain_okx(), x509_check_dnsname(), x509_check_ipaddress(), x509_check_root(), x509_fingerprint_okx(), xcm_find(), and xve_find().

                                                                 {
        const uint8_t *first_bytes = first;
        const uint8_t *second_bytes = second;
        int diff;

        while ( len-- ) {
                diff = ( *(second_bytes++) - *(first_bytes++) );
                if ( diff )
                        return diff;
        }
        return 0;
}
void* __pure memchr ( const void *  src,
int  character,
size_t  len 
)

Find character within a memory region.

Parameters:
srcSource region
characterCharacter to find
lenLength
Return values:
foundFound character, or NULL if not found

Definition at line 119 of file string.c.

References NULL, and src.

Referenced by line_buffer(), rsa_decrypt(), string_test_exec(), and trivial_memchr_user().

                                                             {
        const uint8_t *src_bytes = src;

        for ( ; len-- ; src_bytes++ ) {
                if ( *src_bytes == character )
                        return ( ( void * ) src_bytes );
        }
        return NULL;
}
void* memswap ( void *  first,
void *  second,
size_t  len 
)

Swap memory regions.

Parameters:
firstFirst region
secondSecond region
lenLength
Return values:
firstFirst region

Definition at line 137 of file string.c.

References first.

Referenced by arp_rx(), gdbudp_recv(), string_test_exec(), and tls_change_cipher().

                                                         {
        uint8_t *first_bytes = first;
        uint8_t *second_bytes = second;
        uint8_t temp;

        for ( ; len-- ; first_bytes++, second_bytes++ ) {
                temp = *first_bytes;
                *first_bytes = *second_bytes;
                *second_bytes = temp;
        }
        return first;
}
int __pure strcmp ( const char *  first,
const char *  second 
)
int __pure strncmp ( const char *  first,
const char *  second,
size_t  max 
)

Compare strings.

Parameters:
firstFirst string
secondSecond string
maxMaximum length to compare
Return values:
diffDifference

Definition at line 170 of file string.c.

Referenced by dhcp_discovery_rx(), http_parse_status(), iscsi_handle_string(), match_long_option(), nfs_uri_symlink(), parse_uri(), peerdist_discovery_reply_tag(), strcmp(), string_test_exec(), and undinet_probe().

                                                                  {
        const uint8_t *first_bytes = ( ( const uint8_t * ) first );
        const uint8_t *second_bytes = ( ( const uint8_t * ) second );
        int diff;

        for ( ; max-- ; first_bytes++, second_bytes++ ) {
                diff = ( *second_bytes - *first_bytes );
                if ( diff )
                        return diff;
                if ( ! *first_bytes )
                        return 0;
        }
        return 0;
}
size_t __pure strlen ( const char *  src)

Get length of string.

Parameters:
srcString
Return values:
lenLength

Definition at line 213 of file string.c.

References strnlen().

Referenced by _print_label(), add_menu_item(), add_parameter(), autovivify_child_settings(), base16_decoded_max_len(), base16_encode_okx(), base64_decoded_max_len(), base64_encode_okx(), bzimage_load_initrd(), bzimage_set_cmdline(), cmdline_init(), comboot_copy_cmdline(), concat_args(), create_menu(), create_parameters(), dns_decode_okx(), dns_list_okx(), draw_editbox(), draw_menu_item(), edit_string(), efi_block_boot_image(), efi_file_varlen(), efi_ifr_package(), efi_image_cmdline(), efi_image_path(), efi_local_open_resolved(), efi_snp_hii_append(), efi_snp_hii_store(), generic_settings_store(), guestinfo_fetch_type(), guestrpc_command(), http_digest_update(), http_format_basic_auth(), http_parse_headers(), http_parse_ntlm_auth(), ib_srp_parse_byte_string(), ib_srp_parse_root_path(), ibft_set_string(), init_editbox(), insert_delete(), ipv6_sock_aton(), iscsi_handle_chap_c_value(), iscsi_handle_chap_i_value(), iscsi_handle_chap_r_value(), iscsi_parse_root_path(), iwlist(), linebuf_accumulated_okx(), login_ui(), match_long_option(), net80211_marshal_request_info(), netdev_fetch_bustype(), netdev_fetch_chip(), netdev_fetch_ifname(), nfs_uri_symlink(), parse_net_args(), parse_settings_name(), parse_string_setting(), parse_uri(), peerblk_retrieval_uri(), peerdisc_create(), peerdisc_discovered(), peerdisc_socket_rx(), peerdisc_socket_tx(), peerdist_discovery_reply(), peerdist_discovery_reply_tag(), peerdist_discovery_reply_values(), pem_marker(), prf_sha1(), pxenv_file_cmdline(), resolv(), resolv_setting(), resolve_path(), show_menu(), slam_parse_multicast_address(), snprintf_okx(), strcat(), string_copy(), string_test_exec(), strstr(), sync_console(), tftp_process_multicast(), tftp_send_error(), tftp_send_rrq(), tls_send_client_hello(), trivial_strlen_user(), uri_copy_fields(), uri_decode_inplace(), uri_encode_string(), uri_format_okx(), uri_pxe_okx(), validator_start_download(), version_fetch(), wpa_psk_start(), x509_check_dnsname(), xenbus_probe(), xenbus_probe_device(), xenbus_probe_type(), xenstore_dump(), xenstore_request(), xenstore_response(), and xenstore_send_string().

                                  {

        return strnlen ( src, ~( ( size_t ) 0 ) );
}
size_t __pure strnlen ( const char *  src,
size_t  max 
)

Get length of string.

Parameters:
srcString
maxMaximum length
Return values:
lenLength

Definition at line 225 of file string.c.

References len.

Referenced by efi_pecoff_debug_name(), iscsi_handle_strings(), string_test_exec(), strlen(), strndup(), tftp_rx_oack(), and used_len_string().

                                               {
        const uint8_t *src_bytes = ( ( const uint8_t * ) src );
        size_t len = 0;

        while ( max-- && *(src_bytes++) )
                len++;
        return len;
}
char* __pure strchr ( const char *  src,
int  character 
)

Find character within a string.

Parameters:
srcString
characterCharacter to find
Return values:
foundFound character, or NULL if not found

Definition at line 241 of file string.c.

References NULL.

Referenced by base64_decode(), bzimage_load_initrd(), cmdline_strip(), comboot_fetch_kernel(), dns_resolv(), efi_pecoff_debug_name(), http_parse_header(), ipv6_sock_aton(), iscsi_handle_string(), iscsi_handle_targetaddress_value(), netbios_domain(), nfs_uri_init(), parse_setting_name(), parse_settings_name(), parse_uri(), slam_parse_multicast_address(), string_test_exec(), tftp_process_multicast(), uri_character_escaped(), and x509_check_dnsname().

                                                 {
        const uint8_t *src_bytes = ( ( const uint8_t * ) src );

        for ( ; ; src_bytes++ ) {
                if ( *src_bytes == character )
                        return ( ( char * ) src_bytes );
                if ( ! *src_bytes )
                        return NULL;
        }
}
char* __pure strrchr ( const char *  src,
int  character 
)

Find rightmost character within a string.

Parameters:
srcString
characterCharacter to find
Return values:
foundFound character, or NULL if not found

Definition at line 259 of file string.c.

References NULL, and start.

Referenced by basename(), com32_identify(), comboot_identify(), dirname(), efi_pecoff_debug_name(), nfs_uri_next_mountpoint(), parse_uri(), and string_test_exec().

                                                  {
        const uint8_t *src_bytes = ( ( const uint8_t * ) src );
        const uint8_t *start = src_bytes;

        while ( *src_bytes )
                src_bytes++;
        for ( src_bytes-- ; src_bytes >= start ; src_bytes-- ) {
                if ( *src_bytes == character )
                        return ( ( char * ) src_bytes );
        }
        return NULL;
}
char* __pure strstr ( const char *  haystack,
const char *  needle 
)

Find substring.

Parameters:
haystackString
needleSubstring
Return values:
foundFound substring, or NULL if not found

Definition at line 279 of file string.c.

References len, memcmp(), NULL, and strlen().

Referenced by bzimage_parse_cmdline(), bzimage_parse_cpio_cmdline(), cmdline_strip(), comboot_fetch_kernel(), parse_uri(), and string_test_exec().

                                                           {
        size_t len = strlen ( needle );

        for ( ; *haystack ; haystack++ ) {
                if ( memcmp ( haystack, needle, len ) == 0 )
                        return ( ( char * ) haystack );
        }
        return NULL;
}
char* strcpy ( char *  dest,
const char *  src 
)

Copy string.

Parameters:
destDestination string
srcSource string
Return values:
destDestination string

Definition at line 296 of file string.c.

References dest.

Referenced by add_menu_item(), add_parameter(), cmdline_strip(), create_menu(), create_parameters(), efi_ifr_package(), ib_srp_parse_root_path(), ibft_set_string(), inet6_ntoa(), iscsi_parse_root_path(), net80211_prepare_assoc(), net80211_probe_start(), net80211_probe_step(), nfs_uri_symlink(), peerdisc_discovered(), peerdist_discovery_reply(), resolv_setting(), strcat(), string_test_exec(), and tftp_send_error().

                                              {
        const uint8_t *src_bytes = ( ( const uint8_t * ) src );
        uint8_t *dest_bytes = ( ( uint8_t * ) dest );

        /* We cannot use strncpy(), since that would pad the destination */
        for ( ; ; src_bytes++, dest_bytes++ ) {
                *dest_bytes = *src_bytes;
                if ( ! *dest_bytes )
                        break;
        }
        return dest;
}
char* strncpy ( char *  dest,
const char *  src,
size_t  max 
)

Copy string.

Parameters:
destDestination string
srcSource string
maxMaximum length
Return values:
destDestination string

Definition at line 317 of file string.c.

References dest, and max.

Referenced by buildarch_fetch(), efi_block_install(), int13_install(), netdev_fetch_bustype(), netdev_fetch_chip(), netdev_fetch_ifname(), platform_fetch(), slk_set(), string_test_exec(), and version_fetch().

                                                           {
        const uint8_t *src_bytes = ( ( const uint8_t * ) src );
        uint8_t *dest_bytes = ( ( uint8_t * ) dest );

        for ( ; max ; max--, src_bytes++, dest_bytes++ ) {
                *dest_bytes = *src_bytes;
                if ( ! *dest_bytes )
                        break;
        }
        while ( max-- )
                *(dest_bytes++) = '\0';
        return dest;
}
char* strcat ( char *  dest,
const char *  src 
)

Concatenate string.

Parameters:
destDestination string
srcSource string
Return values:
destDestination string

Definition at line 338 of file string.c.

References dest, strcpy(), and strlen().

Referenced by _print_label(), and string_test_exec().

                                              {

        strcpy ( ( dest + strlen ( dest ) ), src );
        return dest;
}
char* __malloc strdup ( const char *  src)

Duplicate string.

Parameters:
srcSource string
Return values:
dupDuplicated string, or NULL if allocation failed

Definition at line 350 of file string.c.

References strndup().

Referenced by expand_settings(), history_append(), history_store(), http_parse_ntlm_auth(), image_set_cmdline(), image_set_name(), ipv6_sock_aton(), iscsi_handle_targetaddress_value(), iscsi_parse_root_path(), nfs_parse_uri(), nfs_uri_init(), nfs_uri_next_mountpoint(), oncrpc_init_cred_sys(), readline_history(), resolve_path(), string_test_exec(), and system().

                                  {

        return strndup ( src, ~( ( size_t ) 0 ) );
}
char* __malloc strndup ( const char *  src,
size_t  max 
)

Duplicate string.

Parameters:
srcSource string
maxMaximum length
Return values:
dupDuplicated string, or NULL if allocation failed

Definition at line 362 of file string.c.

References len, malloc(), memcpy(), and strnlen().

Referenced by nfs_deliver(), strdup(), and string_test_exec().

                                               {
        size_t len = strnlen ( src, max );
        char *dup;

        dup = malloc ( len + 1 /* NUL */ );
        if ( dup ) {
                memcpy ( dup, src, len );
                dup[len] = '\0';
        }
        return dup;
}
char* __pure strpbrk ( const char *  string,
const char *  delim 
)

strpbrk - Find the first occurrence of a set of characters : The string to be searched : The characters to search for

Definition at line 47 of file stringextra.c.

References NULL.

Referenced by strsep().

{
        const char *sc1,*sc2;

        for( sc1 = cs; *sc1 != '\0'; ++sc1) {
                for( sc2 = ct; *sc2 != '\0'; ++sc2) {
                        if (*sc1 == *sc2)
                                return (char *) sc1;
                }
        }
        return NULL;
}
char* strsep ( char **  s,
const char *  ct 
)

strsep - Split a string into tokens : The string to be searched : The characters to search for

strsep() updates to point after the token, ready for the next call.

It returns empty tokens, too, behaving exactly like the libc function of that name. In fact, it was stolen from glibc2 and de-fancy-fied. Same semantics, slimmer shape. ;)

Definition at line 73 of file stringextra.c.

References end, NULL, and strpbrk().

Referenced by parse_kv(), and parse_net_args().

{
        char *sbegin = *s, *end;

        if (sbegin == NULL)
                return NULL;

        end = strpbrk(sbegin, ct);
        if (end)
                *end++ = '\0';
        *s = end;

        return sbegin;
}
char* __pure strerror ( int  errno)

Retrieve string representation of error number.

Parameters:
errno/rcError number or return status code
Return values:
strerrorPointer to error text

If the error is not found in the linked-in error tables, generates a generic "Error 0x<errno>" message.

The pointer returned by strerror() is valid only until the next call to strerror().

Definition at line 78 of file strerror.c.

References errno, find_closest_error(), PRODUCT_ERROR_URI, snprintf(), and errortab::text.

Referenced by _hunt_mcdi(), abft_install(), acm_control_receive(), acm_control_transmit(), acm_in_complete(), acm_intr_complete(), acm_probe(), acpi_poweroff(), acpi_settings_init(), aoecmd_tx(), aoedev_open(), apply_netdev_settings(), apply_settings(), apply_syslog_settings(), apply_syslogs_settings(), arbel_alloc_icm(), arbel_configure_special_qps(), arbel_create_cq(), arbel_create_eq(), arbel_create_qp(), arbel_destroy_cq(), arbel_destroy_eq(), arbel_destroy_qp(), arbel_dump_cqctx(), arbel_dump_qpctx(), arbel_get_limits(), arbel_ib_close(), arbel_ib_open(), arbel_mad(), arbel_map_vpm(), arbel_mcast_attach(), arbel_mcast_detach(), arbel_modify_qp(), arbel_poll_cq(), arbel_probe(), arbel_setup_mpt(), arbel_start(), arbel_start_firmware(), arbel_stop_firmware(), arp_rx(), arp_tx_request(), atacmd_close(), atadev_command(), ath5k_handle_rx(), ath5k_hw_channel(), ath5k_reset(), ath5k_tx_processq(), axge_check_link(), axge_in_complete(), axge_intr_complete(), axge_open(), axge_probe(), bios_poweroff(), blktrans_deliver(), bofm_en(), bofm_probe(), bofm_test_init(), builtin_init(), bzimage_check_initrds(), bzimage_exec(), cachedhcp_probe(), cert_exec(), certstore_apply_settings(), certstore_init(), chained_locate(), choose_exec(), cmdline_init(), cms_parse_certificates(), cms_parse_digest_algorithm(), cms_parse_signature_algorithm(), cms_parse_signer_identifier(), cms_verify_digest(), cms_verify_signer_info(), colour_exec(), com32_load_image(), com32_prepare_bounce_buffer(), comboot_fetch_kernel(), comboot_prepare_segment(), config_exec(), console_exec(), cpair_exec(), cpuid_settings_fetch(), cpuid_settings_init(), create_fakedhcpack(), create_fakedhcpdiscover(), create_fakepxebsack(), create_pinger(), dbg_efi_openers(), dbg_efi_protocols(), der_probe(), dhcp_create_request(), dhcp_proxy_rx(), dhcp_pxebs_rx(), dhcp_request_rx(), dhcp_tx(), dhcpv6_rx(), dhcpv6_tx(), dm96xx_check_link(), dm96xx_in_complete(), dm96xx_intr_complete(), dm96xx_open(), dm96xx_probe(), dm96xx_read_mac(), dm96xx_reset(), dm96xx_rx_mode(), dm96xx_write_mac(), dns_resolv(), dns_xfer_deliver(), downloader_finished(), drbg_generate(), drbg_instantiate(), drbg_reseed(), dummy_san_hook(), eapol_key_rx(), ecm_fetch_mac(), ecm_in_complete(), ecm_intr_complete(), ecm_open(), ecm_probe(), efab_init_mac(), efi_block_boot(), efi_block_boot_image(), efi_block_connect(), efi_block_describe(), efi_block_hook(), efi_block_install(), efi_block_rw(), efi_bofm_start(), efi_bofm_supported(), efi_child_add(), efi_download_install(), efi_driver_connect(), efi_driver_handles(), efi_driver_install(), efi_driver_start(), efi_entropy_enable(), efi_entropy_tick(), efi_file_install(), efi_file_uninstall(), efi_get_noise_rng(), efi_get_time(), efi_getchar(), efi_image_exec(), efi_image_probe(), efi_init(), efi_local_check_volume_name(), efi_local_len(), efi_local_open_resolved(), efi_local_open_root(), efi_local_open_volume(), efi_local_step(), efi_locate_device(), efi_pci_info(), efi_pxe_dhcp(), efi_pxe_fake(), efi_pxe_install(), efi_pxe_mtftp(), efi_pxe_tftp_open(), efi_pxe_udp_open(), efi_pxe_udp_write(), efi_snp_hii_fetch(), efi_snp_hii_install(), efi_snp_hii_store(), efi_snp_initialize(), efi_snp_mcast_ip_to_mac(), efi_snp_probe(), efi_snp_receive(), efi_snp_reset(), efi_snp_transmit(), efi_tick_shutdown(), efi_tick_startup(), efi_udelay(), efi_urealloc(), efi_usb_async_start(), efi_usb_control_transfer(), efi_usb_get_string_descriptor(), efi_usb_install(), efi_usb_open(), efi_usb_probe(), efi_usb_sync_transfer(), efi_watchdog_expired(), efi_wrap(), efifb_glyphs(), efifb_init(), efifb_restore(), efifb_select_mode(), efipci_open(), efipci_read(), efipci_root(), efipci_start(), efipci_write(), ehci_device_address(), ehci_endpoint_close(), ehci_endpoint_poll(), elf_load_segment(), elfboot_exec(), embedded_init(), eoib_duplicate(), eoib_join_broadcast_group(), eoib_link_state_changed(), eoib_open(), exanic_fetch_mac(), exanic_poll_rx(), fc_els_close(), fc_els_flogi_rx(), fc_els_plogi_rx(), fc_els_prli_rx(), fc_els_rx(), fc_els_step(), fc_els_tx(), fc_ns_query_step(), fc_peer_close(), fc_peer_examine(), fc_peer_logout(), fc_peer_plogi(), fc_port_examine(), fc_port_login(), fc_port_logout(), fc_port_ns_plogi_done(), fc_ulp_close(), fc_ulp_examine(), fc_ulp_logout(), fc_xchg_close(), fc_xchg_respond(), fc_xchg_rx(), fc_xchg_tx(), fcels(), fcoe_deliver(), fcoe_expired(), fcoe_fip_rx_els_response(), fcoe_fip_rx_vlan(), fcoe_fip_tx_keepalive(), fcoe_fip_tx_solicitation(), fcoe_fip_tx_vlan(), fcoe_rx(), fcpcmd_close(), fcpcmd_send_cmnd(), fcpcmd_send_wrdata(), fcpdev_close(), fcpdev_examine(), fcpdev_open(), fcpdev_scsi_command(), fcpeerstat(), fcportstat(), flexboot_nodnic_eth_close(), flexboot_nodnic_eth_transmit(), flexboot_nodnic_poll_cq(), flexboot_nodnic_register_netdev(), ftp_data_closed(), ftp_done(), ftp_open(), goto_exec(), guestinfo_fetch_type(), guestinfo_init(), guestinfo_net_probe(), hermon_bofm_harvest(), hermon_bofm_probe(), hermon_bofm_update(), hermon_configure_special_qps(), hermon_create_cq(), hermon_create_eq(), hermon_create_qp(), hermon_destroy_cq(), hermon_destroy_eq(), hermon_destroy_qp(), hermon_dump_cqctx(), hermon_dump_qpctx(), hermon_eth_close(), hermon_eth_open(), hermon_eth_transmit(), hermon_get_cap(), hermon_ib_close(), hermon_ib_open(), hermon_mad(), hermon_map_icm(), hermon_map_vpm(), hermon_mcast_attach(), hermon_mcast_detach(), hermon_modify_qp(), hermon_poll_cq(), hermon_register_ibdev(), hermon_register_netdev(), hermon_sense_port_type(), hermon_set_port_type(), hermon_setup_mpt(), hermon_start(), hermon_start_firmware(), hermon_stop_firmware(), http_block_read(), http_block_read_capacity(), http_conn_close(), http_connect(), http_open(), http_parse_ntlm_auth(), http_parse_www_authenticate(), http_redirect(), http_reopen(), http_rx_headers(), http_rx_linebuf(), http_transfer_complete(), http_tx_request(), hub_clear_changes(), hub_clear_tt(), hub_complete(), hub_disable(), hub_enable(), hub_open(), hub_probe(), hub_refill(), hub_speed(), hunt_open(), hv_post_message(), hv_signal_event(), hv_unquiesce(), hvm_ioremap(), hvm_iounmap(), hvm_map_grant(), hvm_map_hypercall(), hvm_map_xenstore(), hvm_probe(), ib_cm_path_complete(), ib_cm_req_complete(), ib_cm_send_drep(), ib_cm_send_rtu(), ib_cmrc_changed(), ib_cmrc_complete_recv(), ib_cmrc_complete_send(), ib_cmrc_open(), ib_cmrc_xfer_deliver(), ib_create_cq(), ib_create_mi(), ib_create_qp(), ib_mcast_complete(), ib_mcast_join(), ib_mcast_leave(), ib_mi_complete_recv(), ib_mi_send(), ib_modify_qp(), ib_open(), ib_path_complete(), ib_post_recv(), ib_post_send(), ib_refill_recv(), ib_sbft_install(), ib_set_pkey_table(), ib_set_port_info(), ib_sma_guid_info(), ib_sma_node_desc(), ib_sma_node_info(), ib_sma_pkey_table(), ib_sma_port_info(), ib_sma_set_pkey_table(), ib_sma_set_port_info(), ib_smc_get_guid_info(), ib_smc_get_node_info(), ib_smc_get_pkey_table(), ib_smc_get_port_info(), ib_srp_open(), ib_srp_parse_root_path(), ibft_fill_nic(), ibft_install(), icmpv6_rx(), icplus_init_phy(), icplus_probe(), ifconf(), ifopen(), ifstat(), ifstat_errors(), image_asn1(), image_exec(), image_pixbuf(), image_probe(), image_replace(), imgdownload(), imgsingle_exec(), imgtrust_exec(), imgverify(), imgverify_exec(), inc_exec(), init_i2c_bit_basher(), initrd_init(), int13_boot(), int13_cdrom_read_boot_catalog(), int13_describe(), int13_device_path_info(), int13_extended_rw(), int13_get_extended_parameters(), int13_guess_geometry_hdd(), int13_hook(), int13_parse_eltorito(), int13_rw_sectors(), int13con_find(), intel_fetch_mac_eeprom(), intelvf_mbox_reset(), intelvf_mbox_set_mac(), intelvf_mbox_set_mtu(), intelxvf_mbox_queues(), intelxvf_mbox_version(), intelxvf_open(), intelxvf_probe(), intf_close(), intf_shutdown(), ipoib_join_broadcast_group(), ipoib_link_state_changed(), ipoib_open(), ipoib_translate_rx_arp(), ipoib_transmit(), ipv4_gratuitous_arp(), ipv4_rx(), ipv4_tx(), ipv6_create_routes(), ipv6_rx(), ipv6_tx(), ipv6conf_rx_router_advertisement(), iscsi_close(), iscsi_handle_chap_c_value(), iscsi_handle_chap_i_value(), iscsi_handle_chap_r_value(), iscsi_handle_string(), iscsi_open(), iscsi_open_connection(), iscsi_rx_login_response(), iscsi_rx_scsi_response(), iscsi_socket_deliver(), iscsi_tx_step(), iwlist(), lan78xx_open(), lan78xx_probe(), linda_complete_recv(), linda_init_i2c(), linda_probe(), linda_program_uc_ram(), linda_read_eeprom(), linda_verify_uc_ram(), linebuf_consume_okx(), login_exec(), loopback_test(), lotest_exec(), main_loop(), memmap_settings_init(), mii_reset(), mii_restart(), monojob_wait(), multiboot_add_modules(), multiboot_load_elf(), multiboot_load_raw(), myri10ge_net_open(), myri10ge_pci_probe(), named_resolv_done(), natsemi_hwaddr(), nbi_prepare_segment(), ncm_in_complete(), ncm_intr_complete(), ncm_open(), ncm_probe(), ndp_rx_neighbour_advertisement_ll_target(), ndp_rx_neighbour_solicitation_ll_source(), ndp_rx_router_advertisement_ll_source(), ndp_tx_ll_addr(), neighbour_destroy(), neighbour_discovered(), neighbour_expired(), net80211_probe_step(), net80211_step_associate(), netboot(), netdev_config_close(), netdev_configure(), netdev_link_err(), netdev_redirect_settings_init(), netdev_rx_err(), netdev_tx_err(), netfront_close(), netfront_create_event(), netfront_create_ring(), netfront_open(), netfront_poll_rx(), netfront_poll_tx(), netfront_probe(), netfront_push(), netfront_read_mac(), netfront_reset(), netfront_rm(), netfront_send_event(), netfront_write_num(), netvsc_control(), netvsc_create_buffer(), netvsc_destroy_buffer(), netvsc_establish_buffer(), netvsc_initialise(), netvsc_ndis_version(), netvsc_open(), netvsc_probe(), netvsc_recv_data(), netvsc_reset(), netvsc_revoke_buffer(), netvsc_transmit(), nfs_done(), nii_get_init_info(), nii_get_station_address(), nii_initialise_flags(), nii_io(), nii_map(), nii_open(), nii_pci_open(), nii_poll(), nii_poll_rx(), nii_set_rx_filters(), nii_set_station_address(), nii_shutdown(), nii_start(), nii_start_undi(), nii_stop_undi(), nii_transmit(), nslookup(), ntp_exec(), ntp_request(), nvo_load(), nvo_realloc_dhcpopt(), nvo_save(), nvo_store(), nvs_vpd_init(), nvs_vpd_read(), nvs_vpd_resize(), nvs_vpd_write(), ocsp_check_signature(), ocsp_parse_basic_response(), ocsp_parse_certs(), ocsp_parse_response_status(), ocsp_parse_responses(), ocsp_request(), ocsp_validate(), pci_probe(), pci_settings_init(), pciscan_exec(), peerblk_decrypt(), peerblk_deliver(), peerblk_done(), peerblk_parse_header(), peerblk_raw_open(), peerblk_retrieval_open(), peerblk_retrieval_rx(), peerdisc_socket_open(), peerdisc_socket_rx(), peerdisc_socket_tx(), peerdist_info(), peerdist_info_v1(), peerdist_info_v1_block(), peerdist_info_v1_block_offset(), peerdist_info_v1_segment(), peerdist_info_v2(), peerdist_info_v2_segment(), peerdist_info_v2_segments(), peermux_info_close(), peermux_step(), pem_asn1(), pem_image_asn1(), pem_image_probe(), phantom_create_rx_ctx(), phantom_create_tx_ctx(), phantom_destroy_rx_ctx(), phantom_destroy_tx_ctx(), phantom_fetch_setting(), phantom_issue_cmd(), phantom_probe(), phantom_store_setting(), ping(), ping_callback(), ping_deliver(), ping_open(), pinger_expired(), png_image_data(), poweroff_exec(), pxe_deactivate(), pxe_exec(), pxe_fake_cached_info(), pxe_menu_parse(), pxe_tftp_open(), pxebs_exec(), pxenv_udp_open(), pxenv_udp_write(), pxenv_undi_get_mcast_address(), pxenv_undi_open(), pxenv_undi_reset_adapter(), pxenv_undi_transmit(), qib7322_ahb_request(), qib7322_complete_recv(), qib7322_init_i2c(), qib7322_probe(), qib7322_read_eeprom(), rbg_startup(), rdtsc_probe(), realtek_init_eeprom(), realtek_phy_reset(), realtek_phy_speed(), realtek_probe(), register_ibdev(), register_netdev(), register_rndis(), register_usb(), register_usb_hub(), resmux_try(), rhine_probe(), rndis_describe(), rndis_filter(), rndis_open(), rndis_tx_message(), rootdev_probe(), rsa_encrypt(), sandev_command_read_capacity(), sandev_command_rw(), sandev_describe(), sandev_parse_iso9660(), sandev_reopen(), sanpath_block_close(), sanpath_open(), scsicmd_close(), scsicmd_command(), scsidev_ready(), serial_init(), set_core_exec(), show_exec(), slam_finished(), slam_open(), slam_pull_header(), smbios_init(), smsc75xx_dump_statistics(), smsc75xx_in_complete(), smsc75xx_open(), smsc75xx_probe(), smsc95xx_dump_statistics(), smsc95xx_in_complete(), smsc95xx_open(), smsc95xx_probe(), smsc95xx_reset(), smsc95xx_vm3_fetch_mac(), smscusb_get_statistics(), smscusb_intr_complete(), smscusb_mii_check_link(), smscusb_mii_open(), smscusb_raw_readl(), smscusb_raw_writel(), snpnet_close(), snpnet_open(), snpnet_poll_rx(), snpnet_poll_tx(), snpnet_rx_filters(), snpnet_start(), snpnet_stop(), snpnet_transmit(), srp_cmd(), srp_login(), srp_open(), srpcmd_close(), srpdev_close(), srpdev_deliver(), start_dhcpv6(), start_ntp(), sync_exec(), syslog_putchar(), syslogs_close(), syslogs_putchar(), tcp_open(), tcp_rx_data(), tcp_xmit_reset(), tcp_xmit_sack(), test_init(), tftp_core_open(), tftp_done(), tftp_presize(), tftp_reopen(), tftp_reopen_mc(), tftp_rx_data(), tg3_get_invariants(), tg3_open(), threewire_detect_address_len(), threewire_read(), threewire_write(), timer_probe(), tls_generate_keys(), tls_generate_random(), tls_new_change_cipher(), tls_new_record(), tls_new_server_hello_done(), tls_parse_chain(), tls_send_certificate_verify(), tls_send_client_key_exchange(), tls_send_plaintext(), tls_tx_step(), tls_validator_done(), txnic_bgx_mac(), udp_open_common(), udp_tx(), uhci_device_address(), undi_load(), undinet_call(), undinet_transmit(), unhide_etherboot(), uriboot(), usb_autoconfigure(), usb_complete_err(), usb_config_descriptor(), usb_control(), usb_endpoint_clear_tt(), usb_endpoint_mtu(), usb_endpoint_open(), usb_endpoint_reset(), usb_get_default_language(), usb_hotplugged(), usb_message(), usb_probe(), usb_stream(), usbhid_describe(), usbhid_open(), usbio_bulk_in_poll(), usbio_bulk_out_poll(), usbio_config(), usbio_control_poll(), usbio_interfaces(), usbio_interrupt_open(), usbio_open(), usbio_path(), usbio_start(), usbio_supported(), usbkbd_complete(), usbkbd_probe(), usbkbd_set_leds(), usbnet_open(), validator_append(), validator_ocsp_validate(), validator_start_download(), validator_start_ocsp(), validator_xfer_close(), validator_xfer_deliver(), vcreate_exec(), vdestroy_exec(), velocity_probe(), vesafb_mode_info(), vesafb_mode_list(), vesafb_set_mode(), vlan_create(), vlan_rx(), vlan_transmit(), vmbus_close(), vmbus_poll(), vmbus_post_message(), vmbus_probe_channels(), vmbus_reset_channels(), vmbus_signal_event(), vmbus_wait_for_any_message(), vmbus_xfer_page_iobufs(), vmconsole_init(), vmconsole_putchar(), vmxnet3_probe(), wpa_handle_1_of_2(), wpa_handle_3_of_4(), x509_check_ipaddress(), x509_check_signature(), x509_parse(), x509_parse_basic_constraints(), x509_parse_extension(), x509_parse_issuer(), x509_parse_key_usage(), x509_parse_public_key(), x509_parse_serial(), x509_parse_subject_alt_name(), x509_parse_tbscertificate(), x509_parse_validity(), x509_parse_version(), xcm_close(), xcm_list(), xcm_reopen(), xcm_step(), xenbus_backend_state(), xenbus_backend_wait(), xenbus_probe(), xenbus_probe_device(), xenbus_probe_type(), xenbus_set_state(), xengrant_init(), xenstore_request(), xfer_deliver(), xfer_open_uri(), xfer_vredirect(), xferbuf_ensure_size(), xhci_command(), xhci_complete(), xhci_disable_slot(), xhci_enable_slot(), xhci_host_controller(), xhci_reset_endpoint(), xhci_set_tr_dequeue_pointer(), xhci_stop_endpoint(), xhci_transfer(), xsigo_ib_open(), xsigo_xcm_complete(), xsigo_xds_complete(), xsmp_tx_session(), xsmp_tx_xve(), xve_create(), and xve_open().

                              {
        static char errbuf[64];
        struct errortab *errortab;

        /* Allow for strerror(rc) as well as strerror(errno) */
        if ( errno < 0 )
                errno = -errno;

        /* Find the error description, if one exists */
        errortab = find_closest_error ( errno );

        /* Construct the error message */
        if ( errortab ) {
                snprintf ( errbuf, sizeof ( errbuf ),
                           "%s (" PRODUCT_ERROR_URI ")",
                           errortab->text, errno );
        } else {
                snprintf ( errbuf, sizeof ( errbuf ),
                           "Error %#08x (" PRODUCT_ERROR_URI ")",
                           errno, errno );
        }

        return errbuf;
}