aboutsummaryrefslogtreecommitdiff
path: root/project/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--project/src/lib-kmp-text.c2
-rw-r--r--project/src/lib-std.c37
-rw-r--r--project/src/lib-std.h2
-rw-r--r--project/src/lib-szs-create.c2
-rw-r--r--project/src/wbmgt.c23
-rw-r--r--project/src/wctct.c23
-rw-r--r--project/src/wimgt.c23
-rw-r--r--project/src/wkclt.c23
-rw-r--r--project/src/wkmpt.c23
-rw-r--r--project/src/wlect.c23
-rw-r--r--project/src/wmdlt.c23
-rw-r--r--project/src/wpatt.c23
-rw-r--r--project/src/wstrt.c23
-rw-r--r--project/src/wszst.c25
14 files changed, 52 insertions, 223 deletions
diff --git a/project/src/lib-kmp-text.c b/project/src/lib-kmp-text.c
index 98cf31d..6e6ab87 100644
--- a/project/src/lib-kmp-text.c
+++ b/project/src/lib-kmp-text.c
@@ -6330,7 +6330,7 @@ enumError SaveTextKMP
DASSERT(kmp);
DASSERT(fname);
- #if USE_NEW_FILEATTRIB
+ #if HAVE_FILEATTRIB_NSEC
PRINT("SaveTextKMP(%s,%d) mtime=%lu\n",fname,set_time,kmp->fatt.mtime.tv_sec);
#else
PRINT("SaveTextKMP(%s,%d) mtime=%lu\n",fname,set_time,kmp->fatt.mtime);
diff --git a/project/src/lib-std.c b/project/src/lib-std.c
index 11526cb..95e6e64 100644
--- a/project/src/lib-std.c
+++ b/project/src/lib-std.c
@@ -3773,6 +3773,43 @@ int ScanOptSort ( ccp arg )
//
///////////////////////////////////////////////////////////////////////////////
+/////////////// command version/section ///////////////
+///////////////////////////////////////////////////////////////////////////////
+
+void cmd_version_section ( bool sect_header, ccp name_short, ccp name_long )
+{
+ if (sect_header)
+ fputs("[version]\n",stdout);
+
+ const u32 base = 0x04030201;
+ const u8 * e = (u8*)&base;
+ const u32 endian = be32(e);
+
+ printf( "prog=%s\n"
+ "name=%s\n"
+ "version=" VERSION "\n"
+ "beta=%d\n"
+ "revision=" REVISION "\n"
+ "system=" SYSTEM "\n"
+ "endian=%u%u%u%u %s\n"
+ "have_nanosec=%d\n"
+ "author=" AUTHOR "\n"
+ "date=" DATE "\n"
+ "url=" URI_HOME "%s\n"
+ "\n"
+ , name_short
+ , name_long
+ , BETA_VERSION
+ , e[0], e[1], e[2], e[3]
+ , endian == 0x01020304 ? "little"
+ : endian == 0x04030201 ? "big" : "mixed"
+ , HAVE_FILEATTRIB_NSEC
+ , name_short
+ );
+}
+
+//
+///////////////////////////////////////////////////////////////////////////////
/////////////// command argtest ///////////////
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/lib-std.h b/project/src/lib-std.h
index 51e69db..ffda6b9 100644
--- a/project/src/lib-std.h
+++ b/project/src/lib-std.h
@@ -2017,6 +2017,8 @@ data_tab_t;
///////////////////////////////////////////////////////////////////////////////
+void cmd_version_section ( bool sect_header, ccp name_short, ccp name_long );
+
enumError cmd_argtest ( int argc, char ** argv );
enumError cmd_error();
enumError cmd_filetype();
diff --git a/project/src/lib-szs-create.c b/project/src/lib-szs-create.c
index 1907542..d0962ba 100644
--- a/project/src/lib-szs-create.c
+++ b/project/src/lib-szs-create.c
@@ -808,7 +808,7 @@ enumError CreateSZS
{
StringCopyE( sd.path_rel, sd.path+sizeof(sd.path), *ptr );
struct stat st;
- #if USE_NEW_FILEATTRIB
+ #if HAVE_FILEATTRIB_NSEC
if ( stat(sd.path,&st) || CompareTimeSpec(&st.st_mtim,&szs.fatt.mtime) < 0 )
#else
const time_t mtime = stat(sd.path,&st) ? 0 : st.st_mtime;
diff --git a/project/src/wbmgt.c b/project/src/wbmgt.c
index 87ba3ce..163d9cc 100644
--- a/project/src/wbmgt.c
+++ b/project/src/wbmgt.c
@@ -86,28 +86,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WBMGT_SHORT "\n"
- "name=" WBMGT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WBMGT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WBMGT_SHORT,WBMGT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wctct.c b/project/src/wctct.c
index 6f1db93..8b5d4a4 100644
--- a/project/src/wctct.c
+++ b/project/src/wctct.c
@@ -76,28 +76,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WCTCT_SHORT "\n"
- "name=" WCTCT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WCTCT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WCTCT_SHORT,WCTCT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wimgt.c b/project/src/wimgt.c
index 4acb1c1..4abd6b6 100644
--- a/project/src/wimgt.c
+++ b/project/src/wimgt.c
@@ -82,28 +82,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WIMGT_SHORT "\n"
- "name=" WIMGT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WIMGT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WIMGT_SHORT,WIMGT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wkclt.c b/project/src/wkclt.c
index 49f5742..80eed98 100644
--- a/project/src/wkclt.c
+++ b/project/src/wkclt.c
@@ -76,28 +76,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WKCLT_SHORT "\n"
- "name=" WKCLT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WKCLT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WKCLT_SHORT,WKCLT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wkmpt.c b/project/src/wkmpt.c
index b2bb4ee..1903e53 100644
--- a/project/src/wkmpt.c
+++ b/project/src/wkmpt.c
@@ -77,28 +77,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WKMPT_SHORT "\n"
- "name=" WKMPT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WKMPT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WKMPT_SHORT,WKMPT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wlect.c b/project/src/wlect.c
index 373cd27..d33c3df 100644
--- a/project/src/wlect.c
+++ b/project/src/wlect.c
@@ -78,28 +78,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WLECT_SHORT "\n"
- "name=" WLECT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WLECT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WLECT_SHORT,WLECT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wmdlt.c b/project/src/wmdlt.c
index fcfc034..868dfe7 100644
--- a/project/src/wmdlt.c
+++ b/project/src/wmdlt.c
@@ -71,28 +71,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WMDLT_SHORT "\n"
- "name=" WMDLT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WMDLT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WMDLT_SHORT,WMDLT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wpatt.c b/project/src/wpatt.c
index dbcdc7c..02ce122 100644
--- a/project/src/wpatt.c
+++ b/project/src/wpatt.c
@@ -71,28 +71,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WPATT_SHORT "\n"
- "name=" WPATT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WPATT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WPATT_SHORT,WPATT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wstrt.c b/project/src/wstrt.c
index a384f45..f2e9c89 100644
--- a/project/src/wstrt.c
+++ b/project/src/wstrt.c
@@ -83,28 +83,7 @@ static void help_exit ( bool xmode )
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WSTRT_SHORT "\n"
- "name=" WSTRT_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WSTRT_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WSTRT_SHORT,WSTRT_LONG);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/project/src/wszst.c b/project/src/wszst.c
index 7ca33f1..15100f2 100644
--- a/project/src/wszst.c
+++ b/project/src/wszst.c
@@ -177,28 +177,7 @@ static void list_compressions_exit()
static void print_version_section ( bool print_sect_header )
{
- if (print_sect_header)
- fputs("[version]\n",stdout);
-
- const u32 base = 0x04030201;
- const u8 * e = (u8*)&base;
- const u32 endian = be32(e);
-
- printf( "prog=" WSZST_SHORT "\n"
- "name=" WSZST_LONG "\n"
- "version=" VERSION "\n"
- "beta=%d\n"
- "revision=" REVISION "\n"
- "system=" SYSTEM "\n"
- "endian=%u%u%u%u %s\n"
- "author=" AUTHOR "\n"
- "date=" DATE "\n"
- "url=" URI_HOME WSZST_SHORT "\n"
- "\n"
- , BETA_VERSION
- , e[0], e[1], e[2], e[3]
- , endian == 0x01020304 ? "little"
- : endian == 0x04030201 ? "big" : "mixed" );
+ cmd_version_section(print_sect_header,WSZST_SHORT,WSZST_LONG);
}
///////////////////////////////////////////////////////////////////////////////
@@ -1806,7 +1785,7 @@ static enumError cmd_sha1()
{
if (long_count>1)
{
- #if USE_NEW_FILEATTRIB
+ #if HAVE_FILEATTRIB_NSEC
struct tm * tm = localtime(&szs.fatt.mtime.tv_sec);
#else
struct tm * tm = localtime(&szs.fatt.mtime);