drv_generic_graphic_clear();
/* say goodbye... */
- if (!quiet) {
- drv_generic_graphic_greet("goodbye!", NULL);
- }
+ //read goodby message from /tmp/lcd/goodbye
+ char line1[80], value[80];
+ FILE *fp;
+ int i, size;
+
+ fp = fopen("/tmp/lcd/goodbye", "r");
+ if (!fp) {
+ debug("couldn't open file '/tmp/lcd/goodbye'");
+ line1[0] = '\0';
+ if (!quiet) {
+ drv_generic_graphic_greet("goodbye!", NULL);
+ }
+ } else {
+ i = 0;
+ while (!feof(fp) && i++ < 1) {
+ fgets(value, sizeof(value), fp);
+ size = strcspn(value, "\r\n");
+ strncpy(line1, value, size);
+ line1[size] = '\0';
+ /* more than 80 chars, chew up rest of line */
+ while (!feof(fp) && strchr(value, '\n') == NULL) {
+ fgets(value, sizeof(value), fp);
+ }
+ }
+ fclose(fp);
+ if (i <= 1) {
+ debug("'/tmp/lcd/goodbye' seems empty");
+ line1[0] = '\0';
+ }
+ /* remove the file */
+ debug("removing '/tmp/lcd/goodbye'");
+ unlink("/tmp/lcd/goodbye");
+
+ drv_generic_graphic_greet(NULL, line1);
+ }
drv_generic_graphic_quit();
/* say hello to the user */
int drv_generic_graphic_greet(const char *msg1, const char *msg2)
{
+#if 0
char *line1[] = { "* LCD4Linux " VERSION " *",
"LCD4Linux " VERSION,
"* LCD4Linux *",
"lcd4linux.bulix.org",
NULL
};
+#endif
+
+ char *line1[] = { NULL };
+ char *line2[] = { NULL };
int i;
int flag = 0;