summaryrefslogtreecommitdiff
path: root/misc/snowflake/files/patch-sf.c
blob: 66c9bbd546be3923cad45cf12a62c2c6177de1db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- sf.c.orig	Mon Dec 21 00:18:55 1998
+++ sf.c	Sat Oct  7 16:19:50 2006
@@ -23,9 +23,8 @@
 #include <sys/shm.h>
 #include <sys/sem.h>
 
-#include "sf.h"
-
 #include "getopt.h"
+#include "sf.h"
 
 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 
@@ -47,6 +46,7 @@
 
 struct option long_options[] =
 {
+  { "version",          0, 0, c_VERSION          },
   { "view-geometry",    1, 0, c_VIEW_GEOMETRY    },
   { "control-geometry", 1, 0, c_CONTROL_GEOMETRY },
   { "minimize",         0, 0, c_MINIMIZE         },
@@ -77,6 +77,8 @@
 
 help_info_line help_info[] =
 {
+  { "version",          c_VERSION,          " ",
+    "show program version"  },
   { "view-geometry",    c_VIEW_GEOMETRY,    "+x+y",
     "Control window placement" },
   { "control-geometry", c_CONTROL_GEOMETRY, "+x+y",
@@ -134,7 +136,7 @@
 
 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 
-void main( int argc,char* argv[] )
+int main( int argc,char* argv[] )
 {
   int   i;
   char* shop;
@@ -175,7 +177,14 @@
                  help_info[i].description );
 
       exit( 0 );
-   }
+    }
+    /* asking for version? */
+    if ( ( strncmp( argv[1], "-V",   2 ) == 0 ) ||
+         ( strncmp( argv[1],"--version",3 ) == 0 ) )
+    {
+      printf( "%s - %s\n",program_name,version );
+      exit( 0 );
+    }
   }
 
   /* create shared memory image and mutex */