Header fixes:

* Do not include system headers in shared files (stdlib.h).
* Don't include lcd.h only once in each driver.
* Remove some unnecessary headers from driver (e.g. syslog.h)
* Include <poll.h> instead of <sys/poll.h>
* Spelling fixes.
This commit is contained in:
mmdolze
2011-03-28 18:17:58 +00:00
parent be5c6d014b
commit c9c3272eba
92 changed files with 105 additions and 255 deletions
+14 -13
View File
@@ -20,6 +20,7 @@
#include <signal.h>
#include <time.h>
#include <sys/wait.h>
#include <stdlib.h>
#include "getopt.h"
@@ -209,7 +210,7 @@ static void sigchld_handler(int signal)
p->status = status;
p->endtime = time(NULL);
}
}
}
}
}
@@ -342,7 +343,7 @@ static int process_configfile(char *configfile)
if (main_menu == NULL) {
report(RPT_ERR, "no main menu found in configuration");
return -1;
}
}
return 0;
}
@@ -364,12 +365,12 @@ static int connect_and_setup(void)
}
else {
struct utsname unamebuf;
if (uname(&unamebuf) == 0)
sock_printf(sock, "client_set -name {%s %s}\n", progname, unamebuf.nodename);
else
else
sock_printf(sock, "client_set -name {%s}\n", progname);
}
}
/* Create our menu */
if (menu_sock_send(main_menu, NULL, sock) < 0) {
@@ -406,7 +407,7 @@ static int process_response(char *str)
if ((strcmp(argv[1], "select") == 0) ||
(strcmp(argv[1], "leave") == 0)) {
MenuEntry *entry;
if (argc < 3) {
report(RPT_WARNING, "Server gave invalid response");
free(str2);
@@ -434,13 +435,13 @@ static int process_response(char *str)
if (entry->type == MT_EXEC)
exec_command(entry);
}
}
}
else if ((strcmp(argv[1], "plus") == 0) ||
(strcmp(argv[1], "minus") == 0) ||
(strcmp(argv[1], "update") == 0)) {
MenuEntry *entry;
if (argc < 4) {
report(RPT_WARNING, "Server gave invalid response");
free(str2);
@@ -509,7 +510,7 @@ static int process_response(char *str)
// TODO: make it better
report(RPT_INFO, "Server said: \"%s\"", str);
exit_program(EXIT_SUCCESS);
}
}
else if (strcmp(argv[0], "huh?") == 0) {
/* Report errors */
report(RPT_WARNING, "Server said: \"%s\"", str);
@@ -575,7 +576,7 @@ static int exec_command(MenuEntry *cmd)
default:
/* error ? */
break;
}
}
buf[sizeof(buf)-1] ='\0';
envp[i] = strdup(buf);
@@ -651,7 +652,7 @@ static int show_procinfo_msg(ProcInfo *p)
else {
sock_printf(sock, "widget_set [%u] s2 1 3 {with code 0x%02X.}\n",
p->pid, WEXITSTATUS(p->status));
}
}
}
else if (WIFSIGNALED(p->status)) {
sock_printf(sock, "widget_set [%u] s2 1 3 {killed by SIG %d.}\n",
@@ -680,7 +681,7 @@ static int show_procinfo_msg(ProcInfo *p)
else if (WIFSIGNALED(p->status)) {
sock_printf(sock, "widget_set [%u] s2 1 2 {killed by SIG %d}\n",
p->pid, WTERMSIG(p->status));
}
}
return 1;
@@ -737,7 +738,7 @@ static int main_loop(void)
for (p = proc_queue; p != NULL; p = p->next) {
p->shown |= show_procinfo_msg(p);
}
}
}
}
else {
process_response(buf);
+1
View File
@@ -15,6 +15,7 @@
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include "shared/report.h"
#include "shared/configfile.h"
+1
View File
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include "lcd_link.h"
#include "vc_link.h"
+1
View File
@@ -20,6 +20,7 @@
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include "getopt.h"
+2 -1
View File
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include "lcdvc.h"
#include "vc_link.h"
@@ -79,7 +80,7 @@ int read_vcdata(void)
if (vc_buf == NULL) {
report(RPT_ERR, "malloc failure: %s", strerror(errno));
return -1;
}
}
memset(vc_buf, ' ', vc_width * vc_height);
}
}
+1 -2
View File
@@ -33,7 +33,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -67,7 +66,7 @@ typedef struct CFontz_private_data {
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGmode ccmode;
int contrast;
-2
View File
@@ -1,8 +1,6 @@
#ifndef CFONTZ_H
#define CFONTZ_H
#include "lcd.h"
#define DEFAULT_CELL_WIDTH 6
#define DEFAULT_CELL_HEIGHT 8
#define DEFAULT_CONTRAST 560
+1 -2
View File
@@ -54,7 +54,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -97,7 +96,7 @@ typedef struct CFontz633_private_data {
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGmode ccmode;
int contrast;
-2
View File
@@ -1,8 +1,6 @@
#ifndef CFONTZ633_H
#define CFONTZ633_H
#include "lcd.h"
#define DEFAULT_CELL_WIDTH 6
#define DEFAULT_CELL_HEIGHT 8
#define DEFAULT_CONTRAST 560
+1 -2
View File
@@ -42,7 +42,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include "lcd.h"
#include "CFontzPacket.h"
@@ -80,7 +79,7 @@ typedef struct CFontzPacket_private_data {
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGmode ccmode;
int contrast;
-2
View File
@@ -1,8 +1,6 @@
#ifndef CFONTZPACKET_H
#define CFONTZPACKET_H
#include "lcd.h"
#define DEFAULT_CELL_HEIGHT 8
#define DEFAULT_CONTRAST 560
#define DEFAULT_DEVICE "/dev/lcd"
+1 -2
View File
@@ -54,7 +54,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -94,7 +93,7 @@ typedef struct CwLnx_private_data {
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGmode ccmode;
char saved_backlight; /* current state of the backlight */
-7
View File
@@ -22,13 +22,6 @@
#ifndef CWLNX_H
#define CWLNX_H
#include "lcd.h"
// #define DEFAULT_CONTRAST 560
// #define DEFAULT_BRIGHTNESS 60
// #define DEFAULT_OFFBRIGHTNESS 0
// #define DEFAULT_EXITBRIGHTNESS 0
#define DEFAULT_DEVICE "/dev/lcd"
#define DEFAULT_BACKLIGHT 1
#define DEFAULT_BRIGHTNESS 700
+1 -3
View File
@@ -28,14 +28,12 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <ctype.h>
#include <sys/poll.h>
#include <poll.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
+1 -3
View File
@@ -1,8 +1,6 @@
#ifndef EYEBOXONE_H
#define EYEBOXONE_H
#include "lcd.h"
MODULE_EXPORT int EyeboxOne_init (Driver *drvthis);
MODULE_EXPORT void EyeboxOne_close (Driver *drvthis);
MODULE_EXPORT int EyeboxOne_width (Driver *drvthis);
@@ -21,7 +19,7 @@ MODULE_EXPORT const char * EyeboxOne_get_info (Driver *drvthis);
#define DEFAULT_DEVICE "/dev/ttyS1"
#define DEFAULT_SPEED 19200
#define DEFAULT_CURSOR 0
#define DEFAULT_CURSOR 0
#endif
+2 -3
View File
@@ -30,10 +30,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <usb.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -591,7 +590,7 @@ IOWarrior_flush(Driver *drvthis)
}
}
/* Check which defineable chars we need to update */
/* Check which definable chars we need to update */
count = 0;
for (i = 0; i < NUM_CCs; i++) {
if (!p->cc[i].clean) {
+1 -4
View File
@@ -27,9 +27,6 @@
#ifndef IOWARRIOR_H
#define IOWARRIOR_H
#include <usb.h>
#include "lcd.h"
#define DEFAULT_SERIALNO ""
#define DEFAULT_SIZE "20x4"
#define DEFAULT_BACKLIGHT 1
@@ -89,7 +86,7 @@ typedef struct IOWarrior_private_data {
/* last LCD contents (for incremental updates) */
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGram cc[NUM_CCs];
CGmode ccmode;
+1 -2
View File
@@ -178,7 +178,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -205,7 +204,7 @@ typedef struct MD8800_private_data {
/* framebuffer and buffer for old LCD contents */
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
int on_brightness;
int off_brightness;
int hw_brightness;
-1
View File
@@ -22,7 +22,6 @@
#ifndef MD8800_H
#define MD8800_H
#include "lcd.h"
#define DEFAULT_CELL_WIDTH 5
#define DEFAULT_CELL_HEIGHT 7
+2 -3
View File
@@ -48,9 +48,8 @@
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <syslog.h>
#include <ctype.h>
#include <sys/poll.h>
#include <poll.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -118,7 +117,7 @@ typedef struct MtxOrb_private_data {
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGmode ccmode;
int output_state; /**< current output state */
-2
View File
@@ -1,8 +1,6 @@
#ifndef MTXORB_H
#define MTXORB_H
#include "lcd.h"
#define DEFAULT_CONTRAST 480
#define DEFAULT_ADJ_BACKLIGHT 1
#define DEFAULT_BRIGHTNESS 1000
+1 -2
View File
@@ -54,7 +54,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -81,7 +80,7 @@ typedef struct NoritakeVFD_private_data {
/* framebuffer and buffer for old LCD contents */
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGmode ccmode;
int brightness;
int offbrightness;
-1
View File
@@ -21,7 +21,6 @@
#ifndef NORITAKEVFD_H
#define NORITAKEVFD_H
#include "lcd.h"
#define DEFAULT_CELL_WIDTH 5
#define DEFAULT_CELL_HEIGHT 7
+1 -4
View File
@@ -43,11 +43,8 @@
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <syslog.h>
#include <ctype.h>
#include <sys/poll.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -84,7 +81,7 @@ typedef struct SureElec_private_data {
unsigned char *framebuf;
unsigned char *backingstore;
/* defineable characters */
/* definable characters */
CGmode ccmode;
int output_state; /**< current output state */
-2
View File
@@ -4,8 +4,6 @@
#ifndef SUREELEC_H
#define SUREELEC_H
#include "lcd.h"
#define DEFAULT_DEVICE "/dev/ttyUSB0"
#define DEFAULT_SPEED 9600
#define DEFAULT_LINEWRAP 1
-2
View File
@@ -8,8 +8,6 @@
#ifndef _BAYRAD_H
#define _BAYRAD_H
#include "lcd.h"
MODULE_EXPORT int bayrad_init(Driver *drvthis);
MODULE_EXPORT void bayrad_close(Driver *drvthis);
MODULE_EXPORT int bayrad_width(Driver *drvthis);
-4
View File
@@ -52,11 +52,8 @@ Different implementations of (n)curses available on:
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <ctype.h>
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
@@ -67,7 +64,6 @@ Different implementations of (n)curses available on:
#include "lcd.h"
#include "curses_drv.h"
#include "report.h"
//#include "configfile.h"
// ACS_S9 and ACS_S1 are defined as part of XSI Curses standard, Issue 4.
// However, ACS_S3 and ACS_S7 are not; these definitions were created to support
-2
View File
@@ -1,8 +1,6 @@
#ifndef LCD_CURSES_H
#define LCD_CURSES_H
#include "lcd.h"
MODULE_EXPORT int curses_init (Driver *drvthis);
MODULE_EXPORT void curses_close (Driver *drvthis);
MODULE_EXPORT int curses_width (Driver *drvthis);
-1
View File
@@ -33,7 +33,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
-2
View File
@@ -1,8 +1,6 @@
#ifndef EA65_H
#define EA65_H
#include "lcd.h"
#define DEFAULT_BRIGHTNESS 500
#define DEFAULT_OFFBRIGHTNESS 0
-1
View File
@@ -31,7 +31,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <libg15.h>
+1 -3
View File
@@ -17,14 +17,12 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
+3 -2
View File
@@ -8,11 +8,12 @@
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#include <sys/poll.h>
#include <poll.h>
#include "glkproto.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+1 -9
View File
@@ -14,18 +14,10 @@
*/
#include "hd44780-bwct-usb.h"
#include "hd44780-low.h"
#include "report.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <usb.h>
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#ifdef HAVE_CONFIG_H
-1
View File
@@ -2,7 +2,6 @@
#define HD_BWCT_USB_H
#include "lcd.h" /* for Driver */
#include "hd44780-low.h"
/* vendor and product id */
#define BWCT_USB_VENDORID 0x03DA
+1 -1
View File
@@ -29,13 +29,13 @@
*/
#include "hd44780-ftdi.h"
#include "hd44780-low.h"
#include "report.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <usb.h>
#include <stdio.h>
#include <sys/types.h>
-1
View File
@@ -2,7 +2,6 @@
#define HD_FTDI_H
#include "lcd.h" /* for Driver */
#include "hd44780-low.h"
// initialise this particular driver
int hd_init_ftdi(Driver *drvthis);
+1 -4
View File
@@ -16,15 +16,12 @@
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <usb.h>
#include "hd44780-lcd2usb.h"
#include "hd44780-low.h"
#include "report.h"
/* connection type specific functions to be exposed using pointers in init() */
void lcd2usb_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch);
void lcd2usb_HD44780_backlight(PrivateData *p, unsigned char state);
-1
View File
@@ -2,7 +2,6 @@
#define HD_LCD2USB_H
#include "lcd.h" /* for Driver */
#include "hd44780-low.h"
/* vendor and product id */
#define LCD2USB_VENDORID 0x0403
+1 -1
View File
@@ -141,7 +141,7 @@ typedef struct hd44780_private_data {
// For incremental updates store last lcd contents
unsigned char *backingstore;
// The defineable characters
// The definable characters
CGram cc[NUM_CCs];
CGmode ccmode;
+4 -2
View File
@@ -50,6 +50,8 @@
#include <termios.h>
#include <errno.h>
#include "lcd.h"
#include "hd44780-low.h"
#include "hd44780-serial.h"
#include "report.h"
@@ -81,8 +83,8 @@ unsigned int bitrate_conversion[][2] = {
#endif
#if defined(B230400)
, { 230400, B230400 }
#endif
#if defined(B460800)
#endif
#if defined(B460800)
, { 460800, B460800 }
#endif
#if defined(B500000)
-3
View File
@@ -6,9 +6,6 @@
#ifndef HD44780_SERIAL_H
#define HD44780_SERIAL_H
#include "lcd.h"
#include "hd44780-low.h"
#define SERIALIF_NAME_LENGTH 20
#define DEFAULT_DEVICE "/dev/lcd"
+1
View File
@@ -19,6 +19,7 @@
*/
#include "hd44780-usblcd.h"
#include "hd44780-low.h"
#include "report.h"
#include <stdlib.h>
-1
View File
@@ -2,7 +2,6 @@
#define HD_USBLCD_H
#include "lcd.h" /* for lcd_logical_driver */
#include "hd44780-low.h" /* for HD44780_functions */
// initialise this particular driver
int hd_init_usblcd(Driver *drvthis);
+1 -2
View File
@@ -18,10 +18,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <usb.h>
#include "hd44780-usbtiny.h"
#include "hd44780-low.h"
#include "report.h"
-1
View File
@@ -2,7 +2,6 @@
#define HD_USBTINY_H
#include "lcd.h" /* for Driver */
#include "hd44780-low.h"
/* vendor and product id */
#define USBTINY_VENDORID 0x03EB
-8
View File
@@ -27,18 +27,10 @@
#include "hd44780-uss720.h"
#include "hd44780-low.h"
#include "lpt-port.h"
#include "report.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <usb.h>
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#ifdef HAVE_CONFIG_H
+1 -3
View File
@@ -2,9 +2,7 @@
#define HD_USS720_H
#include "lcd.h" /* for Driver */
#include "hd44780-low.h"
// initialise this particular driver
/* initialise this particular driver */
int hd_init_uss720(Driver *drvthis);
#endif
+1 -2
View File
@@ -73,7 +73,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
@@ -699,7 +698,7 @@ HD44780_flush(Driver *drvthis)
}
debug(RPT_DEBUG, "HD44780: flushed %d chars", count);
/* Check which defineable chars we need to update */
/* Check which definable chars we need to update */
count = 0;
for (i = 0; i < NUM_CCs; i++) {
if (!p->cc[i].clean) {
-2
View File
@@ -17,8 +17,6 @@
#ifndef HD44780_H
#define HD44780_H
#include "lcd.h"
MODULE_EXPORT int HD44780_init(Driver *drvthis);
MODULE_EXPORT void HD44780_close(Driver *drvthis);
MODULE_EXPORT int HD44780_width(Driver *drvthis);
-4
View File
@@ -27,11 +27,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include "i2500vfdfm.h"
-2
View File
@@ -1,8 +1,6 @@
#ifndef I2500VFD_H
#define I2500VFD_H
#include "lcd.h"
MODULE_EXPORT int i2500vfd_init (Driver *drvthis);
MODULE_EXPORT void i2500vfd_close (Driver *drvthis);
MODULE_EXPORT int i2500vfd_width (Driver *drvthis);
-1
View File
@@ -39,7 +39,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
//#include <time.h>
#include <sys/time.h>
#ifdef HAVE_CONFIG_H
-1
View File
@@ -31,7 +31,6 @@
#ifndef ICP_A106_H
#define ICP_A106_H
#include "lcd.h"
MODULE_EXPORT int icp_a106_init (Driver *drvthis);
MODULE_EXPORT void icp_a106_close (Driver *drvthis);
MODULE_EXPORT int icp_a106_width (Driver *drvthis);
+1 -2
View File
@@ -30,12 +30,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-2
View File
@@ -26,8 +26,6 @@
#ifndef IMON_H
#define IMON_H
#include "lcd.h"
MODULE_EXPORT int imon_init (Driver *drvthis);
MODULE_EXPORT void imon_close (Driver *drvthis);
MODULE_EXPORT int imon_width (Driver *drvthis);
-1
View File
@@ -38,7 +38,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
-2
View File
@@ -16,8 +16,6 @@
#ifndef IMONLCD_H
#define IMONLCD_H
#include "lcd.h"
/* mandatory functions (necessary for all drivers) */
MODULE_EXPORT int imonlcd_init (Driver *drvthis);
MODULE_EXPORT void imonlcd_close (Driver *drvthis);
+1 -2
View File
@@ -16,7 +16,6 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <errno.h>
#define __u32 unsigned int
#define __u8 unsigned char
@@ -96,7 +95,7 @@ irmanin_init (Driver *drvthis)
if (p->device[0] != '\0') {
report(RPT_INFO, "%s: using Device %s", drvthis->name, p->device);
ptrdevice = p->device;
}
}
/* What config file should be used */
strncpy(p->config, drvthis->config_get_string(drvthis->name, "Config", 0,
-1
View File
@@ -36,7 +36,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>
#include <netdb.h>
-2
View File
@@ -31,8 +31,6 @@
#ifndef LCD_TEXT_H
#define LCD_TEXT_H
#include "lcd.h"
MODULE_EXPORT int irtrans_init(Driver *drvthis);
MODULE_EXPORT void irtrans_close(Driver *drvthis);
MODULE_EXPORT int irtrans_width(Driver *drvthis);
-1
View File
@@ -23,7 +23,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
-4
View File
@@ -8,10 +8,6 @@
* the height of hbars, etc.
*/
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "lcd.h"
#ifdef HAVE_CONFIG_H
-1
View File
@@ -37,7 +37,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
+2 -3
View File
@@ -33,7 +33,6 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
@@ -101,7 +100,7 @@ lircin_init (Driver *drvthis)
if (drvthis->config_get_string(drvthis->name, "lircrc", 0 , NULL) != NULL) {
strncpy(s, drvthis->config_get_string(drvthis->name, "lircrc", 0, ""), sizeof(s));
s[sizeof(s)-1] = '\0';
}
}
if (*s != '\0') {
p->lircrc = malloc(strlen(s) + 1);
@@ -185,7 +184,7 @@ lircin_close (Driver *drvthis)
if (p->lircin_fd >= 0) {
lirc_deinit ();
close (p->lircin_fd);
}
}
p->lircin_fd = -1;
free(p);
+1 -5
View File
@@ -52,21 +52,17 @@
* 2007/11/01 Change Linux-centric clone() to POSIX
* threads for portability.
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <pthread.h>
#include <usb.h>
#include <ftdi.h>
#include <sys/syscall.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-2
View File
@@ -19,8 +19,6 @@
#ifndef LIS_H
#define LIS_H
#include "lcd.h"
#ifndef bool
# define bool short
# define true 1
+13 -11
View File
@@ -24,34 +24,36 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef TIME_WITH_SYS_TIME
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include "lcd.h"
#include "ms6931.h"
#include "report.h"
#include "lcd_lib.h"
/*
#include "server/configfile.h"
*/
/** private data for the \c ms6931 driver */
typedef struct ms6931_private_data {
-2
View File
@@ -25,8 +25,6 @@
#ifndef MS6931_H
#define MS6931_H
#include "lcd.h"
#define MS6931_DEF_DEVICE "/dev/ttyS1"
#define MS6931_DEF_SIZE "16x2"
#define MS6931_DEF_CELL_WIDTH 5
-2
View File
@@ -50,8 +50,6 @@
#include <string.h>
#include <errno.h>
#include <sys/file.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-2
View File
@@ -38,8 +38,6 @@
#ifndef MTC_S16209X_H
#define MTC_S16209X_H
#include "lcd.h"
MODULE_EXPORT int MTC_S16209X_init(Driver *drvthis);
MODULE_EXPORT void MTC_S16209X_close(Driver *drvthis);
MODULE_EXPORT int MTC_S16209X_width (Driver *drvthis);
+13 -4
View File
@@ -25,6 +25,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/select.h>
@@ -35,11 +39,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include "shared/defines.h"
+1
View File
@@ -69,6 +69,7 @@
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include "lcd.h"
#include "sed1330.h"
-5
View File
@@ -32,13 +32,8 @@
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include "lcd.h"
#include "sed1520.h"
-2
View File
@@ -1,8 +1,6 @@
#ifndef SED1520_H
#define SED1520_H
#include "lcd.h"
/* Commands for SED1520 */
#define DISP_OFF 0xAE
#define DISP_ON 0xAF
-2
View File
@@ -66,9 +66,7 @@ get_info Implemented.
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <syslog.h>
#include <ctype.h>
#include <sys/poll.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
-2
View File
@@ -1,8 +1,6 @@
#ifndef SERPOS_H
#define SERPOS_H
#include "lcd.h"
#define DEFAULT_DEVICE "/dev/Stty"
#define DEFAULT_SPEED 9800
#define DEFAULT_LINEWRAP 0
+3 -5
View File
@@ -46,9 +46,7 @@
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include "lcd.h"
#include "report.h"
@@ -422,7 +420,7 @@ serialVFD_flush (Driver *drvthis)
}
}
/* line mode Display (partitially borrowed from serialPOS.c) */
else {
else {
for (j = 0; j < p->height; j++) {
/* set pointers to start of the line in frame buffer
* & backing store */
@@ -652,7 +650,7 @@ serialVFD_get_free_chars (Driver *drvthis)
*
* Converts the 5x7 matrix of bits stored in 7 bytes into a VFD specific
* byte sequence.
*
*
* \param drvthis Pointer to driver structure.
* \param n Custom character to define [0 - (p->customchars)].
* \param dat Array of 7(=cellheight) bytes, each representing a pixel row
@@ -856,7 +854,7 @@ serialVFD_put_char (Driver *drvthis, int n)
* ISO_8859_1 is enabled.
* \param drvthis Pointer to driver
* \param i Index of character in framebuffer to write
*
*
*/
static void
serialVFD_hw_write (Driver *drvthis, int i)
+1 -3
View File
@@ -33,8 +33,6 @@
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
@@ -84,7 +82,7 @@ serialVFD_write_serial (Driver *drvthis, unsigned char *dat, size_t length)
* Portwait = 2; as 1 + additional WR pulse width\n
* Portwait = 3; as 2 + additional WR setup delay\n
* Portwait >= 4; as 3 + additional wait delay to next command
*
*
* \param drvthis Pointer to driver
* \param dat Pointer to array storing the data
* \param length Number of bytes to write
-2
View File
@@ -26,8 +26,6 @@
#ifndef SHUTTLE_VFD_H
#define SHUTTLE_VFD_H
#include "lcd.h"
// mandatory functions (necessary for all drivers)
MODULE_EXPORT int shuttleVFD_init(Driver *drvthis);
MODULE_EXPORT void shuttleVFD_close(Driver *drvthis);
+8 -12
View File
@@ -22,25 +22,21 @@
// package for further details. //
//////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include "port.h"
#include "timing.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "lcd.h"
#include "stv5730.h"
#include "report.h"
#include "port.h"
#include "timing.h"
#ifndef LPTPORT
#define LPTPORT 0x378
+8 -16
View File
@@ -2,15 +2,12 @@
* LCDd \c svga driver for displaying on SVGA screens.
*/
/*
/*-
This is a hack of the curses driver. It's my first attempt at SVGALIB
programming so please send comments to <smh@remove_this@dr.com>.
Simon Harrison. 27 Dec 1999.
IMPORTANT NOTE: In order to make this work properly LCDd should not be
allowed to fork (-f option), otherwise k/b input won't work.
Changes:
9 Jan 2000: Figured out svgalib driver needs a hack to main.c just like
curses. Maybe this should be fixed with another function call
@@ -19,17 +16,12 @@
26 Jul 2005: adapted better to 0.5 API; changed font from 5x7 to 6x8;
take options from the config file: mode, size, brightness,
contrast, ...
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <vga.h>
#include <vgagl.h>
@@ -316,14 +308,14 @@ svga_init (Driver *drvthis)
if (vga_init() != 0) {
report(RPT_ERR, "%s: vga_init() failed", drvthis->name);
return -1;
}
}
/* check for legal VGA mode */
tmp = vga_getmodenumber(modestr);
if (tmp <= 0) {
report(RPT_ERR, "%s: illegal VGA mode %s", drvthis->name, modestr);
return -1;
}
}
p->mode = tmp;
/* switch to selected VGA mode if it is available */
@@ -347,7 +339,7 @@ svga_init (Driver *drvthis)
if (vga_setmode (p->mode) < 0) {
report(RPT_ERR, "%s: unable to switch to mode %s", drvthis->name, modestr);
return -1;
}
}
gl_setcontextvga(p->mode); /* Physical screen context. */
gl_setrgbpalette();
@@ -356,7 +348,7 @@ svga_init (Driver *drvthis)
if (p->font == NULL) {
report(RPT_ERR, "%s: unable to allocate font memory", drvthis->name);
return -1;
}
}
tmp = (p->brightness * 255) / 1000;
if (tmp <= 0)
@@ -388,7 +380,7 @@ svga_close (Driver *drvthis)
p->font = NULL;
free(p);
}
}
drvthis->store_private_ptr(drvthis, NULL);
vga_setmode(TEXT);
@@ -614,8 +606,8 @@ svga_get_key (Driver *drvthis)
/* otherwise key not recognised; ignore it */
return NULL;
case '\t': /* TAB, LF and CR serve as "Enter" */
case 0x0A:
case 0x0D:
case 0x0A:
case 0x0D:
return "Enter";
default:
buf[0] = (char) key & 0xFF; /* make sure it fits into a char */
-3
View File
@@ -27,14 +27,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include "lcd.h"
#include "text.h"
#include "report.h"
//#include "drv_base.h"
/** private data for the \c text driver */
-2
View File
@@ -1,8 +1,6 @@
#ifndef LCD_TEXT_H
#define LCD_TEXT_H
#include "lcd.h"
MODULE_EXPORT int text_init (Driver *drvthis);
MODULE_EXPORT void text_close (Driver *drvthis);
MODULE_EXPORT int text_width (Driver *drvthis);
-1
View File
@@ -41,7 +41,6 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
+4 -6
View File
@@ -20,8 +20,6 @@
#ifndef TYAN_LCDM_H
#define TYAN_LCDM_H
#include "lcd.h"
#define DEFAULT_CELL_WIDTH 5
#define DEFAULT_CELL_HEIGHT 8
#define DEFAULT_DEVICE "/dev/lcd"
@@ -54,19 +52,19 @@ typedef struct tyan_lcdm_private_data {
char device[200];
int speed;
int fd;
unsigned char *framebuf;
unsigned char *backingstore;
int width;
int height;
int cellwidth;
int cellheight;
/* defineable characters */
/* definable characters */
CGram cc[NUM_CCs];
CGmode ccmode;
} PrivateData;
} PrivateData;
/* API: variables for the server core */
-3
View File
@@ -27,11 +27,8 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <usb.h>
#include <ftdi.h>
-2
View File
@@ -7,8 +7,6 @@
#ifndef SLI_H
#define SLI_H
#include "lcd.h"
MODULE_EXPORT int sli_init (Driver *drvthis);
MODULE_EXPORT void sli_close (Driver *drvthis);
MODULE_EXPORT int sli_width (Driver *drvthis);
-1
View File
@@ -27,7 +27,6 @@
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
-3
View File
@@ -32,9 +32,6 @@
#ifndef REPORT_H
#define REPORT_H
#include <stdarg.h>
#include <stdio.h>
/* Reporting levels */
/**
* \def RPT_CRIT
-2
View File
@@ -234,7 +234,6 @@ sock_send (int fd, void *src, size_t size)
if (errno != EAGAIN) {
report (RPT_ERR, "sock_send: socket write error");
report (RPT_DEBUG, "Message was: '%.*s'", size-offset, (char *) src);
//shutdown(fd, SHUT_RDWR);
return sent;
}
continue;
@@ -270,7 +269,6 @@ sock_recv (int fd, void *dest, size_t maxlen)
err = read (fd, dest, maxlen);
if (err < 0) {
//report (RPT_DEBUG,"sock_recv: socket read error");
//shutdown(fd, SHUT_RDWR);
return err;
}
//debug(RPT_DEBUG, "sock_recv: Got message \"%s\"", (char *)dest);
-2
View File
@@ -5,8 +5,6 @@
#ifndef SOCKETS_H
#define SOCKETS_H
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif