From 5fa1d4d9f2e3c3f7947a76c2289a57f4fb69a444 Mon Sep 17 00:00:00 2001 From: anon Date: Wed, 13 Nov 2024 14:47:52 +0100 Subject: [PATCH] formatting & ordering --- source/display.c | 16 ++++---- source/global.h | 96 ++++++++++++++++++++++++------------------------ source/help.c | 8 ++-- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/source/display.c b/source/display.c index c279658..ad17088 100644 --- a/source/display.c +++ b/source/display.c @@ -35,6 +35,10 @@ * display functions */ +#include +#include +#include + #include "global.h" #include "build.h" #include "colors.h" @@ -45,20 +49,14 @@ # include "version.inc" #endif -#include -#include /* va_list stuff */ -#include -#include -#include - /* XXX */ #define MSGLINE 0 /* message line */ #define MSGCOL 0 /* message column */ static int * displine; /* screen line of displayed reference */ -int filelen = sizeof("File") - 1; /* file name display field length */ -int fcnlen = sizeof("Function") - 1; /* function name display field length */ -int numlen = 0; /* line number display field length */ +int filelen = sizeof("File") - 1; /* file name display field length */ +int fcnlen = sizeof("Function") - 1; /* function name display field length */ +int numlen = 0; /* line number display field length */ unsigned int disprefs; /* displayed references */ int field; /* input field */ diff --git a/source/global.h b/source/global.h index bdf9c5b..17b9d14 100644 --- a/source/global.h +++ b/source/global.h @@ -216,9 +216,7 @@ void verswp_window(void); bool interpret(int c); // XXX: probably rename int handle_input(const int c); int dispchar2int(const char c); -int process_mouse(); -int changestring(const char *from, const char *to, const bool *const change, - const int change_len); +int changestring(const char *from, const char *to, const bool *const change, const int change_len); void init_temp_files(void); void deinit_temp_files(void); @@ -229,51 +227,51 @@ void PCS_reset(void); void rlinit(void); -void addsrcfile(char *path); -void askforchar(void); -void askforreturn(void); -void cannotwrite(const char *const file); -void cannotopen(const char *const file); -void clearmsg(void); -void clearmsg2(void); -void countrefs(void); -void crossref(char *srcfile); -void dispinit(void); -void display(void); -void redisplay(void); -void drawscrollbar(int top, int bot); -void edit(const char * filename, const char *const linenum); -void editall(void); -void editref(int); -void entercurses(void); -void exitcurses(void); -void force_window(void); -void findcleanup(void); -void freesrclist(void); -void freeinclist(void); -void freecrossref(void); -void freefilelist(void); -const char *help(void); -void incfile(char *file, char *type); -void includedir(const char *dirname); -void initsymtab(void); -void makefilelist(const char * const * const argv); -void mousecleanup(void); -void myexit(int sig); -void myperror(char *text); -void progress(char *what, long current, long max); -void putfilename(char *srcfile); -void postmsg(char *msg); -void postmsg2(char *msg); -void posterr(char *msg, ...); -void postfatal(const char *msg, ...); -void putposting(char *term, int type); -void fetch_string_from_dbase(char *, size_t); -void shellpath(char *out, int limit, char *in); -void sourcedir(const char * dirlist); -void myungetch(int c); -void warning(char *text); -void writestring(char *s); +void addsrcfile(char *path); +void askforchar(void); +void askforreturn(void); +void cannotwrite(const char *const file); +void cannotopen(const char *const file); +void clearmsg(void); +void clearmsg2(void); +void countrefs(void); +void crossref(char *srcfile); +void edit(const char * filename, const char *const linenum); +void editall(void); +void editref(int); +void force_window(void); +void findcleanup(void); +void freesrclist(void); +void freeinclist(void); +void freecrossref(void); +void freefilelist(void); +void incfile(char *file, char *type); +void includedir(const char *dirname); +void initsymtab(void); +void makefilelist(const char * const * const argv); +void myexit(int sig); +void myperror(char *text); +void progress(char *what, long current, long max); +void putfilename(char *srcfile); +void postmsg(char *msg); +void postmsg2(char *msg); +void posterr(char *msg, ...); +void postfatal(const char *msg, ...); +void putposting(char *term, int type); +void fetch_string_from_dbase(char *, size_t); +void sourcedir(const char * dirlist); +void myungetch(int c); +void warning(char *text); +void writestring(char *s); + +void entercurses(void); +void exitcurses(void); +void drawscrollbar(int top, int bot); +void dispinit(void); +void display(void); +void redisplay(void); + +void shellpath(char *out, int limit, char *in); bool infilelist(const char * file); bool readrefs(char *filename); @@ -287,5 +285,7 @@ int hash(const char * ss); int execute(char *a, ...); long dbseek(long offset); +void mousecleanup(void); +int process_mouse(); #endif /* CSCOPE_GLOBAL_H */ diff --git a/source/help.c b/source/help.c index 3e91084..c2c9bc4 100644 --- a/source/help.c +++ b/source/help.c @@ -80,7 +80,8 @@ static char help_msg[] = "^D\t\tExit the program.\n" "\nNote: If the first character of the pattern you want to search for matches\n" "a command, type a \\ character first.\n" - "Note: Some ctrl keys may be occupied by your terminal configuration.\n"; + "Note: Some ctrl keys may be occupied by your terminal configuration.\n" +; static char changeing_help_msg[] = "When changing text, you can use these single-character commands:\n\n" @@ -94,9 +95,10 @@ static char changeing_help_msg[] = "ESC\t\tExit without changing the marked lines.\n" "!\t\tStart an interactive shell (type ^D to return).\n" "^L\t\tRedraw the screen.\n" - "?\t\tDisplay this list of commands.\n"; + "?\t\tDisplay this list of commands.\n" +; -const char *help(void) { +const char * help(void) { switch (input_mode) { case INPUT_CHANGE: case INPUT_CHANGE_TO: