explicitely declare void function argg and static functions

This commit is contained in:
marschap
2007-04-11 11:48:01 +00:00
parent 25c18aa3df
commit 23f9b667f7
6 changed files with 94 additions and 79 deletions
+11 -40
View File
@@ -34,7 +34,7 @@
#define DEFAULT_CONFIGFILE SYSCONFDIR "/lcdvc.conf"
char * help_text =
char *help_text =
"lcdvc - LCDproc virtual console\n"
"\n"
"Copyright (c) 2002, Joris Robijn, 2006 Peter Marschall.\n"
@@ -62,14 +62,12 @@ char *vcs_device = UNSET_STR;
char *keys[4];
/* Function prototypes */
int process_command_line(int argc, char ** argv);
int process_configfile(char * configfile);
int connect_and_setup();
int update_display();
int process_response(char * str);
int main_loop();
static int process_command_line(int argc, char **argv);
static int process_configfile(char *configfile);
static int main_loop(void);
int main( int argc, char ** argv )
int main(int argc, char **argv)
{
int e = 0;
@@ -99,7 +97,8 @@ int main( int argc, char ** argv )
return 0;
}
int process_command_line( int argc, char ** argv )
static int process_command_line(int argc, char **argv)
{
int c;
int error = 0;
@@ -166,7 +165,8 @@ int process_command_line( int argc, char ** argv )
return error;
}
int process_configfile( char * configfile )
static int process_configfile(char *configfile)
{
if (strcmp(configfile, UNSET_STR) == 0) {
configfile = DEFAULT_CONFIGFILE;
@@ -205,37 +205,8 @@ int process_configfile( char * configfile )
return 0;
}
int split( char * str, char delim, char * parts[], int maxparts )
/* Splits a string into parts, to which pointers will be returned in &parts.
* The return value is the number of parts.
* maxparts is the maximum number of parts returned. If more parts exist
* they are (unsplit) in the last part.
* The parts are split at the character delim.
* No new space will be allocated, the string str will be mutated !
*/
{
char * p1 = str;
char * p2;
int part_nr = 0;
/* Find the delim char to end the current part */
while (part_nr < maxparts - 1 && (p2 = strchr(p1, delim))) {
/* subsequent parts... */
*p2 = 0;
parts[part_nr] = p1;
p1 = p2 + 1; /* Just after the delim char */
part_nr ++;
}
/* and the last part... */
parts[part_nr] = p1;
part_nr ++;
return part_nr;
}
int main_loop()
static int main_loop(void)
{
int num_bytes;
char buf[80];