diff options
Diffstat (limited to 'zap/include/zap/mem.h')
-rw-r--r-- | zap/include/zap/mem.h | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/zap/include/zap/mem.h b/zap/include/zap/mem.h index 8646d63..4085a20 100644 --- a/zap/include/zap/mem.h +++ b/zap/include/zap/mem.h @@ -1,7 +1,7 @@ /* - Copyright 2022 Gabriel Jensen. + Copyright 2022-2023 Gabriel Jensen. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ #if !defined(zap_priv_hdr_mem) @@ -9,37 +9,21 @@ #include <zap/bs.h> -#if defined(__cplusplus) -extern "C" { -#endif +zap_priv_cdecl -typedef struct { - void * ptr; - zap_sz sz; -} zap_mem; - -__attribute__ ((hot,warn_unused_result)) zap_sz zap_memcnt( void const * ptr, zap_sz sz, zap_sz num, zap_bool (* fn)(void const *)); -__attribute__ ((hot,nothrow)) zap_sz zap_memcp( void const * in, zap_sz num, void * out); -__attribute__ ((hot,nothrow,warn_unused_result)) zap_bool zap_memeq( void const * lptr, zap_sz num, void const * rptr); -__attribute__ ((hot,nothrow)) zap_sz zap_memfill( void * ptr, zap_sz num, unsigned char val); -__attribute__ ((hot,nothrow,warn_unused_result)) zap_sz zap_memfnd( void const * ptr, zap_sz num, unsigned char byte); -__attribute__ ((hot)) void zap_memfor( void * ptr, zap_sz sz, zap_sz num, void (* fn)(void *)); -__attribute__ ((hot)) void zap_memgen( void * ptr, zap_sz sz, zap_sz num, void (* fn)(zap_sz,void *)); -__attribute__ ((hot,nothrow)) zap_sz zap_strcp( char const * in, char * out); -__attribute__ ((hot,nothrow,warn_unused_result)) zap_bool zap_streq( char const * lstr, char const * rstr); -__attribute__ ((hot,nothrow)) zap_sz zap_strfill( char * lstr, char chr); -__attribute__ ((hot,nothrow,warn_unused_result)) zap_sz zap_strfnd( char const * str, char chr); -__attribute__ ((hot,nothrow,warn_unused_result)) zap_sz zap_strlen( char const * str); -__attribute__ ((hot,nothrow,warn_unused_result)) zap_sz zap_utf20len( zap_chr20 const * utf20); -__attribute__ ((hot,nothrow)) void zap_utf8dec( zap_chr8 const * in, zap_chr20 * out); -__attribute__ ((hot,nothrow)) zap_sz zap_utf8declen(zap_chr8 const * utf8); -__attribute__ ((hot,nothrow)) void zap_utf8enc( zap_chr20 const * in, zap_chr8 * out); -__attribute__ ((hot,nothrow)) zap_sz zap_utf8enclen(zap_chr20 const * utf20); -__attribute__ ((hot,nothrow)) void zap_win1252dec(zap_chr8 const * in, zap_chr20 * out); -__attribute__ ((hot,nothrow)) void zap_win1252enc(zap_chr20 const * in, zap_chr8 * out); - -#if defined(__cplusplus) -} -#endif +void zap_cp( void * zap_priv_restr dest,void const * zap_priv_restr src, zap_sz num); +zap_bool zap_eq( void const * lbuf,void const * rbuf,zap_sz num); +void zap_fill(void * dest,zap_byte val, zap_sz num); +void * zap_srch(void const * buf, zap_byte val, zap_sz num); + +zap_sz zap_utf8declen(zap_chr8 const * buf); +zap_sz zap_utf8enclen(zap_chr02 const * buf); + +void zap_utf8dec( zap_chr02 * dest,zap_chr8 const * src); +void zap_utf8enc( zap_chr8 * dest,zap_chr02 const * src); +void zap_win1252dec(zap_chr02 * dest,zap_chr8 const * src); +void zap_win1252enc(zap_chr8 * dest,zap_chr02 const * src); + +zap_priv_cdeclend #endif |