iPXE
strings.h File Reference

String functions. More...

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

Go to the source code of this file.

Macros

#define ffsll(x)
 Find first (i.e.
#define ffsl(x)
 Find first (i.e.
#define ffs(x)
 Find first (i.e.
#define flsll(x)
 Find last (i.e.
#define flsl(x)
 Find last (i.e.
#define fls(x)
 Find last (i.e.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
static __attribute__ ((always_inline)) int __constant_ffsll(unsigned long long x)
 Find first (i.e.
int __ffsll (long long x)
int __ffsl (long x)
int __flsll (long long x)
int __flsl (long x)
int __pure strcasecmp (const char *first, const char *second) __nonnull
 Compare case-insensitive strings.
int __pure strncasecmp (const char *first, const char *second, size_t max) __nonnull
 Compare case-insensitive strings.

Variables

static void * dest
static void size_t len

Detailed Description

String functions.

Definition in file strings.h.

Macro Definition Documentation

◆ ffsll

#define ffsll ( x)
Value:
( __builtin_constant_p ( x ) ? __constant_ffsll ( x ) : __ffsll ( x ) )
int __ffsll(long long x)
static unsigned int x
Definition pixbuf.h:63

Find first (i.e.

least significant) set bit

Parameters
xValue
Return values
lsbLeast significant bit set in value (LSB=1), or zero

Definition at line 123 of file strings.h.

123#define ffsll( x ) \
124 ( __builtin_constant_p ( x ) ? __constant_ffsll ( x ) : __ffsll ( x ) )

Referenced by ffsll_okx(), ffsll_var(), and usb_alloc_address().

◆ ffsl

#define ffsl ( x)
Value:
( __builtin_constant_p ( x ) ? __constant_ffsl ( x ) : __ffsl ( x ) )
int __ffsl(long x)

Find first (i.e.

least significant) set bit

Parameters
xValue
Return values
lsbLeast significant bit set in value (LSB=1), or zero

Definition at line 132 of file strings.h.

132#define ffsl( x ) \
133 ( __builtin_constant_p ( x ) ? __constant_ffsl ( x ) : __ffsl ( x ) )

Referenced by ffsl_okx(), and ffsl_var().

◆ ffs

#define ffs ( x)
Value:
ffsl ( x )
#define ffsl(x)
Find first (i.e.
Definition strings.h:132

Find first (i.e.

least significant) set bit

Parameters
xValue
Return values
lsbLeast significant bit set in value (LSB=1), or zero

Definition at line 141 of file strings.h.

Referenced by efifb_colour_map_mask(), ehci_periodic_schedule(), exanic_expired(), and uhci_periodic_schedule().

◆ flsll

#define flsll ( x)
Value:
( __builtin_constant_p ( x ) ? __constant_flsll ( x ) : __flsll ( x ) )
int __flsll(long long x)

Find last (i.e.

most significant) set bit

Parameters
xValue
Return values
msbMost significant bit set in value (LSB=1), or zero

Definition at line 149 of file strings.h.

149#define flsll( x ) \
150 ( __builtin_constant_p ( x ) ? __constant_flsll ( x ) : __flsll ( x ) )

Referenced by flsll_okx(), flsll_var(), and profile_update().

◆ flsl

#define flsl ( x)
Value:
( __builtin_constant_p ( x ) ? __constant_flsl ( x ) : __flsl ( x ) )
int __flsl(long x)

Find last (i.e.

most significant) set bit

Parameters
xValue
Return values
msbMost significant bit set in value (LSB=1), or zero

Definition at line 158 of file strings.h.

158#define flsl( x ) \
159 ( __builtin_constant_p ( x ) ? __constant_flsl ( x ) : __flsl ( x ) )

Referenced by flsl_okx(), flsl_var(), ipv6_match_len(), profile_update(), and slam_put_value().

◆ fls

#define fls ( x)

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ __attribute__()

__attribute__ ( (always_inline) )
inlinestatic

Find first (i.e.

Zero memory.

Copy memory.

Find last (i.e.

least significant) set bit

Parameters
xValue
Return values
lsbLeast significant bit set in value (LSB=1), or zero

most significant) set bit

Parameters
xValue
Return values
msbMost significant bit set in value (LSB=1), or zero
Parameters
srcSource
destDestination
lenLength
destDestination
lenLength

Definition at line 22 of file strings.h.

23 {
24 int r = 0;
25
26 if ( ! ( x & 0x00000000ffffffffULL ) ) {
27 x >>= 32;
28 r += 32;
29 }
30 if ( ! ( x & 0x0000ffffUL ) ) {
31 x >>= 16;
32 r += 16;
33 }
34 if ( ! ( x & 0x00ff ) ) {
35 x >>= 8;
36 r += 8;
37 }
38 if ( ! ( x & 0x0f ) ) {
39 x >>= 4;
40 r += 4;
41 }
42 if ( ! ( x & 0x3 ) ) {
43 x >>= 2;
44 r += 2;
45 }
46 if ( ! ( x & 0x1 ) ) {
47 x >>= 1;
48 r += 1;
49 }
50 return ( x ? ( r + 1 ) : 0 );
51}
static const uint8_t r[3][4]
MD4 shift amounts.
Definition md4.c:54

References r, and x.

◆ __ffsll()

int __ffsll ( long long x)

References x.

◆ __ffsl()

int __ffsl ( long x)

References x.

◆ __flsll()

int __flsll ( long long x)

References x.

◆ __flsl()

int __flsl ( long x)

References x.

◆ strcasecmp()

int __pure strcasecmp ( const char * first,
const char * second )

Compare case-insensitive strings.

Parameters
firstFirst string
secondSecond string
Return values
diffDifference

Definition at line 209 of file string.c.

209 {
210
211 return strncasecmp ( first, second, ~( ( size_t ) 0 ) );
212}
uint32_t first
First block in range.
Definition pccrr.h:1
int strncasecmp(const char *first, const char *second, size_t max)
Compare case-insensitive strings.
Definition string.c:222

References first, and strncasecmp().

Referenced by com32_identify(), comboot_identify(), efi_block_label(), efi_file_find(), efi_file_open(), efi_local_check_volume_name(), efi_snp_hii_fetch(), efi_snp_hii_store(), http_authentication(), http_digest_authenticate(), http_format_metadata_flavor(), http_parse_connection(), http_parse_content_encoding(), http_parse_digest_auth(), http_parse_header(), http_parse_transfer_encoding(), http_scheme(), parse_fc_els_handler(), string_test_exec(), sundance_probe(), tftp_process_option(), uart_find(), and xfer_uri_opener().

◆ strncasecmp()

int __pure strncasecmp ( const char * first,
const char * second,
size_t max )

Compare case-insensitive strings.

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

Definition at line 222 of file string.c.

222 {
223 const uint8_t *first_bytes = ( ( const uint8_t * ) first );
224 const uint8_t *second_bytes = ( ( const uint8_t * ) second );
225 int diff;
226
227 for ( ; max-- ; first_bytes++, second_bytes++ ) {
228 diff = ( toupper ( *first_bytes ) -
229 toupper ( *second_bytes ) );
230 if ( diff )
231 return diff;
232 if ( ! *first_bytes )
233 return 0;
234 }
235 return 0;
236}
unsigned char uint8_t
Definition stdint.h:10
#define max(x, y)
Definition ath.h:41
static int toupper(int character)
Convert character to upper case.
Definition ctype.h:121

References first, max, and toupper().

Referenced by efi_file_open(), strcasecmp(), string_test_exec(), and x509_check_dnsname().

Variable Documentation

◆ dest

void* dest

Definition at line 177 of file strings.h.

◆ len

size_t len
Initial value:
{
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" retur dest)
Definition string.h:151
static const void * src
Definition string.h:48
ring len
Length.
Definition dwmac.h:226
void * memmove(void *dest, const void *src, size_t len) __nonnull

Definition at line 177 of file strings.h.