libcfe  0.12.1
some useful C-functions
len.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define str_len(s)   _len(s, '\0')
 Shorthand for counting '\0' terminating strings. See _len for more info. More...
 
#define line_len(s)   _len(s, '\n')
 Shorthand for counting '\n' terminating strings. See _len for more info. More...
 
#define str_ulen(s)   _ulen(s, '\0')
 Shorthand for counting '\0' terminating unsigned strings. See _ulen for more info. More...
 
#define line_ulen(s)   _ulen(s, '\n')
 Shorthand for counting '\n' terminating unsigned strings. See _ulen for more info. More...
 

Functions

int _len (const char *s, char m)
 
int _ulen (const unsigned char *s, unsigned char m)
 

Macro Definition Documentation

◆ line_len

#define line_len (   s)    _len(s, '\n')

Shorthand for counting '\n' terminating strings. See _len for more info.

Definition at line 18 of file len.h.

◆ line_ulen

#define line_ulen (   s)    _ulen(s, '\n')

Shorthand for counting '\n' terminating unsigned strings. See _ulen for more info.

Definition at line 20 of file len.h.

◆ str_len

#define str_len (   s)    _len(s, '\0')

Shorthand for counting '\0' terminating strings. See _len for more info.

Definition at line 17 of file len.h.

◆ str_ulen

#define str_ulen (   s)    _ulen(s, '\0')

Shorthand for counting '\0' terminating unsigned strings. See _ulen for more info.

Definition at line 19 of file len.h.

Function Documentation

◆ _len()

int _len ( const char *  s,
char  m 
)

Return number of characters in in a string.

Parameters
[in]sA pointer to the string.
[in]mCharacter (code) which marks the end of the string.
Returns
The number of character before till the first occurrence of 'm' is reached ('m' excluded).

Definition at line 8 of file len.c.

◆ _ulen()

int _ulen ( const unsigned char *  s,
unsigned char  m 
)

Unsigned version of _len.

Definition at line 19 of file len.c.