unsigned char *srch_2; /* pointer to next character of string */
unsigned char *srch_3;
unsigned char *in_file_name = NULL; /* name of input file */
-char *tmp_file; /* temporary file name */
+unsigned char *tmp_file; /* temporary file name */
unsigned char *d_char; /* deleted character */
unsigned char *d_word; /* deleted word */
unsigned char *d_line; /* deleted line */
-char in_string[513]; /* buffer for reading a file */
+unsigned char in_string[513]; /* buffer for reading a file */
unsigned char *start_at_line = NULL; /* move to this line at start of session*/
int in; /* input character */
void function_key P_((void));
void command_prompt P_((void));
void command P_((char *cmd_str1));
-int scan P_((char *line, int offset, int column));
-char *get_string P_((char *prompt, int advance));
+int scan P_((unsigned char *line, int offset, int column));
+unsigned char *get_string P_((char *prompt, int advance));
int compare P_((char *string1, char *string2, int sensitive));
void goto_line P_((char *cmd_str));
void midscreen P_((int line, unsigned char *pnt));
void check_fp P_((void));
-void get_file P_((char *file_name));
+void get_file P_((unsigned char *file_name));
void get_line P_((int length, unsigned char *in_string, int *append));
void draw_screen P_((void));
void ee_finish P_((void));
int quit P_((int noverify));
void edit_abort P_((int arg));
void delete_text P_((void));
-int write_file P_((char *file_name, int fd));
+int write_file P_((unsigned char *file_name, int fd));
int search P_((int display_message));
void search_prompt P_((void));
void del_char P_((void));
}
else
{
- tmp_file = strdup(argv[1]);
+ tmp_file = (unsigned char*)strdup(argv[1]);
input_file = recv_file = TRUE;
}
{
int i1, i2;
unsigned char *string;
- char string2[8];
+ unsigned char string2[8];
if (character == TAB)
{
}
else if ((character >= '\0') && (character < ' '))
{
- string = table[(int) character];
+ string = (unsigned char*)table[(int) character];
}
else if ((character < 0) || (character >= 127))
{
if (character == 127)
- string = "^?";
+ string = (unsigned char*)"^?";
else if (!eightbit)
{
- sprintf(string2, "<%d>", (character < 0) ? (character + 256) : character);
+ sprintf((char*)string2, "<%d>", (character < 0) ? (character + 256) : character);
string = string2;
}
else
}
for (i2 = 0; (string[i2] != (char) NULL) && (((column+i2+1)-horiz_offset) < last_col); i2++)
waddch(window, string[i2]);
- return(strlen(string));
+ return(strlen((char*)string));
}
int
void
control() /* use control for commands */
{
- char *string;
+ unsigned char *string;
if (in == 1) /* control a */
{
string = get_string(ascii_code_str, TRUE);
if (*string != (char) NULL)
{
- in = atoi(string);
+ in = atoi((char*)string);
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
insert(in);
}
void
emacs_control()
{
- char *string;
+ unsigned char *string;
if (in == 1) /* control a */
bol();
string = get_string(ascii_code_str, TRUE);
if (*string != (char) NULL)
{
- in = atoi(string);
+ in = atoi((char*)string);
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
insert(in);
}
void
command_prompt()
{
- char *cmd_str;
+ unsigned char *cmd_str;
int result;
info_type = COMMANDS;
paint_info_win();
cmd_str = get_string(command_str, TRUE);
- if ((result = unique_test(cmd_str, commands)) != 1)
+ if ((result = unique_test((char*)cmd_str, commands)) != 1)
{
werase(com_win);
wmove(com_win, 0, 0);
free(cmd_str);
return;
}
- command(cmd_str);
+ command((char*)cmd_str);
wrefresh(com_win);
wmove(text_win, scr_vert, (scr_horz - horiz_offset));
info_type = CONTROL_KEYS;
in_pipe = TRUE;
cmd_str++;
if ((*cmd_str == ' ') || (*cmd_str == '\t'))
- cmd_str = next_word(cmd_str);
+ cmd_str = (char*)next_word((unsigned char*)cmd_str);
command(cmd_str);
in_pipe = FALSE;
}
out_pipe = TRUE;
cmd_str++;
if ((*cmd_str == ' ') || (*cmd_str == '\t'))
- cmd_str = next_word(cmd_str);
+ cmd_str = (char*)next_word((unsigned char*)cmd_str);
command(cmd_str);
out_pipe = FALSE;
}
int
scan(line, offset, column) /* determine horizontal position for get_string */
-char *line;
+unsigned char *line;
int offset;
int column;
{
- char *stemp;
+ unsigned char *stemp;
int i;
int j;
return(j);
}
-char *
+unsigned 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 */
{
- char *string;
- char *tmp_string;
- char *nam_str;
- char *g_point;
+ unsigned char *string;
+ unsigned char *tmp_string;
+ unsigned char *nam_str;
+ unsigned char *g_point;
int tmp_int;
int g_horz, g_position, g_pos;
int esc_flag;
wrefresh(com_win);
nam_str = tmp_string;
clear_com_win = TRUE;
- g_horz = g_position = scan(prompt, strlen(prompt), 0);
+ g_horz = g_position = scan((unsigned char*)prompt, strlen(prompt), 0);
g_pos = 0;
do
{
nam_str = tmp_string;
if (((*nam_str == ' ') || (*nam_str == 9)) && (advance))
nam_str = next_word(nam_str);
- string = malloc(strlen(nam_str) + 1);
- strcpy(string, nam_str);
+ string = malloc(strlen((char*)nam_str) + 1);
+ strcpy((char*)string, (char*)nam_str);
free(tmp_string);
wrefresh(com_win);
return(string);
if (input_file)
in_file_name = tmp_file;
- temp = stat(tmp_file, &buf);
+ temp = stat((char*)tmp_file, &buf);
buf.st_mode &= ~07777;
if ((temp != -1) && (buf.st_mode != 0100000) && (buf.st_mode != 0))
{
else
return;
}
- if ((get_fd = open(tmp_file, O_RDONLY)) == -1)
+ if ((get_fd = open((char*)tmp_file, O_RDONLY)) == -1)
{
wmove(com_win, 0, 0);
wclrtoeol(com_win);
input_file = FALSE;
if (start_at_line != NULL)
{
- line_num = atoi(start_at_line) - 1;
+ line_num = atoi((char*)start_at_line) - 1;
move_rel("d", line_num);
line_num = 0;
start_at_line = NULL;
void
get_file(file_name) /* read specified file into current buffer */
-char *file_name;
+unsigned char *file_name;
{
int can_read; /* file has at least one character */
int length; /* length of line read by read */
wmove(com_win, 0, 0);
wclrtoeol(com_win);
wprintw(com_win, reading_file_msg, file_name);
- if (access(file_name, 2)) /* check permission to write */
+ if (access((char*)file_name, 2)) /* check permission to write */
{
if ((errno == ENOTDIR) || (errno == EACCES) || (errno == EROFS) || (errno == ETXTBSY) || (errno == EFAULT))
{
void
ee_finish() /* prepare to exit edit session */
{
- char *file_name = in_file_name;
+ unsigned char *file_name = in_file_name;
/*
| changes made here should be reflected in the 'save'
quit(noverify) /* exit editor */
int noverify;
{
- char *ans;
+ unsigned char *ans;
touchwin(text_win);
wrefresh(text_win);
hack to get safe tempfile handling in ispell.*/
int
write_file(file_name, fd)
-char *file_name;
+unsigned char *file_name;
int fd;
{
char cr;
- char *tmp_point;
+ unsigned char *tmp_point;
struct text *out_line;
int lines, charac;
int temp_pos;
charac = lines = 0;
if ((fd < 0) &&
- ((in_file_name == NULL) || strcmp(in_file_name, file_name)))
+ ((in_file_name == NULL) || strcmp((char*)in_file_name, (char*)file_name)))
{
- if ((temp_fp = fopen(file_name, "r")))
+ if ((temp_fp = fopen((char*)file_name, "r")))
{
tmp_point = get_string(file_exists_prompt, TRUE);
if (toupper(*tmp_point) == toupper(*yes_char))
{
if (fd < 0)
{
- temp_fp = fopen(file_name, "w");
+ temp_fp = fopen((char*)file_name, "w");
}
else
{
srch_str = get_string(search_prompt_str, FALSE);
gold = FALSE;
srch_3 = srch_str;
- srch_1 = u_srch_str = malloc(strlen(srch_str) + 1);
+ srch_1 = u_srch_str = malloc(strlen((char*)srch_str) + 1);
while (*srch_3 != (char) NULL)
{
*srch_1 = toupper(*srch_3);
int lines;
{
int i;
- char *tmp;
+ unsigned char *tmp;
if (*direction == 'u')
{
file_op(arg)
int arg;
{
- char *string;
+ unsigned char *string;
int flag;
if (arg == SAVE_FILE)