From f73b0f9eba75338719facd0051845b91bd9b882c Mon Sep 17 00:00:00 2001 From: "Brian S. Dean" Date: Sat, 13 Oct 2001 03:13:13 +0000 Subject: [PATCH] Style fixes. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@77 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avr.c | 56 ++++++++++++++++++++++----------------------- avr.h | 40 ++++++++++++++++---------------- fileio.c | 70 ++++++++++++++++++++++++++++---------------------------- fileio.h | 8 +++---- main.c | 44 +++++++++++++++++------------------ ppi.c | 46 ++++++++++++++++++------------------- ppi.h | 28 +++++++++++------------ term.c | 36 ++++++++++++++--------------- term.h | 2 +- 9 files changed, 165 insertions(+), 165 deletions(-) diff --git a/avr.c b/avr.c index 7e06a18d..ac944834 100644 --- a/avr.c +++ b/avr.c @@ -89,7 +89,7 @@ struct avrpart parts[] = { -int avr_list_parts ( FILE * f, char * prefix ) +int avr_list_parts(FILE * f, char * prefix) { int i; @@ -102,7 +102,7 @@ int avr_list_parts ( FILE * f, char * prefix ) } -struct avrpart * avr_find_part ( char * p ) +struct avrpart * avr_find_part(char * p) { int i; @@ -119,7 +119,7 @@ struct avrpart * avr_find_part ( char * p ) /* * transmit and receive a bit of data to/from the AVR device */ -int avr_txrx_bit ( int fd, int bit ) +int avr_txrx_bit(int fd, int bit) { int r; @@ -145,7 +145,7 @@ int avr_txrx_bit ( int fd, int bit ) /* * transmit and receive a byte of data to/from the AVR device */ -unsigned char avr_txrx ( int fd, unsigned char byte ) +unsigned char avr_txrx(int fd, unsigned char byte) { int i; unsigned char r, b, rbyte; @@ -153,7 +153,7 @@ unsigned char avr_txrx ( int fd, unsigned char byte ) rbyte = 0; for (i=0; i<8; i++) { b = (byte >> (7-i)) & 0x01; - r = avr_txrx_bit ( fd, b ); + r = avr_txrx_bit(fd, b); rbyte = rbyte | (r << (7-i)); } @@ -165,7 +165,7 @@ unsigned char avr_txrx ( int fd, unsigned char byte ) * transmit an AVR device command and return the results; 'cmd' and * 'res' must point to at least a 4 byte data buffer */ -int avr_cmd ( int fd, unsigned char cmd[4], unsigned char res[4] ) +int avr_cmd(int fd, unsigned char cmd[4], unsigned char res[4]) { int i; @@ -180,8 +180,8 @@ int avr_cmd ( int fd, unsigned char cmd[4], unsigned char res[4] ) /* * read a byte of data from the indicated memory region */ -unsigned char avr_read_byte ( int fd, struct avrpart * p, - int memtype, unsigned short addr ) +unsigned char avr_read_byte(int fd, struct avrpart * p, + int memtype, unsigned short addr) { unsigned short offset; unsigned char cmd[4]; @@ -218,7 +218,7 @@ unsigned char avr_read_byte ( int fd, struct avrpart * p, * * Return the number of bytes read, or -1 if an error occurs. */ -int avr_read ( int fd, struct avrpart * p, int memtype ) +int avr_read(int fd, struct avrpart * p, int memtype) { unsigned char rbyte; unsigned short i; @@ -230,11 +230,11 @@ int avr_read ( int fd, struct avrpart * p, int memtype ) for (i=0; ipartdesc, "AT90S1200")==0) { - avr_program_enable ( fd ); + avr_program_enable(fd); } else { tries = 0; do { - rc = avr_program_enable ( fd ); + rc = avr_program_enable(fd); if (rc == 0) break; ppi_pulsepin(fd, pinno[PIN_AVR_SCK]); @@ -500,7 +500,7 @@ int avr_initialize ( int fd, struct avrpart * p ) * can't sync with the device, maybe it's not attached? */ if (tries == 32) { - fprintf ( stderr, "%s: AVR device not responding\n", progname ); + fprintf(stderr, "%s: AVR device not responding\n", progname); return -1; } } @@ -510,7 +510,7 @@ int avr_initialize ( int fd, struct avrpart * p ) -char * avr_memtstr ( int memtype ) +char * avr_memtstr(int memtype) { switch (memtype) { case AVR_M_EEPROM : return "eeprom"; break; @@ -520,7 +520,7 @@ char * avr_memtstr ( int memtype ) } -int avr_initmem ( struct avrpart * p ) +int avr_initmem(struct avrpart * p) { int i; @@ -602,7 +602,7 @@ void avr_mem_display(char * prefix, FILE * f, AVRMEM * m, int type) -void avr_display ( FILE * f, struct avrpart * p, char * prefix ) +void avr_display(FILE * f, struct avrpart * p, char * prefix) { int i; char * buf; diff --git a/avr.h b/avr.h index 04c4043b..963f9057 100644 --- a/avr.h +++ b/avr.h @@ -99,46 +99,46 @@ extern struct avrpart parts[]; -int avr_list_parts ( FILE * f, char * prefix ); +int avr_list_parts(FILE * f, char * prefix); -struct avrpart * avr_find_part ( char * p ); +struct avrpart * avr_find_part(char * p); -int avr_txrx_bit ( int fd, int bit ); +int avr_txrx_bit(int fd, int bit); -unsigned char avr_txrx ( int fd, unsigned char byte ); +unsigned char avr_txrx(int fd, unsigned char byte); -int avr_cmd ( int fd, unsigned char cmd[4], unsigned char res[4] ); +int avr_cmd(int fd, unsigned char cmd[4], unsigned char res[4]); -unsigned char avr_read_byte ( int fd, struct avrpart * p, - int memtype, unsigned short addr ); +unsigned char avr_read_byte(int fd, struct avrpart * p, + int memtype, unsigned short addr); -int avr_read ( int fd, struct avrpart * p, int memtype ); +int avr_read(int fd, struct avrpart * p, int memtype); -int avr_write_byte ( int fd, struct avrpart * p, int memtype, - unsigned short addr, unsigned char data ); +int avr_write_byte(int fd, struct avrpart * p, int memtype, + unsigned short addr, unsigned char data); -int avr_write ( int fd, struct avrpart * p, int memtype, int size ); +int avr_write(int fd, struct avrpart * p, int memtype, int size); -int avr_program_enable ( int fd ); +int avr_program_enable(int fd); -int avr_chip_erase ( int fd, struct avrpart * p ); +int avr_chip_erase(int fd, struct avrpart * p); -int avr_signature ( int fd, unsigned char sig[4] ); +int avr_signature(int fd, unsigned char sig[4]); -void avr_powerup ( int fd ); +void avr_powerup(int fd); -void avr_powerdown ( int fd ); +void avr_powerdown(int fd); -int avr_initialize ( int fd, struct avrpart * p ); +int avr_initialize(int fd, struct avrpart * p); -char * avr_memtstr ( int memtype ); +char * avr_memtstr(int memtype); -int avr_initmem ( struct avrpart * p ); +int avr_initmem(struct avrpart * p); int avr_verify(struct avrpart * p, struct avrpart * v, int memtype, int size); -void avr_display ( FILE * f, struct avrpart * p, char * prefix ); +void avr_display(FILE * f, struct avrpart * p, char * prefix); #endif diff --git a/fileio.c b/fileio.c index db37f52e..f6d13c88 100644 --- a/fileio.c +++ b/fileio.c @@ -59,27 +59,27 @@ extern char progbuf[]; char * fileio_version = "$Id$"; -int b2ihex ( unsigned char * inbuf, int bufsize, +int b2ihex(unsigned char * inbuf, int bufsize, int recsize, int startaddr, - char * outfile, FILE * outf ); + char * outfile, FILE * outf); -int ihex2b ( char * infile, FILE * inf, - unsigned char * outbuf, int bufsize ); +int ihex2b(char * infile, FILE * inf, + unsigned char * outbuf, int bufsize); -int fileio_rbin ( struct fioparms * fio, - char * filename, FILE * f, unsigned char * buf, int size ); +int fileio_rbin(struct fioparms * fio, + char * filename, FILE * f, unsigned char * buf, int size); -int fileio_ihex ( struct fioparms * fio, - char * filename, FILE * f, unsigned char * buf, int size ); +int fileio_ihex(struct fioparms * fio, + char * filename, FILE * f, unsigned char * buf, int size); -int fileio_srec ( struct fioparms * fio, - char * filename, FILE * f, unsigned char * buf, int size ); +int fileio_srec(struct fioparms * fio, + char * filename, FILE * f, unsigned char * buf, int size); -int fmt_autodetect ( char * fname ); +int fmt_autodetect(char * fname); -char * fmtstr ( FILEFMT format ) +char * fmtstr(FILEFMT format) { switch (format) { case FMT_AUTO : return "auto-detect"; break; @@ -92,9 +92,9 @@ char * fmtstr ( FILEFMT format ) -int b2ihex ( unsigned char * inbuf, int bufsize, +int b2ihex(unsigned char * inbuf, int bufsize, int recsize, int startaddr, - char * outfile, FILE * outf ) + char * outfile, FILE * outf) { unsigned char * buf; unsigned int nextaddr; @@ -103,8 +103,8 @@ int b2ihex ( unsigned char * inbuf, int bufsize, unsigned char cksum; if (recsize > 255) { - fprintf ( stderr, "%s: recsize=%d, must be < 256\n", - progname, recsize ); + fprintf(stderr, "%s: recsize=%d, must be < 256\n", + progname, recsize); return -1; } @@ -119,14 +119,14 @@ int b2ihex ( unsigned char * inbuf, int bufsize, if (n) { cksum = 0; - fprintf ( outf, ":%02X%04X00", n, nextaddr ); + fprintf(outf, ":%02X%04X00", n, nextaddr); cksum += n + ((nextaddr >> 8) & 0x0ff) + (nextaddr & 0x0ff); for (i=0; i> 8) & 0x0ff) + (nextaddr & 0x0ff) + 1; cksum = -cksum; - fprintf ( outf, "%02X\n", cksum ); + fprintf(outf, "%02X\n", cksum); return nbytes; } -int ihex_readrec ( struct ihexrec * ihex, char * rec ) +int ihex_readrec(struct ihexrec * ihex, char * rec) { int i, j; char buf[8]; @@ -195,7 +195,7 @@ int ihex_readrec ( struct ihexrec * ihex, char * rec ) if (e == buf || *e != 0) return -1; - cksum = ihex->reclen + ((ihex->loadofs >> 8 ) & 0x0ff) + + cksum = ihex->reclen + ((ihex->loadofs >> 8) & 0x0ff) + (ihex->loadofs & 0x0ff) + ihex->rectyp; /* data */ @@ -241,8 +241,8 @@ int ihex_readrec ( struct ihexrec * ihex, char * rec ) * * */ -int ihex2b ( char * infile, FILE * inf, - unsigned char * outbuf, int bufsize ) +int ihex2b(char * infile, FILE * inf, + unsigned char * outbuf, int bufsize) { char buffer [ MAX_LINE_LEN ]; unsigned char * buf; @@ -337,8 +337,8 @@ int ihex2b ( char * infile, FILE * inf, -int fileio_rbin ( struct fioparms * fio, - char * filename, FILE * f, unsigned char * buf, int size ) +int fileio_rbin(struct fioparms * fio, + char * filename, FILE * f, unsigned char * buf, int size) { int rc; @@ -367,8 +367,8 @@ int fileio_rbin ( struct fioparms * fio, } -int fileio_ihex ( struct fioparms * fio, - char * filename, FILE * f, unsigned char * buf, int size ) +int fileio_ihex(struct fioparms * fio, + char * filename, FILE * f, unsigned char * buf, int size) { int rc; @@ -397,8 +397,8 @@ int fileio_ihex ( struct fioparms * fio, } -int fileio_srec ( struct fioparms * fio, - char * filename, FILE * f, unsigned char * buf, int size ) +int fileio_srec(struct fioparms * fio, + char * filename, FILE * f, unsigned char * buf, int size) { fprintf(stderr, "%s: Motorola S-Record %s format not yet supported\n", progname, fio->iodesc); @@ -406,7 +406,7 @@ int fileio_srec ( struct fioparms * fio, } -int fileio_setparms ( int op, struct fioparms * fp ) +int fileio_setparms(int op, struct fioparms * fp) { fp->op = op; @@ -437,7 +437,7 @@ int fileio_setparms ( int op, struct fioparms * fp ) -int fmt_autodetect ( char * fname ) +int fmt_autodetect(char * fname) { FILE * f; unsigned char buf[MAX_LINE_LEN]; @@ -501,8 +501,8 @@ int fmt_autodetect ( char * fname ) -int fileio ( int op, char * filename, FILEFMT format, - struct avrpart * p, int memtype, int size ) +int fileio(int op, char * filename, FILEFMT format, + struct avrpart * p, int memtype, int size) { int rc; FILE * f; diff --git a/fileio.h b/fileio.h index ed12e240..d775b2a9 100644 --- a/fileio.h +++ b/fileio.h @@ -52,11 +52,11 @@ enum { FIO_WRITE }; -char * fmtstr ( FILEFMT format ); +char * fmtstr(FILEFMT format); -int fileio_setparms ( int op, struct fioparms * fp ); +int fileio_setparms(int op, struct fioparms * fp); -int fileio ( int op, char * filename, FILEFMT format, - struct avrpart * p, int memtype, int size ); +int fileio(int op, char * filename, FILEFMT format, + struct avrpart * p, int memtype, int size); #endif diff --git a/main.c b/main.c index 3eb6e286..f4508913 100644 --- a/main.c +++ b/main.c @@ -124,7 +124,7 @@ unsigned int pinno[N_PINS]; /* * usage message */ -void usage ( void ) +void usage(void) { fprintf(stderr, "Usage: %s -p partno [-e] [-E exitspec[,exitspec]] [-f format] " @@ -139,7 +139,7 @@ void usage ( void ) /* * parse the -E string */ -int getexitspecs ( char *s, int *set, int *clr ) +int getexitspecs(char *s, int *set, int *clr) { char *cp; @@ -168,7 +168,7 @@ int getexitspecs ( char *s, int *set, int *clr ) } -int parse_cvsid ( char * cvsid, char * name, char * rev, char * datetime ) +int parse_cvsid(char * cvsid, char * name, char * rev, char * datetime) { int i, j; @@ -213,7 +213,7 @@ int parse_cvsid ( char * cvsid, char * name, char * rev, char * datetime ) } -int print_module_versions ( FILE * outf, char * timestamp ) +int print_module_versions(FILE * outf, char * timestamp) { char name[64], rev[16], datetime[64]; int y, m, d, h, min, s; @@ -664,7 +664,7 @@ void verify_pin_assigned(int pin, char * desc) /* * main routine */ -int main ( int argc, char * argv [] ) +int main(int argc, char * argv []) { int fd; /* file descriptor for parallel port */ int rc; /* general return code checking */ @@ -824,7 +824,7 @@ int main ( int argc, char * argv [] ) if (p == NULL) { fprintf(stderr, "%s: AVR Part \"%s\" not found. Valid parts are:\n\n", - progname, optarg ); + progname, optarg); avr_list_parts(stderr," "); fprintf(stderr, "\n"); return 1; @@ -925,7 +925,7 @@ int main ( int argc, char * argv [] ) fprintf(stderr, "%s: No AVR part has been specified, use \"-p Part\"\n\n" " Valid Parts are:\n\n", - progname ); + progname); avr_list_parts(stderr, " "); fprintf(stderr,"\n"); return 1; @@ -981,10 +981,10 @@ int main ( int argc, char * argv [] ) /* * open the parallel port */ - fd = open ( parallel, O_RDWR ); + fd = open(parallel, O_RDWR); if (fd < 0) { - fprintf ( stderr, "%s: can't open device \"%s\": %s\n\n", - progname, parallel, strerror(errno) ); + fprintf(stderr, "%s: can't open device \"%s\": %s\n\n", + progname, parallel, strerror(errno)); return 1; } @@ -996,7 +996,7 @@ int main ( int argc, char * argv [] ) ppidata = ppi_getall(fd, PPIDATA); if (ppidata < 0) { - fprintf ( stderr, "%s: error reading status of ppi data port\n", progname); + fprintf(stderr, "%s: error reading status of ppi data port\n", progname); exitrc = 1; ppidata = 0; /* clear all bits at exit */ goto main_exit; @@ -1023,7 +1023,7 @@ int main ( int argc, char * argv [] ) */ rc = avr_initialize(fd,p); if (rc < 0) { - fprintf ( stderr, "%s: initialization failed, rc=%d\n", progname, rc ); + fprintf(stderr, "%s: initialization failed, rc=%d\n", progname, rc); exitrc = 1; goto main_exit; } @@ -1031,9 +1031,9 @@ int main ( int argc, char * argv [] ) /* indicate ready */ LED_ON(fd, pinno[PIN_LED_RDY]); - fprintf ( stderr, + fprintf(stderr, "%s: AVR device initialized and ready to accept instructions\n", - progname ); + progname); /* * Let's read the signature bytes to make sure there is at least a @@ -1055,7 +1055,7 @@ int main ( int argc, char * argv [] ) fprintf(stderr, "%sDouble check connections and try again, " "or use -F to override\n" "%sthis check.\n\n", - progbuf, progbuf ); + progbuf, progbuf); exitrc = 1; goto main_exit; } @@ -1068,9 +1068,9 @@ int main ( int argc, char * argv [] ) * erase the chip's flash and eeprom memories, this is required * before the chip can accept new programming */ - fprintf(stderr, "%s: erasing chip\n", progname ); + fprintf(stderr, "%s: erasing chip\n", progname); avr_chip_erase(fd,p); - fprintf(stderr, "%s: done.\n", progname ); + fprintf(stderr, "%s: done.\n", progname); } @@ -1101,7 +1101,7 @@ int main ( int argc, char * argv [] ) */ fprintf(stderr, "%s: reading %s memory:\n", progname, avr_memtstr(memtype)); - rc = avr_read ( fd, p, memtype ); + rc = avr_read(fd, p, memtype); if (rc < 0) { fprintf(stderr, "%s: failed to read all of %s memory, rc=%d\n", progname, avr_memtstr(memtype), rc); @@ -1142,7 +1142,7 @@ int main ( int argc, char * argv [] ) progname, avr_memtstr(memtype)); if (!nowrite) { - rc = avr_write ( fd, p, memtype, size ); + rc = avr_write(fd, p, memtype, size); } else { /* @@ -1153,8 +1153,8 @@ int main ( int argc, char * argv [] ) } if (rc < 0) { - fprintf ( stderr, "%s: failed to write flash memory, rc=%d\n", - progname, rc ); + fprintf(stderr, "%s: failed to write flash memory, rc=%d\n", + progname, rc); exitrc = 1; goto main_exit; } @@ -1177,7 +1177,7 @@ int main ( int argc, char * argv [] ) progname, avr_memtstr(memtype), inputf); fprintf(stderr, "%s: reading on-chip %s data:\n", progname, avr_memtstr(memtype)); - rc = avr_read ( fd, v, memtype ); + rc = avr_read(fd, v, memtype); if (rc < 0) { fprintf(stderr, "%s: failed to read all of %s memory, rc=%d\n", progname, avr_memtstr(memtype), rc); diff --git a/ppi.c b/ppi.c index 257384f4..526378c3 100644 --- a/ppi.c +++ b/ppi.c @@ -73,7 +73,7 @@ char * ppi_version = "$Id$"; * set 'get' and 'set' appropriately for subsequent passage to ioctl() * to get/set the specified PPI registers. */ -int ppi_getops ( int reg, unsigned long * get, unsigned long * set ) +int ppi_getops(int reg, unsigned long * get, unsigned long * set) { switch (reg) { case PPIDATA: @@ -90,7 +90,7 @@ int ppi_getops ( int reg, unsigned long * get, unsigned long * set ) break; default: fprintf(stderr, "%s: avr_set(): invalid register=%d\n", - progname, reg ); + progname, reg); return -1; break; } @@ -102,13 +102,13 @@ int ppi_getops ( int reg, unsigned long * get, unsigned long * set ) /* * set the indicated bit of the specified register. */ -int ppi_set ( int fd, int reg, int bit ) +int ppi_set(int fd, int reg, int bit) { unsigned char v; unsigned long get, set; int rc; - rc = ppi_getops ( reg, &get, &set ); + rc = ppi_getops(reg, &get, &set); if (rc) return -1; @@ -123,13 +123,13 @@ int ppi_set ( int fd, int reg, int bit ) /* * clear the indicated bit of the specified register. */ -int ppi_clr ( int fd, int reg, int bit ) +int ppi_clr(int fd, int reg, int bit) { unsigned char v; unsigned long get, set; int rc; - rc = ppi_getops ( reg, &get, &set ); + rc = ppi_getops(reg, &get, &set); if (rc) return -1; @@ -144,13 +144,13 @@ int ppi_clr ( int fd, int reg, int bit ) /* * get the indicated bit of the specified register. */ -int ppi_get ( int fd, int reg, int bit ) +int ppi_get(int fd, int reg, int bit) { unsigned char v; unsigned long get, set; int rc; - rc = ppi_getops ( reg, &get, &set ); + rc = ppi_getops(reg, &get, &set); if (rc) return -1; @@ -163,13 +163,13 @@ int ppi_get ( int fd, int reg, int bit ) /* * toggle the indicated bit of the specified register. */ -int ppi_toggle ( int fd, int reg, int bit ) +int ppi_toggle(int fd, int reg, int bit) { unsigned char v; unsigned long get, set; int rc; - rc = ppi_getops ( reg, &get, &set ); + rc = ppi_getops(reg, &get, &set); if (rc) return -1; @@ -184,13 +184,13 @@ int ppi_toggle ( int fd, int reg, int bit ) /* * get all bits of the specified register. */ -int ppi_getall ( int fd, int reg ) +int ppi_getall(int fd, int reg) { unsigned char v; unsigned long get, set; int rc; - rc = ppi_getops ( reg, &get, &set ); + rc = ppi_getops(reg, &get, &set); if (rc) return -1; @@ -202,13 +202,13 @@ int ppi_getall ( int fd, int reg ) /* * set all bits of the specified register to val. */ -int ppi_setall ( int fd, int reg, int val ) +int ppi_setall(int fd, int reg, int val) { unsigned char v; unsigned long get, set; int rc; - rc = ppi_getops ( reg, &get, &set ); + rc = ppi_getops(reg, &get, &set); if (rc) return -1; @@ -221,7 +221,7 @@ int ppi_setall ( int fd, int reg, int val ) /* * pulse the indicated bit of the specified register. */ -int ppi_pulse ( int fd, int reg, int bit ) +int ppi_pulse(int fd, int reg, int bit) { ppi_toggle(fd, reg, bit); ppi_toggle(fd, reg, bit); @@ -230,7 +230,7 @@ int ppi_pulse ( int fd, int reg, int bit ) } -int ppi_setpin ( int fd, int pin, int value ) +int ppi_setpin(int fd, int pin, int value) { if (pin < 1 || pin > 17) @@ -250,7 +250,7 @@ int ppi_setpin ( int fd, int pin, int value ) } -int ppi_getpin ( int fd, int pin ) +int ppi_getpin(int fd, int pin) { int value; @@ -271,7 +271,7 @@ int ppi_getpin ( int fd, int pin ) } -int ppi_pulsepin ( int fd, int pin ) +int ppi_pulsepin(int fd, int pin) { if (pin < 1 || pin > 17) @@ -286,7 +286,7 @@ int ppi_pulsepin ( int fd, int pin ) } -int ppi_getpinmask ( int pin ) +int ppi_getpinmask(int pin) { if (pin < 1 || pin > 17) return -1; @@ -295,7 +295,7 @@ int ppi_getpinmask ( int pin ) } -int ppi_getpinreg ( int pin ) +int ppi_getpinreg(int pin) { if (pin < 1 || pin > 17) return -1; @@ -310,7 +310,7 @@ int ppi_getpinreg ( int pin ) * function in 'main()' and can use it to determine whether your sense * pin is actually sensing. */ -int ppi_sense ( int fd ) +int ppi_sense(int fd) { unsigned int pr; int count; @@ -319,10 +319,10 @@ int ppi_sense ( int fd ) count = 0; - fprintf ( stderr, + fprintf(stderr, "parallel port data:\n" " 111111111\n" - "123456789012345678\n" ); + "123456789012345678\n"); buf[17] = 0; pr = 1; diff --git a/ppi.h b/ppi.h index 1225e6fa..e335c8b8 100644 --- a/ppi.h +++ b/ppi.h @@ -41,33 +41,33 @@ enum { PPISTATUS }; -int ppi_getops ( int reg, unsigned long * get, unsigned long * set ); +int ppi_getops (int reg, unsigned long * get, unsigned long * set); -int ppi_set ( int fd, int reg, int bit ); +int ppi_set (int fd, int reg, int bit); -int ppi_clr ( int fd, int reg, int bit ); +int ppi_clr (int fd, int reg, int bit); -int ppi_get ( int fd, int reg, int bit ); +int ppi_get (int fd, int reg, int bit); -int ppi_toggle ( int fd, int reg, int bit ); +int ppi_toggle (int fd, int reg, int bit); -int ppi_getall ( int fd, int reg ); +int ppi_getall (int fd, int reg); -int ppi_setall ( int fd, int reg, int val ); +int ppi_setall (int fd, int reg, int val); -int ppi_pulse ( int fd, int reg, int bit ); +int ppi_pulse (int fd, int reg, int bit); -int ppi_setpin ( int fd, int pin, int value ); +int ppi_setpin (int fd, int pin, int value); -int ppi_getpin ( int fd, int pin ); +int ppi_getpin (int fd, int pin); -int ppi_pulsepin ( int fd, int pin ); +int ppi_pulsepin (int fd, int pin); -int ppi_getpinmask ( int pin ); +int ppi_getpinmask(int pin); -int ppi_getpinreg ( int pin ); +int ppi_getpinreg (int pin); -int ppi_sense ( int fd ); +int ppi_sense (int fd); #endif diff --git a/term.c b/term.c index 2355d16a..ea993ce5 100644 --- a/term.c +++ b/term.c @@ -87,7 +87,7 @@ struct command cmd[] = { -int nexttok ( char * buf, char ** tok, char ** next ) +int nexttok(char * buf, char ** tok, char ** next) { char * q, * n; @@ -116,7 +116,7 @@ int nexttok ( char * buf, char ** tok, char ** next ) } -int hexdump_line ( char * buffer, unsigned char * p, int n, int pad ) +int hexdump_line(char * buffer, unsigned char * p, int n, int pad) { char * hexdata = "0123456789abcdef"; char * b; @@ -148,13 +148,13 @@ int hexdump_line ( char * buffer, unsigned char * p, int n, int pad ) } -int chardump_line ( char * buffer, unsigned char * p, int n, int pad ) +int chardump_line(char * buffer, unsigned char * p, int n, int pad) { int i; char b [ 128 ]; for (i=0; i