diff options
Diffstat (limited to '')
| -rw-r--r-- | project/dclib/dclib-basics.h | 84 |
1 files changed, 12 insertions, 72 deletions
diff --git a/project/dclib/dclib-basics.h b/project/dclib/dclib-basics.h index 5e6edc9..dd56ecb 100644 --- a/project/dclib/dclib-basics.h +++ b/project/dclib/dclib-basics.h @@ -2043,10 +2043,14 @@ FastBuf_t; FastBuf_t * InitializeFastBuf ( void * mem, uint size ); FastBuf_t * InitializeFastBufAlloc ( FastBuf_t *fb, uint size ); -void ResetFastBuf ( FastBuf_t *fb ); +void ResetFastBuf ( FastBuf_t *fb ); static inline void ClearFastBuf ( FastBuf_t *fb ) { DASSERT(fb); fb->ptr = fb->buf; } +int SetFastBufLen ( FastBuf_t *fb, uint max_size ); +static inline int GetFastBufLen ( const FastBuf_t *fb ) + { DASSERT(fb); return fb->ptr - fb->buf; } + ccp GetFastBufStatus ( const FastBuf_t *fb ); int ReserveSpaceFastBuf ( FastBuf_t *fb, uint size ); char * GetSpaceFastBuf ( FastBuf_t *fb, uint size ); @@ -2083,9 +2087,6 @@ static inline void AppendU32FastBuf ( FastBuf_t *fb, u32 num ) static inline void AppendU64FastBuf ( FastBuf_t *fb, u64 num ) { AppendFastBuf(fb,&num,sizeof(num)); } -static inline int GetFastBufLen ( const FastBuf_t *fb ) - { DASSERT(fb); return fb->ptr - fb->buf; } - //----------------------------------------------------------------------------- // The resulting strings of GetFastBufString() and GetFastBufMem0() are always // terminated by an additional NULL byte. @@ -2844,10 +2845,14 @@ typedef enum CharMode_t // select encodig/decoding method CHMD_UTF8 = 0x01, // UTF8 support enabled (compatible with legacy bool) CHMD_ESC = 0x02, // escape ESC by \e CHMD_PIPE = 0x04, // escape pipes '|' to '\!' - CHMD_IF_REQUIRED = 0x08, // check for special chars and encode only if required - CHMD__ALL = 0x0f, + CHMD_SH = 0x08, // escape for sh '...' => use "'" for ' + CHMD_BASH = 0x10, // escape for bash $'...': \ ' " (ignore CHMD_SH) + CHMD_IF_REQUIRED = 0x20, // check for special chars and encode only if required + CHMD__ALL = 0x3f, CHMD__MODERN = CHMD_UTF8 | CHMD_ESC, + CHMD__SH = CHMD_UTF8 | CHMD_ESC | CHMD_SH, + CHMD__BASH = CHMD_UTF8 | CHMD_ESC | CHMD_BASH, CHMD__PIPE8 = CHMD__MODERN | CHMD_PIPE | CHMD_IF_REQUIRED, } __attribute__ ((packed)) CharMode_t; @@ -3554,6 +3559,7 @@ typedef int (*KeywordListFuncKey) ); //----------------------------------------------------------------------------- +// [[KeyListParam_t]] typedef struct KeyListParam_t { @@ -4479,72 +4485,6 @@ enumError ScanSizeOptU32 /////////////////////////////////////////////////////////////////////////////// /////////////// time & timer /////////////// /////////////////////////////////////////////////////////////////////////////// - -//--- conversion factors - -#define SEC_PER_MIN 60 -#define SEC_PER_HOUR 3600 -#define SEC_PER_DAY 86400 -#define SEC_PER_WEEK 604800 -#define SEC_PER_MONTH 2629746 // 365.2425 * SEC_PER_DAY / 12 -#define SEC_PER_QUARTER 7889238 // 365.2425 * SEC_PER_DAY / 4 -#define SEC_PER_YEAR 31556952 // 365.2425 * SEC_PER_DAY - -#define MSEC_PER_SEC 1000ll -#define MSEC_PER_MIN (MSEC_PER_SEC*SEC_PER_MIN) -#define MSEC_PER_HOUR (MSEC_PER_SEC*SEC_PER_HOUR) -#define MSEC_PER_DAY (MSEC_PER_SEC*SEC_PER_DAY) -#define MSEC_PER_WEEK (MSEC_PER_SEC*SEC_PER_WEEK) -#define MSEC_PER_MONTH (MSEC_PER_SEC*SEC_PER_MONTH) -#define MSEC_PER_QUARTER (MSEC_PER_SEC*SEC_PER_QUARTER) -#define MSEC_PER_YEAR (MSEC_PER_SEC*SEC_PER_YEAR) - -#define USEC_PER_MSEC 1000ll -#define USEC_PER_SEC 1000000ll -#define USEC_PER_MIN (USEC_PER_SEC*SEC_PER_MIN) -#define USEC_PER_HOUR (USEC_PER_SEC*SEC_PER_HOUR) -#define USEC_PER_DAY (USEC_PER_SEC*SEC_PER_DAY) -#define USEC_PER_WEEK (USEC_PER_SEC*SEC_PER_WEEK) -#define USEC_PER_MONTH (USEC_PER_SEC*SEC_PER_MONTH) -#define USEC_PER_QUARTER (USEC_PER_SEC*SEC_PER_QUARTER) -#define USEC_PER_YEAR (USEC_PER_SEC*SEC_PER_YEAR) - -#define NSEC_PER_USEC 1000ll -#define NSEC_PER_MSEC 1000000ll -#define NSEC_PER_SEC 1000000000ll -#define NSEC_PER_MIN (NSEC_PER_SEC*SEC_PER_MIN) -#define NSEC_PER_HOUR (NSEC_PER_SEC*SEC_PER_HOUR) -#define NSEC_PER_DAY (NSEC_PER_SEC*SEC_PER_DAY) -#define NSEC_PER_WEEK (NSEC_PER_SEC*SEC_PER_WEEK) -#define NSEC_PER_MONTH (NSEC_PER_SEC*SEC_PER_MONTH) -#define NSEC_PER_QUARTER (NSEC_PER_SEC*SEC_PER_QUARTER) -#define NSEC_PER_YEAR (NSEC_PER_SEC*SEC_PER_YEAR) - - -//--- time types - -typedef uint u_sec_t; // unsigned type to store time as seconds -typedef int s_sec_t; // signed type to store time as seconds -typedef u64 u_msec_t; // unsigned type to store time as milliseconds -typedef s64 s_msec_t; // signed type to store time as milliseconds -typedef u64 u_usec_t; // unsigned type to store time as microseconds -typedef s64 s_usec_t; // signed type to store time as microseconds -typedef u64 u_nsec_t; // unsigned type to store time as nanoseconds -typedef s64 s_nsec_t; // signed type to store time as nanoseconds - - -//--- max values time types - -#define S_SEC_MAX S32_MAX -#define U_SEC_MAX U32_MAX -#define S_MSEC_MAX S64_MAX -#define U_MSEC_MAX U64_MAX -#define S_USEC_MAX S64_MAX -#define U_USEC_MAX U64_MAX -#define S_NSEC_MAX S64_MAX -#define U_NSEC_MAX U64_MAX - -//----------------------------------------------------------------------------- // [[DayTime_t]] typedef struct DayTime_t { |
