#
-# $Id: README,v 1.7 2000/08/09 09:50:29 reinelt Exp $
+# $Id: README,v 1.8 2000/08/09 14:14:11 reinelt Exp $
#
This is the README file for lcd4linux
lcd4linux -d
calibrate delay loop (necessary for some drivers)
-lcd4linux [-c key=val] [-f config-file] [-o output] [-q] [-v]
+lcd4linux [-c key=val] [-F] [-f config-file] [-o output] [-q] [-v]
run lcd4linux
-generate debugging messages with '-v'
+overwrite entries from the config-file with '-c'
+do not fork and detach with '-F'
use configuration from 'config-file' instead of /etc/lcd4linux.conf
write picture to 'output' (raster driver only)
-overwrite entries from the config-file with '-c'
suppress startup splash screen with '-q'
+generate debugging messages with '-v' (implies -F)
SUPPORTED DISPLAYS
-/* $Id: lcd4linux.c,v 1.24 2000/08/09 09:50:29 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.25 2000/08/09 14:14:11 reinelt Exp $
*
* LCD4Linux
*
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.25 2000/08/09 14:14:11 reinelt
+ *
+ * new switch -F (do not fork)
+ * added automatic forking if -F not specified
+ *
* Revision 1.24 2000/08/09 09:50:29 reinelt
*
* opened 0.98 development
printf ("usage: lcd4linux [-h]\n");
printf (" lcd4linux [-l]\n");
printf (" lcd4linux [-d]\n");
- printf (" lcd4linux [-c key=value] [-f config-file] [-o output-file] [-q] [-v]\n");
+ printf (" lcd4linux [-c key=value] [-F] [-f config-file] [-o output-file] [-q] [-v]\n");
}
int hello (void)
char *cfg="/etc/lcd4linux.conf";
char *driver;
int c, smooth;
+ int foreground=0;
int quiet=0;
-
- while ((c=getopt (argc, argv, "c:df:hlo:qv"))!=EOF) {
+
+ while ((c=getopt (argc, argv, "c:dFf:hlo:qv"))!=EOF) {
switch (c) {
case 'c':
if (cfg_cmd (optarg)<0) {
case 'd':
calibrate();
exit(0);
+ case 'F':
+ foreground++;
+ break;
+ case 'f':
+ cfg=optarg;
+ break;
case 'h':
usage();
exit(0);
printf ("%s\n", release);
lcd_list();
exit(0);
- case 'f':
- cfg=optarg;
- break;
case 'o':
output=optarg;
break;
break;
case 'v':
debugging++;
+ foreground++;
break;
default:
exit(2);
exit(2);
}
+ if (!foreground) {
+ pid_t i;
+ // debugging does not make sense here
+ // because -v implies -F which sets foreground=1
+ // debug ("going background...\n");
+ i=fork();
+ if (i<0) {
+ perror ("fork() failed");
+ exit (1);
+ }
+ printf ("fork() returned %d\n", i);
+ if (i!=0)
+ exit (0);
+ close (0);
+ close (1);
+ printf ("Hallo stdout\n");
+ fprintf (stderr, "Hallo stderr\n");
+ }
+
debug ("LCD4Linux " VERSION "\n");
// set default values