aboutsummaryrefslogtreecommitdiff
path: root/project/dclib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--project/dclib/dclib-basics.c134
-rw-r--r--project/dclib/dclib-basics.h57
-rw-r--r--project/dclib/dclib-cli.c2
-rw-r--r--project/dclib/dclib-color.c100
-rw-r--r--project/dclib/dclib-color.h14
-rw-r--r--project/dclib/dclib-debug.c2
-rw-r--r--project/dclib/dclib-debug.h2
-rw-r--r--project/dclib/dclib-file.c141
-rw-r--r--project/dclib/dclib-file.h19
-rw-r--r--project/dclib/dclib-gen-ui.h2
-rw-r--r--project/dclib/dclib-gen-ui.inc2
-rw-r--r--project/dclib/dclib-mysql.c2
-rw-r--r--project/dclib/dclib-mysql.h2
-rw-r--r--project/dclib/dclib-network-linux.c2
-rw-r--r--project/dclib/dclib-network-linux.h2
-rw-r--r--project/dclib/dclib-network.c2
-rw-r--r--project/dclib/dclib-network.h2
-rw-r--r--project/dclib/dclib-numeric.c2
-rw-r--r--project/dclib/dclib-numeric.h2
-rw-r--r--project/dclib/dclib-option.c2
-rw-r--r--project/dclib/dclib-option.h2
-rw-r--r--project/dclib/dclib-regex.c2
-rw-r--r--project/dclib/dclib-regex.h2
-rw-r--r--project/dclib/dclib-shift-jis.c2
-rw-r--r--project/dclib/dclib-system.h2
-rw-r--r--project/dclib/dclib-tables.c2
-rw-r--r--project/dclib/dclib-types.h2
-rw-r--r--project/dclib/dclib-ui.c2
-rw-r--r--project/dclib/dclib-ui.h2
-rw-r--r--project/dclib/dclib-utf8.c2
-rw-r--r--project/dclib/dclib-utf8.h2
-rw-r--r--project/dclib/dclib-vector.c2
-rw-r--r--project/dclib/dclib-xdump.c2
-rw-r--r--project/dclib/dclib-xdump.h2
-rw-r--r--project/dclib/lib-bmg.c2
-rw-r--r--project/dclib/lib-bmg.h2
-rw-r--r--project/dclib/lib-dol.c6
-rw-r--r--project/dclib/lib-dol.h2
-rw-r--r--project/dclib/lib-mkw.c2
-rw-r--r--project/dclib/lib-mkw.h2
40 files changed, 433 insertions, 104 deletions
diff --git a/project/dclib/dclib-basics.c b/project/dclib/dclib-basics.c
index 2622765..7504951 100644
--- a/project/dclib/dclib-basics.c
+++ b/project/dclib/dclib-basics.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
@@ -551,6 +551,38 @@ char * StringLowerS ( char * buf, size_t buf_size, ccp src )
return StringLowerE(buf,buf+buf_size,src);
}
+//-----------------------------------------------------------------------------
+
+char * MemLowerE ( char * buf, ccp buf_end, mem_t src )
+{
+ // RESULT: end of copied string pointing to NULL
+ // 'src.ptr' may be a NULL pointer.
+
+ if ( buf >= buf_end )
+ return (char*)buf_end - 1;
+
+ DASSERT(buf);
+ DASSERT(buf<buf_end);
+ buf_end--;
+
+ if ( src.ptr )
+ {
+ ccp src_end = src.ptr + src.len;
+ while( buf < buf_end && src.ptr < src_end )
+ *buf++ = tolower((int)*src.ptr++);
+ }
+
+ *buf = 0;
+ return buf;
+}
+
+//-----------------------------------------------------------------------------
+
+char * MemLowerS ( char * buf, size_t buf_size, mem_t src )
+{
+ return MemLowerE(buf,buf+buf_size,src);
+}
+
///////////////////////////////////////////////////////////////////////////////
char * StringUpperE ( char * buf, ccp buf_end, ccp src )
@@ -580,6 +612,38 @@ char * StringUpperS ( char * buf, size_t buf_size, ccp src )
return StringUpperE(buf,buf+buf_size,src);
}
+//-----------------------------------------------------------------------------
+
+char * MemUpperE ( char * buf, ccp buf_end, mem_t src )
+{
+ // RESULT: end of copied string pointing to NULL
+ // 'src.ptr' may be a NULL pointer.
+
+ if ( buf >= buf_end )
+ return (char*)buf_end - 1;
+
+ DASSERT(buf);
+ DASSERT(buf<buf_end);
+ buf_end--;
+
+ if ( src.ptr )
+ {
+ ccp src_end = src.ptr + src.len;
+ while( buf < buf_end && src.ptr < src_end )
+ *buf++ = toupper((int)*src.ptr++);
+ }
+
+ *buf = 0;
+ return buf;
+}
+
+//-----------------------------------------------------------------------------
+
+char * MemUpperS ( char * buf, size_t buf_size, mem_t src )
+{
+ return MemUpperE(buf,buf+buf_size,src);
+}
+
//
///////////////////////////////////////////////////////////////////////////////
/////////////// PathCat*() ///////////////
@@ -4775,6 +4839,63 @@ ccp GetKeywordOffAutoOn ( OffOn_t value )
//
///////////////////////////////////////////////////////////////////////////////
+/////////////// LOWER/AUTO/UPPER ///////////////
+///////////////////////////////////////////////////////////////////////////////
+
+const KeywordTab_t KeyTab_LOWER_AUTO_UPPER[] =
+{
+ { LOUP_LOWER, "LOWER", "LOWERCASE", 0 },
+ { LOUP_LOWER, "LOCASE", "-1", 0 },
+ { LOUP_AUTO, "AUTO", "0", 0 },
+ { LOUP_UPPER, "UPPER", "UPPERCASE", 0 },
+ { LOUP_UPPER, "UPCASE", "1", 0 },
+ { 0,0,0,0 }
+};
+
+//-----------------------------------------------------------------------------
+
+int ScanKeywordLowerAutoUpper
+(
+ // returns one of LOUP_*
+
+ ccp arg, // argument to scan
+ int on_empty, // return this value on empty
+ uint max_num, // >0: additionally accept+return number <= max_num
+ ccp object // NULL (silent) or object for error messages
+)
+{
+ if ( !arg || !*arg )
+ return on_empty;
+
+ int status;
+ const KeywordTab_t *key = ScanKeyword(&status,arg,KeyTab_LOWER_AUTO_UPPER);
+ if (key)
+ return key->id;
+
+ if ( max_num > 0 )
+ {
+ char *end;
+ const int num = str2l(arg,&end,10);
+ if ( !*end && num >= LOUP_LOWER && num <= max_num )
+ return num;
+ }
+
+ if (object)
+ PrintKeywordError(KeyTab_LOWER_AUTO_UPPER,arg,status,0,object);
+
+ return LOUP_ERROR;
+}
+
+//-----------------------------------------------------------------------------
+
+ccp GetKeywordLowerAutoUpper ( LowerUpper_t value )
+{
+ const KeywordTab_t *key = GetKewordById(KeyTab_OFF_AUTO_ON,value);
+ return key ? key->name1 : "?";
+}
+
+//
+///////////////////////////////////////////////////////////////////////////////
/////////////// scan command lists ///////////////
///////////////////////////////////////////////////////////////////////////////
@@ -7777,6 +7898,17 @@ void * dc_memrchr ( cvp src, int ch, size_t size )
return 0;
}
+///////////////////////////////////////////////////////////////////////////////
+
+bool IsMemConst ( cvp mem, uint size, u8 val )
+{
+ if (!size)
+ return true;
+
+ const u8 *src = (u8*)mem;
+ return *src == val && !memcmp(src,src+1,size-1);
+}
+
//
///////////////////////////////////////////////////////////////////////////////
/////////////// END ///////////////
diff --git a/project/dclib/dclib-basics.h b/project/dclib/dclib-basics.h
index fd0b1a9..c5395f6 100644
--- a/project/dclib/dclib-basics.h
+++ b/project/dclib/dclib-basics.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
@@ -1235,10 +1235,15 @@ static inline char * StringCopySMem ( char * buf, size_t bufsize, mem_t mem )
static inline char * StringCopyEMem ( char * buf, ccp buf_end, mem_t mem )
{ return StringCopyEM(buf,buf_end,mem.ptr,mem.len); }
-char * StringLowerS ( char * buf, size_t bufsize, ccp src );
-char * StringLowerE ( char * buf, ccp buf_end, ccp src );
-char * StringUpperS ( char * buf, size_t bufsize, ccp src );
-char * StringUpperE ( char * buf, ccp buf_end, ccp src );
+char * StringLowerS ( char * buf, size_t bufsize, ccp src );
+char * StringLowerE ( char * buf, ccp buf_end, ccp src );
+char * StringUpperS ( char * buf, size_t bufsize, ccp src );
+char * StringUpperE ( char * buf, ccp buf_end, ccp src );
+
+char * MemLowerE ( char * buf, ccp buf_end, mem_t src );
+char * MemLowerS ( char * buf, size_t bufsize, mem_t src );
+char * MemUpperE ( char * buf, ccp buf_end, mem_t src );
+char * MemUpperS ( char * buf, size_t bufsize, mem_t src );
// special handling for unsigned decimals
int StrNumCmp ( ccp a, ccp b );
@@ -2050,7 +2055,7 @@ void PutLines
int first_line, // length without prefix of already printed first line
ccp prefix, // NULL or prefix for each line
ccp text, // text to print
- ccp eol // End Of Line test. If NULL -> LF
+ ccp eol // End-Of-Line text. If NULL -> LF
);
void PrintArgLines
@@ -2113,7 +2118,7 @@ uint PutColoredLines
int indent, // indent of output
int fw, // field width; indent+prefix+eol don't count
ccp prefix, // NULL or prefix for each line
- ccp eol, // End Of Line test. If NULL -> LF
+ ccp eol, // End-Of-Line text. If NULL -> LF
ccp text // text to print
);
@@ -2126,7 +2131,7 @@ uint PrintArgColoredLines
int indent, // indent of output
int fw, // field width; indent+prefix+eol don't count
ccp prefix, // NULL or prefix for each line
- ccp eol, // End Of Line test. If NULL -> LF
+ ccp eol, // End-Of-Line text. If NULL -> LF
ccp format, // format string for vsnprintf()
va_list arg // parameters for 'format'
);
@@ -2140,7 +2145,7 @@ uint PrintColoredLines
int indent, // indent of output
int fw, // field width; indent+prefix+eol don't count
ccp prefix, // NULL or prefix for each line
- ccp eol, // End Of Line test. If NULL -> LF
+ ccp eol, // End-Of-Line text. If NULL -> LF
ccp format, // format string for vsnprintf()
... // arguments for 'vsnprintf(format,...)'
)
@@ -2725,7 +2730,7 @@ enumError Command_COLORS
uint format // output format => see PrintColorSetEx()
);
-
+//
///////////////////////////////////////////////////////////////////////////////
/////////////// OFF/AUTO/ON/FORCE ///////////////
///////////////////////////////////////////////////////////////////////////////
@@ -2755,7 +2760,36 @@ int ScanKeywordOffAutoOn
ccp GetKeywordOffAutoOn ( OffOn_t value );
-// //
+//
+///////////////////////////////////////////////////////////////////////////////
+/////////////// LOWER/AUTO/UPPER ///////////////
+///////////////////////////////////////////////////////////////////////////////
+// [[LowerUpper_t]]
+
+typedef enum LowerUpper_t
+{
+ LOUP_ERROR = -99,
+ LOUP_LOWER = -1,
+ LOUP_AUTO = 0,
+ LOUP_UPPER = 1,
+}
+LowerUpper_t;
+
+extern const KeywordTab_t KeyTab_LOWER_AUTO_UPPER[];
+
+int ScanKeywordLowerAutoUpper
+(
+ // returns one of LOUP_*
+
+ ccp arg, // argument to scan
+ int on_empty, // return this value on empty
+ uint max_num, // >0: additionally accept+return number <= max_num
+ ccp object // NULL (silent) or object for error messages
+);
+
+ccp GetKeywordLowerAutoUpper ( LowerUpper_t value );
+
+//
///////////////////////////////////////////////////////////////////////////////
/////////////// scan command lists ///////////////
///////////////////////////////////////////////////////////////////////////////
@@ -5525,6 +5559,7 @@ static inline char * snprintfE ( char *buf, char *end, ccp format, ... )
///////////////////////////////////////////////////////////////////////////////
void * dc_memrchr ( cvp src, int ch, size_t size );
+bool IsMemConst ( cvp mem, uint size, u8 val );
#ifdef __APPLE__
#define memrchr dc_memrchr
diff --git a/project/dclib/dclib-cli.c b/project/dclib/dclib-cli.c
index 24fed39..d2b16f3 100644
--- a/project/dclib/dclib-cli.c
+++ b/project/dclib/dclib-cli.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-color.c b/project/dclib/dclib-color.c
index 19c49fb..00f275f 100644
--- a/project/dclib/dclib-color.c
+++ b/project/dclib/dclib-color.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
@@ -178,7 +178,7 @@ void PutLines
int first_line, // length without prefix of already printed first line
ccp prefix, // NULL or prefix for each line
ccp text, // text to print
- ccp eol // End Of Line test. If NULL -> LF
+ ccp eol // End-Of-Line text. If NULL -> LF
)
{
DASSERT(f);
@@ -339,7 +339,7 @@ uint PutColoredLines
int indent, // indent of output
int fw, // field width; indent+prefix+eol don't count
ccp prefix, // NULL or prefix for each line
- ccp eol, // End Of Line test. If NULL -> LF
+ ccp eol, // End-Of-Line text. If NULL -> LF
ccp text // text to print
)
{
@@ -629,7 +629,7 @@ uint PrintArgColoredLines
int indent, // indent of output
int fw, // field width; indent+prefix+eol don't count
ccp prefix, // NULL or prefix for each line
- ccp eol, // End Of Line test. If NULL -> LF
+ ccp eol, // End-Of-Line text. If NULL -> LF
ccp format, // format string for vsnprintf()
va_list arg // parameters for 'format'
)
@@ -670,7 +670,7 @@ uint PrintColoredLines
int indent, // indent of output
int fw, // field width; indent+prefix+eol don't count
ccp prefix, // NULL or prefix for each line
- ccp eol, // End Of Line test. If NULL -> LF
+ ccp eol, // End-Of-Line text. If NULL -> LF
ccp format, // format string for vsnprintf()
... // arguments for 'vsnprintf(format,...)'
)
@@ -1003,7 +1003,11 @@ uint stdout_seq_count = 0;
///////////////////////////////////////////////////////////////////////////////
uint opt_width = 0;
+uint opt_max_width = 0;
uint opt_height = 0;
+uint opt_max_height = 0;
+
+//-----------------------------------------------------------------------------
int ScanOptWidth ( ccp arg )
{
@@ -1021,6 +1025,24 @@ int ScanOptWidth ( ccp arg )
);
}
+int ScanOptMaxWidth ( ccp arg )
+{
+ return ERR_OK != ScanSizeOptU32(
+ &opt_max_width, // u32 * num
+ arg, // ccp source
+ 1, // default_factor1
+ 0, // int force_base
+ "max-width", // ccp opt_name
+ 40, // u64 min
+ 10000, // u64 max
+ 1, // u32 multiple
+ 0, // u32 pow2
+ true // bool print_err
+ );
+}
+
+//-----------------------------------------------------------------------------
+
int ScanOptHeight ( ccp arg )
{
return ERR_OK != ScanSizeOptU32(
@@ -1037,13 +1059,30 @@ int ScanOptHeight ( ccp arg )
);
}
+int ScanOptMaxHeight ( ccp arg )
+{
+ return ERR_OK != ScanSizeOptU32(
+ &opt_max_height, // u32 * num
+ arg, // ccp source
+ 1, // default_factor1
+ 0, // int force_base
+ "max-height", // ccp opt_name
+ 40, // u64 min
+ 10000, // u64 max
+ 1, // u32 multiple
+ 0, // u32 pow2
+ true // bool print_err
+ );
+}
+
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
term_size_t GetTermSize ( int default_width, int default_height )
{
- TRACE("GetTermWidth(%d,%d) opt=%d,%d\n",
- default_width, default_height, opt_width, opt_height );
+ PRINT1("GetTermWidth(%d,%d) opt=%d,%d, max=%d,%d\n",
+ default_width, default_height,
+ opt_width, opt_height, opt_max_width, opt_max_height );
term_size_t ts;
if ( opt_width > 0 && opt_height > 0 )
@@ -1054,10 +1093,16 @@ term_size_t GetTermSize ( int default_width, int default_height )
else
{
ts = GetTermSizeFD(STDOUT_FILENO,default_width,default_height);
- if ( opt_width > 0 )
+
+ if ( opt_width > 0 )
ts.width = opt_width;
- if ( opt_height > 0 )
+ else if ( opt_max_width > 0 && ts.width > opt_max_width )
+ ts.width = opt_max_width;
+
+ if ( opt_height > 0 )
ts.height = opt_height;
+ else if ( opt_max_height > 0 && ts.height > opt_max_height )
+ ts.height = opt_max_height;
}
return ts;
@@ -1125,11 +1170,8 @@ int GetTermWidth ( int default_value, int min_value )
{
TRACE("GetTermWidth(%d,%d) opt=%d\n",default_value,min_value,opt_width);
- int term_width = opt_width > 0
- ? opt_width
- : GetTermWidthFD(STDOUT_FILENO,-1,min_value);
-
- return term_width > 0 ? term_width : default_value;
+ const term_size_t ts = GetTermSize(default_value,25);
+ return ts.width > min_value ? ts.width : min_value;
}
///////////////////////////////////////////////////////////////////////////////
@@ -1138,7 +1180,7 @@ int GetTermWidthFD ( int fd, int default_value, int min_value )
{
TRACE("GetTermWidthFD(%d,%d,%d)\n",fd,default_value,min_value);
- term_size_t ts = GetTermSizeFD(fd,default_value,25);
+ const term_size_t ts = GetTermSizeFD(fd,default_value,25);
return ts.width > min_value ? ts.width : min_value;
}
@@ -1149,11 +1191,8 @@ int GetTermHeight ( int default_value, int min_value )
{
TRACE("GetTermHeight(%d,%d) opt=%d\n",default_value,min_value,opt_height);
- int term_height = opt_height > 0
- ? opt_height
- : GetTermHeightFD(STDOUT_FILENO,-1,min_value);
-
- return term_height > 0 ? term_height : default_value;
+ const term_size_t ts = GetTermSize(80,default_value);
+ return ts.width > min_value ? ts.width : min_value;
}
///////////////////////////////////////////////////////////////////////////////
@@ -1162,7 +1201,7 @@ int GetTermHeightFD ( int fd, int default_value, int min_value )
{
TRACE("GetTermHeightFD(%d,%d,%d)\n",fd,default_value,min_value);
- term_size_t ts = GetTermSizeFD(fd,default_value,25);
+ const term_size_t ts = GetTermSizeFD(fd,80,default_value);
return ts.height > min_value ? ts.height : min_value;
}
@@ -3051,6 +3090,8 @@ const ColorSet_t * GetColorSet0()
const ColorSet_t * GetColorSet8()
{
+ // [[new-color]]
+
static ColorSet_t col = {0};
if (!col.col_mode)
{
@@ -3078,6 +3119,7 @@ const ColorSet_t * GetColorSet8()
col.debug = STRDUP(GetTextMode(1,TTM_COL_DEBUG));
col.log = STRDUP(GetTextMode(1,TTM_COL_LOG));
col.name = STRDUP(GetTextMode(1,TTM_COL_NAME));
+ col.op = STRDUP(GetTextMode(1,TTM_COL_OP));
col.value = STRDUP(GetTextMode(1,TTM_COL_VALUE));
col.success = STRDUP(GetTextMode(1,TTM_COL_SUCCESS));
col.error = STRDUP(GetTextMode(1,TTM_COL_ERROR));
@@ -3154,6 +3196,8 @@ const ColorSet_t * GetColorSet8()
const ColorSet_t * GetColorSet256()
{
+ // [[new-color]]
+
static ColorSet_t col = {0};
if (!col.col_mode)
{
@@ -3358,6 +3402,7 @@ ccp GetColorByName ( const ColorSet_t *colset, ccp name )
static const struct cdef_t tab[] =
{
+ // [[new-color]]
DEF1(abort)
DEF1(b_black)
DEF1(b_blue)
@@ -3410,6 +3455,7 @@ ccp GetColorByName ( const ColorSet_t *colset, ccp name )
DEF1(name)
DEF1(off)
DEF1(on)
+ DEF1(op)
DEF1(open)
DEF2(opt,option)
DEF1(option)
@@ -3505,6 +3551,8 @@ void PrintColorSetHelper
// 16: include alternative names too (e.g. HL)
)
{
+ // [[new-color]]
+
DASSERT(f);
DASSERT(func);
@@ -3583,6 +3631,7 @@ void PrintColorSetHelper
JOB1(4,log);
JOB1(4,name);
+ JOB1(4,op);
JOB1(4,value); if (alt) JOB2(12,val,value);
JOB1(4,success);
JOB1(4,error);
@@ -3698,12 +3747,14 @@ static void PrintColorSetPHP
{
DASSERT(col_string);
+ fprintf(f," $COL->%s%.*s= ", col_name, (29-(int)strlen(col_name))/8, Tabs20 );
+
char buf[50];
PrintEscapedString(buf,sizeof(buf),col_string,-1,CHMD_ESC,0,0);
if (memcmp(buf,"\\x1B",4))
- fprintf(f,"$COL->%-15s = \"%s\";\n",col_name,buf);
+ fprintf(f,"\"%s\";\n",buf);
else
- fprintf(f,"$COL->%-15s = \"\\033%s\";\n",col_name,buf+4);
+ fprintf(f,"\"\\033%s\";\n",buf+4);
}
}
@@ -4181,6 +4232,8 @@ static void ViewColorsPredef_helper
void ViewColorsPredef ( ColorView_t *cv, uint mode )
{
+ // [[new-color]]
+
DASSERT(cv);
SetupColorView(cv);
DASSERT(cv->colset);
@@ -4226,6 +4279,7 @@ void ViewColorsPredef ( ColorView_t *cv, uint mode )
JOB1(log);
JOB1(name);
+ JOB1(op);
JOB1(value); if (alt) JOB2(val,value);
JOB1(success);
JOB1(error);
diff --git a/project/dclib/dclib-color.h b/project/dclib/dclib-color.h
index c18de42..2661748 100644
--- a/project/dclib/dclib-color.h
+++ b/project/dclib/dclib-color.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
@@ -129,9 +129,11 @@ typedef struct term_size_t
}
term_size_t;
-extern uint opt_width, opt_height;
-int ScanOptWidth ( ccp arg );
-int ScanOptHeight ( ccp arg );
+extern uint opt_width, opt_max_width, opt_height, opt_max_height;
+int ScanOptWidth ( ccp arg );
+int ScanOptMaxWidth ( ccp arg );
+int ScanOptHeight ( ccp arg );
+int ScanOptMaxHeight ( ccp arg );
term_size_t GetTermSize ( int default_width, int default_height );
term_size_t GetTermSizeFD ( int fd, int default_width, int default_height );
@@ -272,6 +274,7 @@ typedef enum TermTextMode_t
//--- and her are some recommendations for unique colors
//--- these Colors are also used to setup 'ColorSet_t'
+ // [[new-color]]
TTM_COL_SETUP = TTM_BOLD | TTM_BLUE | TTM_BG_BLACK,
TTM_COL_RUN = TTM_BOLD | TTM_WHITE | TTM_BG_BLACK,
@@ -290,6 +293,7 @@ typedef enum TermTextMode_t
TTM_COL_LOG = TTM_BOLD | TTM_WHITE | TTM_BG_BLUE,
TTM_COL_NAME = TTM_NO_BOLD | TTM_CYAN | TTM_BG_BLACK,
+ TTM_COL_OP = TTM_BOLD | TTM_WHITE | TTM_BG_BLACK,
TTM_COL_VALUE = TTM_NO_BOLD | TTM_GREEN | TTM_BG_BLACK,
TTM_COL_SUCCESS = TTM_BOLD | TTM_GREEN | TTM_BG_BLACK,
TTM_COL_ERROR = TTM_NO_BOLD | TTM_BLACK | TTM_BG_YELLOW,
@@ -444,6 +448,7 @@ typedef struct ColorSet_t
ccp lf; // pointer to 'EmptyString' or to 'LF20';
//--- data, always begins with 'reset'
+ // [[new-color]]
ccp reset;
@@ -464,6 +469,7 @@ typedef struct ColorSet_t
ccp log;
ccp name;
+ ccp op;
ccp value;
ccp success;
ccp error;
diff --git a/project/dclib/dclib-debug.c b/project/dclib/dclib-debug.c
index f6a474f..9dfbd5e 100644
--- a/project/dclib/dclib-debug.c
+++ b/project/dclib/dclib-debug.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-debug.h b/project/dclib/dclib-debug.h
index cec834f..2fc6e77 100644
--- a/project/dclib/dclib-debug.h
+++ b/project/dclib/dclib-debug.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-file.c b/project/dclib/dclib-file.c
index 81fa6bf..333ec3a 100644
--- a/project/dclib/dclib-file.c
+++ b/project/dclib/dclib-file.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
@@ -204,7 +204,12 @@ FileAttrib_t * ClearFileAttrib
dest->atime.tv_nsec =
dest->mtime.tv_nsec =
dest->ctime.tv_nsec =
- dest->itime.tv_nsec = UTIME_OMIT;
+ dest->itime.tv_nsec =
+ #ifdef UTIME_OMIT
+ UTIME_OMIT;
+ #else
+ -2;
+ #endif
}
return dest;
}
@@ -383,6 +388,8 @@ FileAttrib_t * NormalizeFileAttrib
const struct timespec null_timespec = {0,0};
+///////////////////////////////////////////////////////////////////////////////
+
int CompareTimeSpec0 ( const struct timespec *a, const struct timespec *b )
{
if (!a) a = &null_timespec;
@@ -390,6 +397,27 @@ int CompareTimeSpec0 ( const struct timespec *a, const struct timespec *b )
return CompareTimeSpec(a,b);
}
+///////////////////////////////////////////////////////////////////////////////
+
+void SetAMTimes ( ccp fname, const struct timespec times[2] )
+{
+ #ifdef UTIME_OMIT
+ utimensat(AT_FDCWD,fname,times,0);
+ #else
+ struct timeval tv[2];
+ tv[1].tv_sec = times[1].tv_sec;
+ tv[1].tv_usec = times[1].tv_nsec / 1000;
+ if (IsTimeSpecNull(times+0))
+ {
+ tv[0].tv_sec = times[0].tv_sec;
+ tv[0].tv_usec = times[0].tv_nsec / 1000;
+ }
+ else
+ tv[0] = tv[1];
+ utimes(fname,tv);
+ #endif
+}
+
//
///////////////////////////////////////////////////////////////////////////////
/////////////// simple UNIX+TCP socket connect ///////////////
@@ -791,7 +819,7 @@ enumError CloseFile
unlink(f->fname);
}
else if ( set_time == 1 && !IsTimeSpecNull(&f->fatt.mtime) )
- utimensat(AT_FDCWD,f->fname,f->fatt.times,0);
+ SetAMTimes(f->fname,f->fatt.times);
else if ( set_time > 1 || f->fmode & FM_TOUCH )
{
utime(f->fname,0);
@@ -5674,11 +5702,13 @@ ccp GetNamePSFF ( PrintScriptFF fform )
switch(fform)
{
case PSFF_UNKNOWN: return "TEXT";
+ case PSFF_ASSIGN: return "ASSIGN";
case PSFF_JSON: return "JSON";
case PSFF_BASH: return "BASH";
case PSFF_SH: return "SH";
case PSFF_PHP: return "PHP";
case PSFF_MAKEDOC: return "MDOC";
+ case PSFF_C: return "C";
}
return "???";
}
@@ -5700,24 +5730,35 @@ void PrintScriptHeader ( PrintScript_t *ps )
case PSFF_JSON:
if (ps->create_array)
fputs("[",ps->f);
+ ps->boc = 0;
break;
case PSFF_SH:
ps->add_index =ps->create_array;
+ ps->boc = "#";
break;
case PSFF_PHP:
if (ps->create_array)
fprintf(ps->f,"$%s = array();\n\n",ps->varname);
+ ps->boc = "#";
break;
case PSFF_MAKEDOC:
if (ps->create_array)
fprintf(ps->f,"%s = @LIST\n\n",ps->varname);
+ ps->boc = "#!";
+ break;
+
+ case PSFF_C:
+ if (ps->create_array)
+ fprintf(ps->f,"%s = @LIST\n\n",ps->varname);
+ ps->boc = "//";
break;
default:
//fputc('\n',ps->f);
+ ps->boc = "#";
break;
}
}
@@ -5759,24 +5800,26 @@ int PutScriptVars
(
PrintScript_t *ps, // valid control struct
uint mode, // bit field: 1=open var, 2:close var
- ccp text // text with line of format NAME=VALUE
+ ccp text // text with lines of format NAME=VALUE
)
{
FILE * f = ps ? ps->f : 0;
if (!f)
return 0;
+ DASSERT(ps);
//--- begin of output
if ( mode & 1 )
{
+ ps->count = 0;
+
if ( ps->add_index )
snprintf( ps->prefix, sizeof(ps->prefix),
"%s_%u", ps->varname, ps->index );
else
- snprintf( ps->prefix, sizeof(ps->prefix),
- "%s", ps->varname );
+ StringCopyS( ps->prefix, sizeof(ps->prefix), ps->varname );
switch (ps->fform)
{
@@ -5801,39 +5844,79 @@ int PutScriptVars
//--- print var lines
- if (!text)
- text = "";
+ ccp ptr = text ? text : "";
+ char varbuf[200];
- uint count;
- for( count = 0; ; count++ )
+ for(;;)
{
- while ( *text && (uchar)*text <= ' ' )
- text++;
+ if ( ps->ena_empty && ps->boc )
+ {
+ while ( *ptr == ' ' || *ptr == '\t' )
+ ptr++;
+ if ( *ptr == '\n' )
+ {
+ ptr++;
+ fputc('\n',f);
+ continue;
+ }
+ }
+ else
+ while ( *ptr && (uchar)*ptr <= ' ' )
+ ptr++;
- ccp ptr = text;
+ if ( *ptr == '#' )
+ {
+ ccp comment = ++ptr;
+ while ( (uchar)*ptr >= ' ' )
+ ptr++;
+ if ( ps->ena_comments && ps->boc )
+ fprintf(f,"%s%.*s\n",ps->boc,(int)(ptr-comment),comment);
+ goto next_line;
+ }
+
+ ccp varname = ptr;
while ( *ptr && *ptr != '=' )
ptr++;
- if ( *ptr != '=' || ptr == text )
+ if ( *ptr != '=' || ptr == varname )
break;
+ const int varlen = ptr - varname;
+ if ( ps->force_case <= LOUP_LOWER )
+ {
+ MemLowerS(varbuf,sizeof(varbuf),MemByS(varname,varlen));
+ varname = varbuf;
+ }
+ else if ( ps->force_case >= LOUP_UPPER )
+ {
+ varname = MemUpperS(varbuf,sizeof(varbuf),MemByS(varname,varlen));
+ varname = varbuf;
+ }
+
ccp param = ptr++;
while ( (uchar)*ptr >= ' ' )
ptr++;
switch (ps->fform)
{
+ case PSFF_ASSIGN:
+ fprintf(f, "%.*s = %.*s\n",
+ varlen, varname,
+ (int)( ptr - param - 1 ), param+1 );
+ break;
+
case PSFF_JSON:
fprintf(f, "%s\"%.*s\":%.*s",
- count ? "," : "",
- (int)( param - text ), text,
+ ps->count ? "," : "",
+ varlen, varname,
(int)( ptr - param - 1 ), param+1 );
break;
case PSFF_BASH:
if (ps->create_array)
{
- fprintf(f, "%s_%.*s%s=(%.*s)\n", ps->prefix,
- (int)( param - text ), text,
+ fprintf(f, "%s_%.*s%s=(%.*s)\n",
+ ps->prefix,
+ varlen, varname,
ps->index ? "+" : "",
(int)( ptr - param - 1 ), param+1 );
break;
@@ -5841,31 +5924,39 @@ int PutScriptVars
// fall through
case PSFF_SH:
- fprintf(f, "%s_%.*s=%.*s\n", ps->prefix,
- (int)( param - text ), text,
+ fprintf(f, "%s_%.*s=%.*s\n",
+ ps->prefix,
+ varlen, varname,
(int)( ptr - param - 1 ), param+1 );
break;
case PSFF_PHP:
+ case PSFF_C:
fprintf(f, "$d->%.*s = %.*s;\n",
- (int)( param - text ), text,
+ varlen, varname,
(int)( ptr - param - 1 ), param+1 );
break;
case PSFF_MAKEDOC:
fprintf(f, "d[\"%.*s\"] = %.*s\n",
- (int)( param - text ), text,
+ varlen, varname,
(int)( ptr - param - 1 ), param+1 );
break;
default:
fprintf(f, "%20.*s = %.*s\n",
- (int)( param - text ), text,
+ varlen, varname,
(int)( ptr - param - 1 ), param+1 );
break;
}
+ ps->count++;
- text = ptr;
+ //-- skip to next line
+ next_line:
+ while ( *ptr && (uchar)*ptr <= ' ' && *ptr != '\n' )
+ ptr++;
+ if ( *ptr == '\n' )
+ ptr++;
}
@@ -5897,7 +5988,7 @@ int PutScriptVars
}
ps->index++;
- return count;
+ return ps->count;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/dclib/dclib-file.h b/project/dclib/dclib-file.h
index bce66b1..1974475 100644
--- a/project/dclib/dclib-file.h
+++ b/project/dclib/dclib-file.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
@@ -191,10 +191,14 @@ static inline int CompareTimeSpecTime ( const struct timespec *a, const time_t t
static inline bool IsTimeSpecNull ( const struct timespec *ts )
{
return !ts
- || ts->tv_nsec > 1000000000 // includes UTIME_NOW || UTIME_OMIT
+ || (unsigned long)ts->tv_nsec > 999999999 // includes UTIME_NOW and UTIME_OMIT
|| !ts->tv_nsec && !ts->tv_sec;
}
+//-----------------------------------------------------------------------------
+
+void SetAMTimes ( ccp fname, const struct timespec times[2] );
+
//
///////////////////////////////////////////////////////////////////////////////
/////////////// struct FileAttrib_t ///////////////
@@ -1336,11 +1340,13 @@ ccp PrintOpenFiles ( bool count_current ); // print to circ buffer
typedef enum PrintScriptFF
{
PSFF_UNKNOWN, // always 0
+ PSFF_ASSIGN,
PSFF_JSON,
PSFF_BASH,
PSFF_SH,
PSFF_PHP,
PSFF_MAKEDOC,
+ PSFF_C,
}
PrintScriptFF;
@@ -1354,11 +1360,16 @@ typedef struct PrintScript_t
FILE *f; // valid output file
PrintScriptFF fform; // output: file format
ccp varname; // valid ponter to var name
+ LowerUpper_t force_case; // change case of var names if not LOUP_AUTO
bool create_array; // true: create ar arrays
bool add_index; // true: add index to varname
+ bool ena_empty; // true: enable empty lines
+ bool ena_comments; // true: enable comments
+ uint count; // number of printed records (used for seoarators)
uint index; // index for array operations
char sep[2]; // separator for JSON
- char prefix[100]; // varname prefix
+ char prefix[100]; // var name prefix
+ ccp boc; // begin of comment
}
PrintScript_t;
@@ -1379,7 +1390,7 @@ int PutScriptVars
(
PrintScript_t *ps, // valid control struct
uint mode, // bit field: 1=open var, 2:close var
- ccp text // text with line of format NAME=VALUE
+ ccp text // text with lines of format NAME=VALUE
);
int PrintScriptVars
diff --git a/project/dclib/dclib-gen-ui.h b/project/dclib/dclib-gen-ui.h
index 482cadd..81314fa 100644
--- a/project/dclib/dclib-gen-ui.h
+++ b/project/dclib/dclib-gen-ui.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-gen-ui.inc b/project/dclib/dclib-gen-ui.inc
index a35f540..4cbc594 100644
--- a/project/dclib/dclib-gen-ui.inc
+++ b/project/dclib/dclib-gen-ui.inc
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-mysql.c b/project/dclib/dclib-mysql.c
index e3ee297..a378c7d 100644
--- a/project/dclib/dclib-mysql.c
+++ b/project/dclib/dclib-mysql.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-mysql.h b/project/dclib/dclib-mysql.h
index 3fdb617..c251fda 100644
--- a/project/dclib/dclib-mysql.h
+++ b/project/dclib/dclib-mysql.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-network-linux.c b/project/dclib/dclib-network-linux.c
index b913aa4..9116588 100644
--- a/project/dclib/dclib-network-linux.c
+++ b/project/dclib/dclib-network-linux.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-network-linux.h b/project/dclib/dclib-network-linux.h
index bd3cb79..9366191 100644
--- a/project/dclib/dclib-network-linux.h
+++ b/project/dclib/dclib-network-linux.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-network.c b/project/dclib/dclib-network.c
index 15fdf0d..6e1e542 100644
--- a/project/dclib/dclib-network.c
+++ b/project/dclib/dclib-network.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-network.h b/project/dclib/dclib-network.h
index 58076c9..1f89690 100644
--- a/project/dclib/dclib-network.h
+++ b/project/dclib/dclib-network.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-numeric.c b/project/dclib/dclib-numeric.c
index d39567b..0f7a444 100644
--- a/project/dclib/dclib-numeric.c
+++ b/project/dclib/dclib-numeric.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-numeric.h b/project/dclib/dclib-numeric.h
index 19fefda..dc4ccef 100644
--- a/project/dclib/dclib-numeric.h
+++ b/project/dclib/dclib-numeric.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-option.c b/project/dclib/dclib-option.c
index 9dc07b7..6af1589 100644
--- a/project/dclib/dclib-option.c
+++ b/project/dclib/dclib-option.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-option.h b/project/dclib/dclib-option.h
index d293b9e..f16dd7b 100644
--- a/project/dclib/dclib-option.h
+++ b/project/dclib/dclib-option.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-regex.c b/project/dclib/dclib-regex.c
index d9bdf99..5d3d0aa 100644
--- a/project/dclib/dclib-regex.c
+++ b/project/dclib/dclib-regex.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-regex.h b/project/dclib/dclib-regex.h
index 9c8484d..0a31998 100644
--- a/project/dclib/dclib-regex.h
+++ b/project/dclib/dclib-regex.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-shift-jis.c b/project/dclib/dclib-shift-jis.c
index 13c5a93..fd7d692 100644
--- a/project/dclib/dclib-shift-jis.c
+++ b/project/dclib/dclib-shift-jis.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-system.h b/project/dclib/dclib-system.h
index e1f8264..9a3dc5f 100644
--- a/project/dclib/dclib-system.h
+++ b/project/dclib/dclib-system.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-tables.c b/project/dclib/dclib-tables.c
index 7206f6a..508d1c0 100644
--- a/project/dclib/dclib-tables.c
+++ b/project/dclib/dclib-tables.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-types.h b/project/dclib/dclib-types.h
index 360c026..41ffbf9 100644
--- a/project/dclib/dclib-types.h
+++ b/project/dclib/dclib-types.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-ui.c b/project/dclib/dclib-ui.c
index 02f56c9..ab75d67 100644
--- a/project/dclib/dclib-ui.c
+++ b/project/dclib/dclib-ui.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-ui.h b/project/dclib/dclib-ui.h
index 1b45d43..42171d9 100644
--- a/project/dclib/dclib-ui.h
+++ b/project/dclib/dclib-ui.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-utf8.c b/project/dclib/dclib-utf8.c
index af11a68..29a7f81 100644
--- a/project/dclib/dclib-utf8.c
+++ b/project/dclib/dclib-utf8.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-utf8.h b/project/dclib/dclib-utf8.h
index 2e3e79b..adea8dc 100644
--- a/project/dclib/dclib-utf8.h
+++ b/project/dclib/dclib-utf8.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-vector.c b/project/dclib/dclib-vector.c
index 070d719..233e7ef 100644
--- a/project/dclib/dclib-vector.c
+++ b/project/dclib/dclib-vector.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-xdump.c b/project/dclib/dclib-xdump.c
index b860b62..df2f7f9 100644
--- a/project/dclib/dclib-xdump.c
+++ b/project/dclib/dclib-xdump.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/dclib-xdump.h b/project/dclib/dclib-xdump.h
index f58ee29..06f602b 100644
--- a/project/dclib/dclib-xdump.h
+++ b/project/dclib/dclib-xdump.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/lib-bmg.c b/project/dclib/lib-bmg.c
index 599c2dc..c1d24ce 100644
--- a/project/dclib/lib-bmg.c
+++ b/project/dclib/lib-bmg.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/lib-bmg.h b/project/dclib/lib-bmg.h
index 561348e..46cccac 100644
--- a/project/dclib/lib-bmg.h
+++ b/project/dclib/lib-bmg.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/lib-dol.c b/project/dclib/lib-dol.c
index 00d6972..cbe7a7d 100644
--- a/project/dclib/lib-dol.c
+++ b/project/dclib/lib-dol.c
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
@@ -805,13 +805,13 @@ static u32 FindDolAddress
uint off_begin, // begin search here
uint off_end, // end search here
const u8 *search, // data to search
- uint serach_size // size of 'search'
+ uint search_size // size of 'search'
)
{
while ( off_begin < off_end )
{
const u8 *res
- = memmem( data+off_begin, off_end-off_begin, search, serach_size );
+ = memmem( data+off_begin, off_end-off_begin, search, search_size );
if (!res)
return 0;
off_begin = res - data;
diff --git a/project/dclib/lib-dol.h b/project/dclib/lib-dol.h
index 3197bcc..50452e9 100644
--- a/project/dclib/lib-dol.h
+++ b/project/dclib/lib-dol.h
@@ -14,7 +14,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/lib-mkw.c b/project/dclib/lib-mkw.c
index 8ada409..bbfb316 100644
--- a/project/dclib/lib-mkw.c
+++ b/project/dclib/lib-mkw.c
@@ -15,7 +15,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *
diff --git a/project/dclib/lib-mkw.h b/project/dclib/lib-mkw.h
index 8a1c644..16f7f86 100644
--- a/project/dclib/lib-mkw.h
+++ b/project/dclib/lib-mkw.h
@@ -15,7 +15,7 @@
* *
***************************************************************************
* *
- * Copyright (c) 2012-2020 by Dirk Clemens <wiimm@wiimm.de> *
+ * Copyright (c) 2012-2021 by Dirk Clemens <wiimm@wiimm.de> *
* *
***************************************************************************
* *