Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170781034
D39670.id120602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
17 KB
Referenced Files
None
Subscribers
None
D39670.id120602.diff
View Options
diff --git a/contrib/ee/ee.c b/contrib/ee/ee.c
--- a/contrib/ee/ee.c
+++ b/contrib/ee/ee.c
@@ -538,10 +538,9 @@
#endif /* HAS_STDLIB */
#endif /* __STDC__ */
+/* beginning of main program */
int
-main(argc, argv) /* beginning of main program */
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
int counter;
@@ -669,11 +668,9 @@
return(0);
}
+/* resize the line to length + factor*/
unsigned char *
-resiz_line(factor, rline, rpos) /* resize the line to length + factor*/
-int factor; /* resize factor */
-struct text *rline; /* position in line */
-int rpos;
+resiz_line(int factor, struct text *rline, int rpos)
{
unsigned char *rpoint;
int resiz_var;
@@ -685,9 +682,9 @@
return(rpoint);
}
+/* insert character into line */
void
-insert(character) /* insert character into line */
-int character; /* new character */
+insert(int character)
{
int counter;
int value;
@@ -770,9 +767,9 @@
draw_line(scr_vert, scr_horz, point, position, curr_line->line_length);
}
+/* delete character */
void
-delete(disp) /* delete character */
-int disp;
+delete(int disp)
{
unsigned char *tp;
unsigned char *temp2;
@@ -877,9 +874,9 @@
formatted = FALSE;
}
+/* find the proper horizontal position for the pointer */
void
-scanline(pos) /* find the proper horizontal position for the pointer */
-unsigned char *pos;
+scanline(unsigned char *pos)
{
int temp;
unsigned char *ptr;
@@ -917,9 +914,9 @@
}
}
+/* give the number of spaces to shift */
int
-tabshift(temp_int) /* give the number of spaces to shift */
-int temp_int;
+tabshift(int temp_int)
{
int leftover;
@@ -930,11 +927,9 @@
return (9 - leftover);
}
+/* output non-printing character */
int
-out_char(window, character, column) /* output non-printing character */
-WINDOW *window;
-int character;
-int column;
+out_char(WINDOW *window, int character, int column)
{
int i1, i2;
char *string;
@@ -979,10 +974,9 @@
return(strlen(string));
}
+/* return the length of the character */
int
-len_char(character, column) /* return the length of the character */
-int character;
-int column; /* the column must be known to provide spacing for tabs */
+len_char(int character, int column)
{
int length;
@@ -1002,13 +996,9 @@
return(length);
}
+/* redraw line from current position */
void
-draw_line(vertical, horiz, ptr, t_pos, length) /* redraw line from current position */
-int vertical; /* current vertical position on screen */
-int horiz; /* current horizontal position on screen */
-unsigned char *ptr; /* pointer to line */
-int t_pos; /* current position (offset in bytes) from bol */
-int length; /* length (in bytes) of line */
+draw_line(int vertical, int horiz, unsigned char *ptr, int t_pos, int length)
{
int d; /* partial length of special or tab char to display */
unsigned char *temp; /* temporary pointer to position in line */
@@ -1059,9 +1049,9 @@
wmove(text_win, vertical, (horiz - horiz_offset));
}
+/* insert new line */
void
-insert_line(disp) /* insert new line */
-int disp;
+insert_line(int disp)
{
int temp_pos;
int temp_pos2;
@@ -1136,18 +1126,23 @@
}
}
-struct text *txtalloc() /* allocate space for line structure */
+/* allocate space for line structure */
+struct text *
+txtalloc(void)
{
return((struct text *) malloc(sizeof( struct text)));
}
-struct files *name_alloc() /* allocate space for file name list node */
+/* allocate space for file name list node */
+struct files *
+name_alloc(void)
{
return((struct files *) malloc(sizeof( struct files)));
}
-unsigned char *next_word(string) /* move to next word in string */
-unsigned char *string;
+/* move to next word in string */
+unsigned char *
+next_word(unsigned char *string)
{
while ((*string != '\0') && ((*string != 32) && (*string != 9)))
string++;
@@ -1156,8 +1151,9 @@
return(string);
}
+/* move to start of previous word in text */
void
-prev_word() /* move to start of previous word in text */
+prev_word(void)
{
if (position != 1)
{
@@ -1177,8 +1173,9 @@
left(TRUE);
}
+/* use control for commands */
void
-control() /* use control for commands */
+control(void)
{
char *string;
@@ -1256,7 +1253,7 @@
*/
void
-emacs_control()
+emacs_control(void)
{
char *string;
@@ -1329,8 +1326,9 @@
}
}
+/* go to bottom of file */
void
-bottom() /* go to bottom of file */
+bottom(void)
{
while (curr_line->next_line != NULL)
{
@@ -1345,8 +1343,9 @@
scr_pos = scr_horz;
}
+/* go to top of file */
void
-top() /* go to top of file */
+top(void)
{
while (curr_line->prev_line != NULL)
{
@@ -1361,8 +1360,9 @@
scr_pos = scr_horz;
}
+/* move pointers to start of next line */
void
-nextline() /* move pointers to start of next line */
+nextline(void)
{
curr_line = curr_line->next_line;
absolute_lin++;
@@ -1380,8 +1380,9 @@
scr_vert++;
}
+/* move pointers to start of previous line*/
void
-prevline() /* move pointers to start of previous line*/
+prevline(void)
{
curr_line = curr_line->prev_line;
absolute_lin--;
@@ -1401,9 +1402,9 @@
}
}
+/* move left one character */
void
-left(disp) /* move left one character */
-int disp;
+left(int disp)
{
if (point != curr_line->line) /* if not at begin of line */
{
@@ -1436,9 +1437,9 @@
}
}
+/* move right one character */
void
-right(disp) /* move right one character */
-int disp;
+right(int disp)
{
if (position < curr_line->line_length)
{
@@ -1476,8 +1477,9 @@
}
}
+/* move to the same column as on other line */
void
-find_pos() /* move to the same column as on other line */
+find_pos(void)
{
scr_horz = 0;
position = 1;
@@ -1512,8 +1514,9 @@
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
}
+/* move up one line */
void
-up() /* move up one line */
+up(void)
{
if (curr_line->prev_line != NULL)
{
@@ -1523,8 +1526,9 @@
}
}
+/* move down one line */
void
-down() /* move down one line */
+down(void)
{
if (curr_line->next_line != NULL)
{
@@ -1533,8 +1537,9 @@
}
}
+/* process function key */
void
-function_key() /* process function key */
+function_key(void)
{
if (in == KEY_LEFT)
left(TRUE);
@@ -1639,7 +1644,7 @@
}
void
-print_buffer()
+print_buffer(void)
{
char buffer[256];
@@ -1652,7 +1657,7 @@
}
void
-command_prompt()
+command_prompt(void)
{
char *cmd_str;
int result;
@@ -1687,9 +1692,9 @@
free(cmd_str);
}
+/* process commands from keyboard */
void
-command(cmd_str1) /* process commands from keyboard */
-char *cmd_str1;
+command(char *cmd_str1)
{
char *cmd_str2 = NULL;
char *cmd_str = cmd_str1;
@@ -1841,11 +1846,9 @@
free(cmd_str2);
}
+/* determine horizontal position for get_string */
int
-scan(line, offset, column) /* determine horizontal position for get_string */
-char *line;
-int offset;
-int column;
+scan(char *line, int offset, int column)
{
char *stemp;
int i;
@@ -1863,10 +1866,9 @@
return(j);
}
+/* read string from input on command line */
char *
-get_string(prompt, advance) /* read string from input on command line */
-char *prompt; /* string containing user prompt message */
-int advance; /* if true, skip leading spaces and tabs */
+get_string(char *prompt, int advance)
{
char *string;
char *tmp_string;
@@ -1944,11 +1946,9 @@
return(string);
}
+/* compare two strings */
int
-compare(string1, string2, sensitive) /* compare two strings */
-char *string1;
-char *string2;
-int sensitive;
+compare(char *string1, char *string2, int sensitive)
{
char *strng1;
char *strng2;
@@ -1983,8 +1983,7 @@
}
void
-goto_line(cmd_str)
-char *cmd_str;
+goto_line(char *cmd_str)
{
int number;
int i;
@@ -2040,10 +2039,9 @@
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
}
+/* put current line in middle of screen */
void
-midscreen(line, pnt) /* put current line in middle of screen */
-int line;
-unsigned char *pnt;
+midscreen(int line, unsigned char *pnt)
{
struct text *mid_line;
int i;
@@ -2061,10 +2059,9 @@
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
}
+/* get arguments from command line */
void
-get_options(numargs, arguments) /* get arguments from command line */
-int numargs;
-char *arguments[];
+get_options(int numargs, char *arguments[])
{
char *buff;
int count;
@@ -2153,8 +2150,9 @@
}
}
+/* open or close files according to flags */
void
-check_fp() /* open or close files according to flags */
+check_fp(void)
{
int line_num;
int temp;
@@ -2235,9 +2233,9 @@
wrefresh(text_win);
}
+/* read specified file into current buffer */
void
-get_file(file_name) /* read specified file into current buffer */
-char *file_name;
+get_file(char *file_name)
{
int can_read; /* file has at least one character */
int length; /* length of line read by read */
@@ -2303,11 +2301,9 @@
}
}
+/* read string and split into lines */
void
-get_line(length, in_string, append) /* read string and split into lines */
-int length; /* length of string read by read */
-unsigned char *in_string; /* string read by read */
-int *append; /* TRUE if must append more text to end of current line */
+get_line(int length, unsigned char *in_string, int *append)
{
unsigned char *str1;
unsigned char *str2;
@@ -2394,8 +2390,9 @@
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
}
+/* prepare to exit edit session */
void
-finish() /* prepare to exit edit session */
+finish(void)
{
char *file_name = in_file_name;
@@ -2431,9 +2428,9 @@
}
}
+/* exit editor */
int
-quit(noverify) /* exit editor */
-int noverify;
+quit(int noverify)
{
char *ans;
@@ -2469,8 +2466,7 @@
}
void
-edit_abort(arg)
-int arg;
+edit_abort(int arg)
{
wrefresh(com_win);
resetty();
@@ -2480,7 +2476,7 @@
}
void
-delete_text()
+delete_text(void)
{
while (curr_line->next_line != NULL)
curr_line = curr_line->next_line;
@@ -2501,9 +2497,7 @@
}
int
-write_file(file_name, warn_if_exists)
-char *file_name;
-int warn_if_exists;
+write_file(char *file_name, int warn_if_exists)
{
char cr;
char *tmp_point;
@@ -2576,9 +2570,9 @@
return(FALSE);
}
+/* search for string in srch_str */
int
-search(display_message) /* search for string in srch_str */
-int display_message;
+search(int display_message)
{
int lines_moved;
int iter;
@@ -2690,8 +2684,9 @@
return(found);
}
+/* prompt and read search string (srch_str) */
void
-search_prompt() /* prompt and read search string (srch_str) */
+search_prompt(void)
{
if (srch_str != NULL)
free(srch_str);
@@ -2711,8 +2706,9 @@
search(TRUE);
}
+/* delete current character */
void
-del_char() /* delete current character */
+del_char(void)
{
in = 8; /* backspace */
if (position < curr_line->line_length) /* if not end of line */
@@ -2735,8 +2731,9 @@
}
}
+/* undelete last deleted character */
void
-undel_char() /* undelete last deleted character */
+undel_char(void)
{
if (d_char[0] == '\n') /* insert line if last del_char deleted eol */
insert_line(TRUE);
@@ -2752,8 +2749,9 @@
}
}
+/* delete word in front of cursor */
void
-del_word() /* delete word in front of cursor */
+del_word(void)
{
int tposit;
int difference;
@@ -2806,8 +2804,9 @@
formatted = FALSE;
}
+/* undelete last deleted word */
void
-undel_word() /* undelete last deleted word */
+undel_word(void)
{
int temp;
int tposit;
@@ -2868,8 +2867,9 @@
draw_line(scr_vert, scr_horz, point, position, curr_line->line_length);
}
+/* delete from cursor to end of line */
void
-del_line() /* delete from cursor to end of line */
+del_line(void)
{
unsigned char *dl1;
unsigned char *dl2;
@@ -2901,8 +2901,9 @@
text_changes = TRUE;
}
+/* undelete last deleted line */
void
-undel_line() /* undelete last deleted line */
+undel_line(void)
{
unsigned char *ud1;
unsigned char *ud2;
@@ -2929,8 +2930,9 @@
draw_line(scr_vert, scr_horz,point,position,curr_line->line_length);
}
+/* advance to next word */
void
-adv_word() /* advance to next word */
+adv_word(void)
{
while ((position < curr_line->line_length) && ((*point != 32) && (*point != 9)))
right(TRUE);
@@ -2938,10 +2940,9 @@
right(TRUE);
}
+/* move relative to current line */
void
-move_rel(direction, lines) /* move relative to current line */
-int direction;
-int lines;
+move_rel(int direction, int lines)
{
int i;
char *tmp;
@@ -3006,8 +3007,9 @@
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
}
+/* go to end of line */
void
-eol() /* go to end of line */
+eol(void)
{
if (position < curr_line->line_length)
{
@@ -3022,8 +3024,9 @@
}
}
+/* move to beginning of line */
void
-bol() /* move to beginning of line */
+bol(void)
{
if (point != curr_line->line)
{
@@ -3037,8 +3040,9 @@
}
}
+/* advance to beginning of next line */
void
-adv_line() /* advance to beginning of next line */
+adv_line(void)
{
if ((point != curr_line->line) || (scr_pos > 0))
{
@@ -3054,7 +3058,7 @@
}
void
-from_top()
+from_top(void)
{
struct text *tmpline = first_line;
int x = 1;
@@ -3067,9 +3071,9 @@
absolute_lin = x;
}
+/* execute shell command */
void
-sh_command(string) /* execute shell command */
-char *string; /* string containing user command */
+sh_command(char *string)
{
char *temp_point;
char *last_slash;
@@ -3264,8 +3268,9 @@
redraw();
}
+/* set up the terminal for operating with ae */
void
-set_up_term() /* set up the terminal for operating with ae */
+set_up_term(void)
{
if (!curses_initialized)
{
@@ -3320,7 +3325,7 @@
}
void
-resize_check()
+resize_check(void)
{
if ((LINES == local_LINES) && (COLS == local_COLS))
return;
@@ -3338,8 +3343,7 @@
static char item_alpha[] = "abcdefghijklmnopqrstuvwxyz0123456789 ";
int
-menu_op(menu_list)
-struct menu_entries menu_list[];
+menu_op(struct menu_entries menu_list[])
{
WINDOW *temp_win;
int max_width, max_height;
@@ -3553,12 +3557,9 @@
}
void
-paint_menu(menu_list, max_width, max_height, list_size, top_offset, menu_win,
- off_start, vert_size)
-struct menu_entries menu_list[];
-int max_width, max_height, list_size, top_offset;
-WINDOW *menu_win;
-int off_start, vert_size;
+paint_menu(struct menu_entries menu_list[], int max_width, int max_height,
+ int list_size, int top_offset, WINDOW *menu_win, int off_start,
+ int vert_size)
{
int counter, temp_int;
@@ -3656,7 +3657,7 @@
}
void
-help()
+help(void)
{
int counter;
@@ -3685,7 +3686,7 @@
}
void
-paint_info_win()
+paint_info_win(void)
{
int counter;
@@ -3712,7 +3713,7 @@
}
void
-no_info_window()
+no_info_window(void)
{
if (!info_window)
return;
@@ -3730,7 +3731,7 @@
}
void
-create_info_window()
+create_info_window(void)
{
if (info_window)
return;
@@ -3752,8 +3753,7 @@
}
int
-file_op(arg)
-int arg;
+file_op(int arg)
{
char *string;
int flag;
@@ -3826,7 +3826,7 @@
}
void
-shell_op()
+shell_op(void)
{
char *string;
@@ -3839,7 +3839,7 @@
}
void
-leave_op()
+leave_op(void)
{
if (text_changes)
{
@@ -3850,7 +3850,7 @@
}
void
-redraw()
+redraw(void)
{
if (info_window)
{
@@ -3867,9 +3867,9 @@
| block of text with blank lines before and after the block).
*/
+/* test if line has any non-space characters */
int
-Blank_Line(test_line) /* test if line has any non-space characters */
-struct text *test_line;
+Blank_Line(struct text *test_line)
{
unsigned char *line;
int length;
@@ -3900,8 +3900,9 @@
return(TRUE);
}
+/* format the paragraph according to set margins */
void
-Format() /* format the paragraph according to set margins */
+Format(void)
{
int string_count;
int offset;
@@ -4128,8 +4129,9 @@
".init.ee"
};
+/* check for init file and read it if it exists */
void
-ee_init() /* check for init file and read it if it exists */
+ee_init(void)
{
FILE *init_file;
unsigned char *string;
@@ -4253,7 +4255,7 @@
*/
void
-dump_ee_conf()
+dump_ee_conf(void)
{
FILE *init_file;
FILE *old_init_file = NULL;
@@ -4352,9 +4354,9 @@
}
}
+/* echo the given string */
void
-echo_string(string) /* echo the given string */
-char *string;
+echo_string(char *string)
{
char *temp;
int Counter;
@@ -4404,8 +4406,9 @@
fflush(stdout);
}
+/* check spelling of words in the editor */
void
-spell_op() /* check spelling of words in the editor */
+spell_op(void)
{
if (restrict_mode())
{
@@ -4425,7 +4428,7 @@
}
void
-ispell_op()
+ispell_op(void)
{
char template[128], *name;
char string[256];
@@ -4457,8 +4460,7 @@
}
int
-first_word_len(test_line)
-struct text *test_line;
+first_word_len(struct text *test_line)
{
int counter;
unsigned char *pnt;
@@ -4493,8 +4495,9 @@
return(counter);
}
+/* format the paragraph according to set margins */
void
-Auto_Format() /* format the paragraph according to set margins */
+Auto_Format(void)
{
int string_count;
int offset;
@@ -4754,7 +4757,7 @@
}
void
-modes_op()
+modes_op(void)
{
int ret_value;
int counter;
@@ -4853,10 +4856,9 @@
while (ret_value != 0);
}
+/* a strchr() look-alike for systems without strchr() */
char *
-is_in_string(string, substring) /* a strchr() look-alike for systems without
- strchr() */
-char * string, *substring;
+is_in_string(char *string, char *substring)
{
char *full, *sub;
@@ -4878,8 +4880,7 @@
*/
char *
-resolve_name(name)
-char *name;
+resolve_name(char *name)
{
char long_buffer[1024];
char short_buffer[128];
@@ -5002,7 +5003,7 @@
}
int
-restrict_mode()
+restrict_mode(void)
{
if (!restricted)
return(FALSE);
@@ -5022,9 +5023,7 @@
*/
int
-unique_test(string, list)
-char *string;
-char *list[];
+unique_test(char *string, char *list[])
{
int counter;
int num_match;
@@ -5050,9 +5049,7 @@
*/
char *
-catgetlocal(number, string)
-int number;
-char *string;
+catgetlocal(int number, char *string)
{
char *temp1;
char *temp2;
@@ -5076,7 +5073,7 @@
*/
void
-strings_init()
+strings_init(void)
{
int counter;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 7, 2:32 PM (2 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38470036
Default Alt Text
D39670.id120602.diff (17 KB)
Attached To
Mode
D39670: ee: Use C89 function definitions.
Attached
Detach File
Event Timeline
Log In to Comment