gonzui


Format: Advanced Search

tkernel_2/include/libstr.hbare sourcepermlink (0.01 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by T-Engine Forum at 2014/09/10.
   11:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   12:  *
   13:  *----------------------------------------------------------------------
   14:  */
   15: 
   16: /*
   17:  *      @(#)libstr.h
   18:  *
   19:  *      Standard library for kernel link
   20:  *
   21:  */
   22: 
   23: #ifndef __LIBSTR_H__
   24: #define __LIBSTR_H__
   25: 
   26: #include <stdtype.h>
   27: 
   28: #ifdef __cplusplus
   29: extern "C" {
   30: #endif
   31: 
   32: #ifdef  __size_t
   33: typedef __size_t        size_t;
   34: #undef  __size_t
   35: #endif
   36: 
   37: #ifdef  __wchar_t
   38: typedef __wchar_t       wchar_t;
   39: #undef  __wchar_t
   40: #endif
   41: 
   42: #define NULL            0
   43: 
   44: extern void* tkl_memset( void *s, int c, size_t n );
   45: extern int tkl_memcmp( const void *s1, const void *s2, size_t n );
   46: extern void* tkl_memcpy( void *dst, const void *src, size_t n );
   47: extern void* tkl_memmove( void *dst, const void *src, size_t n );
   48: 
   49: extern size_t tkl_strlen( const char *s );
   50: extern int tkl_strcmp( const char *s1, const char *s2 );
   51: extern char* tkl_strcpy( char *dst, const char *src );
   52: extern char* tkl_strncpy( char *dst, const char *src, size_t n );
   53: extern char* tkl_strcat( char *dst, const char *src );
   54: extern char* tkl_strncat( char *dst, const char *src, size_t n );
   55: 
   56: extern unsigned long int tkl_strtoul( const char *nptr, char **endptr, int base );
   57: 
   58: #define MEMSET  tkl_memset
   59: #define MEMCMP  tkl_memcmp
   60: #define MEMCPY  tkl_memcpy
   61: #define MEMMOVE tkl_memmove
   62: #define STRLEN  tkl_strlen
   63: #define STRCMP  tkl_strcmp
   64: #define STRCPY  tkl_strcpy
   65: #define STRNCPY tkl_strncpy
   66: #define STRCAT  tkl_strcat
   67: #define STRNCAT tkl_strncat
   68: #define STRTOUL tkl_strtoul
   69: 
   70: /* Use "memcpy" of the libstr for "implicit memcpy call"
   71:         which is generated by the compiler when copying a structure. */
   72: #define use_libstr_memcpy_implicit      1
   73: 
   74: /* Use "memxxx" and "strxxx" of the libstr as standard C functions */
   75: #define use_libstr_func_as_std          0
   76: 
   77: #ifdef __cplusplus
   78: }
   79: #endif
   80: #endif /* __LIBSTR_H__ */