RT-Thread RTOS  1.0.0
An open source embedded real-time operating system
Other useful kernel service

Defines

#define rt_list_entry(node, type, member)   ((type *)((char *)(node) - (unsigned long)(&((type *)0)->member)))

Functions

int * _rt_errno (void)
void * rt_memset (void *s, int c, rt_ubase_t count)
void * rt_memcpy (void *dst, const void *src, rt_ubase_t count)
void * rt_memmove (void *dest, const void *src, rt_ubase_t n)
rt_int32_t rt_memcmp (const void *cs, const void *ct, rt_ubase_t count)
char * rt_strstr (const char *s1, const char *s2)
rt_uint32_t rt_strcasecmp (const char *a, const char *b)
char * rt_strncpy (char *dst, const char *src, rt_ubase_t n)
rt_ubase_t rt_strncmp (const char *cs, const char *ct, rt_ubase_t count)
rt_ubase_t rt_strcmp (const char *cs, const char *ct)
rt_ubase_t rt_strlen (const char *s)
char * rt_strdup (const char *s)
void rt_show_version (void)
rt_int32_t rt_snprintf (char *buf, rt_size_t size, const char *fmt,...)
rt_int32_t rt_vsprintf (char *buf, const char *format, va_list arg_ptr)
rt_int32_t rt_sprintf (char *buf, const char *format,...)
rt_inline void rt_list_init (rt_list_t *l)
rt_inline void rt_list_insert_after (rt_list_t *l, rt_list_t *n)
rt_inline void rt_list_insert_before (rt_list_t *l, rt_list_t *n)
rt_inline void rt_list_remove (rt_list_t *n)
rt_inline int rt_list_isempty (const rt_list_t *l)

Define Documentation

#define rt_list_entry (   node,
  type,
  member 
)    ((type *)((char *)(node) - (unsigned long)(&((type *)0)->member)))

get the struct for this entry

Parameters:
nodethe entry point
typethe type of structure
memberthe name of list in structure

Function Documentation

int * _rt_errno ( void  )

This function returns errno.

Returns:
the errno in the system
void * rt_memset ( void *  s,
int  c,
rt_ubase_t  count 
)

This function will set the content of memory to specified value

Parameters:
sthe address of source memory
cthe value shall be set in content
countthe copied length
Returns:
the address of source memory
void * rt_memcpy ( void *  dst,
const void *  src,
rt_ubase_t  count 
)

This function will copy memory content from source address to destination address.

Parameters:
dstthe address of destination memory
srcthe address of source memory
countthe copied length
Returns:
the address of destination memory
void * rt_memmove ( void *  dest,
const void *  src,
rt_ubase_t  n 
)

This function will move memory content from source address to destination address.

Parameters:
destthe address of destination memory
srcthe address of source memory
nthe copied length
Returns:
the address of destination memory
rt_int32_t rt_memcmp ( const void *  cs,
const void *  ct,
rt_ubase_t  count 
)

This function will compare two areas of memory

Parameters:
csone area of memory
ctznother area of memory
countthe size of the area
Returns:
the result
char * rt_strstr ( const char *  s1,
const char *  s2 
)

This function will return the first occurrence of a string.

Parameters:
s1the source string
s2the find string
Returns:
the first occurrence of a s2 in s1, or RT_NULL if no found.
rt_uint32_t rt_strcasecmp ( const char *  a,
const char *  b 
)

This function will compare two strings while ignoring differences in case

Parameters:
athe string to be compared
bthe string to be compared
Returns:
the result
char * rt_strncpy ( char *  dst,
const char *  src,
rt_ubase_t  n 
)

This function will copy string no more than n bytes.

Parameters:
dstthe string to copy
srcthe string to be copied
nthe maximum copied length
Returns:
the result
rt_ubase_t rt_strncmp ( const char *  cs,
const char *  ct,
rt_ubase_t  count 
)

This function will compare two strings with specified maximum length

Parameters:
csthe string to be compared
ctthe string to be compared
countthe maximum compare length
Returns:
the result
rt_ubase_t rt_strcmp ( const char *  cs,
const char *  ct 
)

This function will compare two strings without specified length

Parameters:
csthe string to be compared
ctthe string to be compared
Returns:
the result
rt_ubase_t rt_strlen ( const char *  s)

This function will return the length of a string, which terminate will null character.

Parameters:
sthe string
Returns:
the length of string
char * rt_strdup ( const char *  s)

This function will duplicate a string.

Parameters:
sthe string to be duplicated
Returns:
the duplicated string pointer
void rt_show_version ( void  )

This function will show the version of rt-thread rtos

rt_int32_t rt_snprintf ( char *  buf,
rt_size_t  size,
const char *  fmt,
  ... 
)

This function will fill a formatted string to buffer

Parameters:
bufthe buffer to save formatted string
sizethe size of buffer
fmtthe format
rt_int32_t rt_vsprintf ( char *  buf,
const char *  format,
va_list  arg_ptr 
)

This function will fill a formatted string to buffer

Parameters:
bufthe buffer to save formatted string
arg_ptrthe arg_ptr
formatthe format
rt_int32_t rt_sprintf ( char *  buf,
const char *  format,
  ... 
)

This function will fill a formatted string to buffer

Parameters:
bufthe buffer to save formatted string
formatthe format
rt_inline void rt_list_init ( rt_list_t *  l)

initialize a list

Parameters:
llist to be initialized
rt_inline void rt_list_insert_after ( rt_list_t *  l,
rt_list_t *  n 
)

insert a node after a list

Parameters:
llist to insert it
nnew node to be inserted
rt_inline void rt_list_insert_before ( rt_list_t *  l,
rt_list_t *  n 
)

insert a node before a list

Parameters:
nnew node to be inserted
llist to insert it
rt_inline void rt_list_remove ( rt_list_t *  n)

remove node from list.

Parameters:
nthe node to remove from the list.
rt_inline int rt_list_isempty ( const rt_list_t *  l)

tests whether a list is empty

Parameters:
lthe list to test.
 All Data Structures Variables