]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge commit 'fml/master'
authorAndre Noll <maan@systemlinux.org>
Sat, 4 Jul 2009 13:53:43 +0000 (15:53 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 4 Jul 2009 13:53:43 +0000 (15:53 +0200)
Makefile.in
NEWS
afs.cmd
aft.c
grab_client.c

index d2218929b32a9b0b62c84952013f041b469ceb8b..b4392a3c63a8bddca224300b00c2e5d9de5a6177 100644 (file)
@@ -50,6 +50,7 @@ CPPFLAGS += -Wmissing-format-attribute
 CPPFLAGS += -Wmissing-noreturn
 CPPFLAGS += -Wunused-macros
 CPPFLAGS += -Wbad-function-cast
+CPPFLAGS += -fno-strict-aliasing
 CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F)
 CPPFLAGS += @SSL_CPPFLAGS@
 CPPFLAGS += @ncurses_cppflags@
diff --git a/NEWS b/NEWS
index 20e5105ffa763a873f31e63c2c1c1644caf67991..9e9a7d99fbc8f3cafcedc33fef54fde63387816d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ NEWS
        - improved signal handling
        - variable fec output buffer size
        - --log_color actually works
+       - new ls option: -d (print dates as seconds after the epoch)
+       - update to gengetopt 2.22.2
 
 -----------------------------------------
 0.3.4 (2009-05-07) "elliptic inheritance"
diff --git a/afs.cmd b/afs.cmd
index da4b3f86030a299e477093de629595849b2b0173..0af4511302aa20a220907e79a35be20df04a2700 100644 (file)
--- a/afs.cmd
+++ b/afs.cmd
@@ -41,7 +41,7 @@ H: only the tables given by table_name... are created.
 N: ls
 P: AFS_READ
 D: List audio files.
-U: ls [-l[s|l|v|m]] -p -a -r -s{p|s|l|n|f|c|i|y|b|d|a} [pattern...]
+U: ls [-l[s|l|v|m]] [-p] [-a] [-r] [-d] [-s{p|s|l|n|f|c|i|y|b|d|a}] [pattern...]
 H: Print a list of all audio files matching pattern.
 H:
 H: Options:
@@ -66,6 +66,8 @@ H:    playlist.
 H:
 H: -r  Reverse sort order.
 H:
+H: -d  Print dates as seconds after the epoch.
+H:
 H: -s  Change sort order. Defaults to alphabetical path sort if not given.
 H:
 H:             -sp:  sort by path.
diff --git a/aft.c b/aft.c
index 995c7552129512c6e2dc6228c165779c9e7979a0..20fa3a96a4ccf1139d6d369ae8ff5764103e7822 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -74,6 +74,8 @@ enum ls_flags {
        LS_FLAG_ADMISSIBLE_ONLY = 2,
        /** -r */
        LS_FLAG_REVERSE = 4,
+       /** -d */
+       LS_FLAG_UNIXDATE = 8,
 };
 
 /**
@@ -800,10 +802,15 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                goto out;
        }
        get_attribute_bitmap(&afsi->attributes, att_buf);
-       ret = get_local_time(&afsi->last_played, last_played_time,
-               sizeof(last_played_time), current_time, opts->mode);
-       if (ret < 0)
-               goto out;
+       if (opts->flags & LS_FLAG_UNIXDATE)
+               sprintf(last_played_time, "%llu",
+                       (long long unsigned)afsi->last_played);
+       else {
+               ret = get_local_time(&afsi->last_played, last_played_time,
+                       sizeof(last_played_time), current_time, opts->mode);
+               if (ret < 0)
+                       goto out;
+       }
        get_duration_buf(afhi->seconds_total, duration_buf, opts);
        if (have_score) {
                if (opts->mode == LS_MODE_LONG)
@@ -1458,6 +1465,10 @@ int com_ls(int fd, int argc, char * const * const argv)
                        flags |= LS_FLAG_REVERSE;
                        continue;
                }
+               if (!strcmp(arg, "-d")) {
+                       flags |= LS_FLAG_UNIXDATE;
+                       continue;
+               }
                if (!strncmp(arg, "-s", 2)) {
                        if (!*(arg + 2) || *(arg + 3))
                                return -E_AFT_SYNTAX;
index e419a723b9b856ddbc595c6130951c86d4e3155a..f3a0f48486e14ac478413e78efcfd41ee38e87dc 100644 (file)
@@ -83,7 +83,7 @@ static int check_gc_args(struct grab_client *gc)
 {
        int i;
        struct grab_client_args_info *c = gc->conf;
-       char **mv = grab_client_cmdline_parser_mode_values;
+       const char **mv = grab_client_cmdline_parser_mode_values;
 
        PARA_INFO_LOG("filter_num: %d\n", c->filter_num_arg);
        for (i = 0; mv[i]; i++)