*** empty log message ***
This commit is contained in:
16
tecs/util.h
16
tecs/util.h
@@ -49,15 +49,23 @@ int str_cmp(const char *str1, const char *str2);
|
||||
*/
|
||||
|
||||
|
||||
int str_ncpy(char *dst, const char *src, int n);
|
||||
int str_ncpy(char *dst, const char *src, int maxdest);
|
||||
/*
|
||||
same as strncpy, but dst has always a '\0' at end
|
||||
use str_copy if dst is a character array
|
||||
returns -1, if destination is to short, 0 otherwise
|
||||
copy *src to *dest, maximal maxdest characters,
|
||||
it is guaranteed, that dst contains '\0'
|
||||
*/
|
||||
|
||||
int str_ncat(char *dst, const char *src, int maxdest);
|
||||
/*
|
||||
append *src to *dest, maximal maxdest characters,
|
||||
it is guaranteed, that dst contains '\0'
|
||||
*/
|
||||
|
||||
#define str_copy(DST,SRC) str_ncpy(DST,SRC,sizeof(DST))
|
||||
#define str_append(DST,SRC) str_ncat(DST,SRC,sizeof(DST))
|
||||
/*
|
||||
use these macros if DST is an fixed length character array
|
||||
*/
|
||||
|
||||
void util_delay(int tmo_msec);
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user