1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

[cflags] Removed -Wno-pointer-sign

Likely some new bugs were introduced by this change.
The long term goal is clean compilation by g++.
This commit is contained in:
Witold Filipczyk 2021-01-02 16:20:27 +01:00
parent d05f781792
commit 0fea79cc8f
408 changed files with 4300 additions and 4472 deletions

View File

@ -1798,16 +1798,16 @@ if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
;;
4.5*)
CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign -Wno-enum-compare"
CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-enum-compare"
;;
4.*|5.*|6.*|7.*|8|8.*|9|9.*)
# Do not show warnings related to (char * | unsigned char *) type
# difference.
CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign"
CFLAGS="$CFLAGS -fno-strict-aliasing"
;;
10|10.*)
# gettext
CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign -Wno-builtin-declaration-mismatch"
CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-builtin-declaration-mismatch"
;;
*)
# These should be ok using -Werror

View File

@ -36,13 +36,13 @@
#ifdef DEBUG_BUTTON_HOTKEY
void
add_dlg_button_do(const unsigned char *file, int line,
struct dialog *dlg, unsigned char *text, int flags,
add_dlg_button_do(const char *file, int line,
struct dialog *dlg, char *text, int flags,
widget_handler_T *handler, void *data,
done_handler_T *done, void *done_data)
#else
void
add_dlg_button_do(struct dialog *dlg, unsigned char *text, int flags,
add_dlg_button_do(struct dialog *dlg, char *text, int flags,
widget_handler_T *handler, void *data,
done_handler_T *done, void *done_data)
#endif
@ -63,7 +63,7 @@ add_dlg_button_do(struct dialog *dlg, unsigned char *text, int flags,
widget->info.button.truetextlen = textlen;
if (textlen > 1) {
unsigned char *pos = memchr(text, '~', textlen - 1);
char *pos = memchr(text, '~', textlen - 1);
if (pos) {
widget->info.button.hotkey_pos = pos - text;
@ -217,7 +217,7 @@ display_button(struct dialog_data *dlg_data, struct widget_data *widget_data)
draw_dlg_text(dlg_data, pos->x, pos->y, BUTTON_LEFT, BUTTON_LEFT_LEN, 0, color);
if (len > 0) {
unsigned char *text = widget_data->widget->text;
char *text = widget_data->widget->text;
int hk_pos = widget_data->widget->info.button.hotkey_pos;
int attr;

View File

@ -36,7 +36,7 @@ struct widget_info_button {
/** @def add_dlg_ok_button
* Add a button that will close the dialog if pressed.
*
* void add_dlg_ok_button(struct dialog *dlg, unsigned char *text, int flags,
* void add_dlg_ok_button(struct dialog *dlg, char *text, int flags,
* ::done_handler_T *done, void *data);
*
* @param dlg
@ -61,7 +61,7 @@ struct widget_info_button {
/** @def add_dlg_button
* Add a button that need not close the dialog if pressed.
*
* void add_dlg_button(struct dialog *dlg, unsigned char *text, int flags,
* void add_dlg_button(struct dialog *dlg, char *text, int flags,
* ::widget_handler_T *handler, void *data);
*
* @param handler
@ -76,7 +76,7 @@ struct widget_info_button {
* The other parameters are as in ::add_dlg_ok_button. */
#ifdef DEBUG_BUTTON_HOTKEY
void add_dlg_button_do(const unsigned char *file, int line, struct dialog *dlg, unsigned char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data);
void add_dlg_button_do(const char *file, int line, struct dialog *dlg, char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data);
#define add_dlg_ok_button(dlg, text, flags, done, data) \
add_dlg_button_do(__FILE__, __LINE__, dlg, text, flags, ok_dialog, NULL, done, data)
@ -84,7 +84,7 @@ void add_dlg_button_do(const unsigned char *file, int line, struct dialog *dlg,
add_dlg_button_do(__FILE__, __LINE__, dlg, text, flags, handler, data, NULL, NULL)
#else
void add_dlg_button_do(struct dialog *dlg, unsigned char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data);
void add_dlg_button_do(struct dialog *dlg, char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data);
#define add_dlg_ok_button(dlg, text, flags, done, data) \
add_dlg_button_do(dlg, text, flags, ok_dialog, NULL, done, data)

View File

@ -21,7 +21,7 @@
#define CHECKBOX_LS (CHECKBOX_LEN + CHECKBOX_SPACING) /* "[X] " */
void
add_dlg_radio_do(struct dialog *dlg, unsigned char *text,
add_dlg_radio_do(struct dialog *dlg, char *text,
int groupid, int groupnum, int *data)
{
struct widget *widget = &dlg->widgets[dlg->number_of_widgets++];
@ -42,7 +42,7 @@ dlg_format_checkbox(struct dialog_data *dlg_data,
enum format_align align, int format_only)
{
struct terminal *term = dlg_data->win->term;
unsigned char *text = widget_data->widget->text;
char *text = widget_data->widget->text;
set_box(&widget_data->box, x, *y, CHECKBOX_LEN, CHECKBOX_HEIGHT);
@ -63,7 +63,7 @@ display_checkbox(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct terminal *term = dlg_data->win->term;
struct color_pair *color;
unsigned char *text;
char *text;
struct el_box *pos = &widget_data->box;
int selected = is_selected_widget(dlg_data, widget_data);

View File

@ -24,7 +24,7 @@ struct widget_data_info_checkbox {
};
void add_dlg_radio_do(struct dialog *dlg, unsigned char *text, int groupid, int groupnum, int *data);
void add_dlg_radio_do(struct dialog *dlg, char *text, int groupid, int groupnum, int *data);
#define add_dlg_radio(dlg, text, groupid, groupnum, data) \
add_dlg_radio_do(dlg, text, groupid, groupnum, data)

View File

@ -97,7 +97,7 @@ redraw_dialog(struct dialog_data *dlg_data, int layout)
title_color = get_bfu_color(term, "dialog.title");
if (title_color && dlg_data->real_box.width > 2) {
unsigned char *title = dlg_data->dlg->title;
char *title = dlg_data->dlg->title;
int titlelen = strlen(title);
int titlecells = titlelen;
int x, y;
@ -333,7 +333,7 @@ select_button_by_key(struct dialog_data *dlg_data)
foreach_widget(dlg_data, widget_data) {
int hk_pos;
unsigned char *hk_ptr;
char *hk_ptr;
term_event_char_T hk_char;
if (widget_data->widget->type != WIDGET_BUTTON)

View File

@ -49,7 +49,7 @@ struct dialog_refresh {
};
struct dialog {
unsigned char *title;
char *title;
void *udata;
void *udata2;
struct dialog_refresh *refresh;
@ -123,7 +123,7 @@ struct dialog {
* @return
* The address of the additional data. */
#define get_dialog_offset(dlg, n) \
(((unsigned char *) dlg) + sizeof_dialog(n, 0))
(((char *) dlg) + sizeof_dialog(n, 0))
#define dialog_has_refresh(dlg_data) \
((dlg_data)->dlg->refresh && (dlg_data)->dlg->refresh->timer != TIMER_ID_UNDEF)

View File

@ -36,7 +36,7 @@ dlg_format_group(struct dialog_data *dlg_data,
while (n--) {
int widget_width;
int width;
unsigned char *text = widget_data->widget->text;
char *text = widget_data->widget->text;
int label_length;
int label_padding;

View File

@ -413,7 +413,7 @@ push_hierbox_info_button(struct dialog_data *dlg_data, struct widget_data *butto
struct listbox_item *item = box->sel;
struct terminal *term = dlg_data->win->term;
struct listbox_context *context;
unsigned char *msg;
char *msg;
if (!item) return EVENT_PROCESSED;
@ -595,8 +595,8 @@ print_delete_error(struct listbox_item *item, struct terminal *term,
const struct listbox_ops *ops, enum delete_error err)
{
struct string msg;
unsigned char *errmsg;
unsigned char *text;
char *errmsg;
char *text;
switch (err) {
case DELETE_IMPOSSIBLE:
@ -631,7 +631,7 @@ print_delete_error(struct listbox_item *item, struct terminal *term,
mem_free(text);
if (item->type == BI_LEAF) {
unsigned char *info = ops->get_info(item, term);
char *info = ops->get_info(item, term);
if (info) {
add_format_to_string(&msg, "\n\n%s", info);
@ -722,7 +722,7 @@ query_delete_selected_item(void *context_)
struct listbox_data *box = oldcontext->box;
const struct listbox_ops *ops = box->ops;
struct listbox_item *item = box->sel;
unsigned char *text;
char *text;
enum delete_error delete_;
assert(item);
@ -754,7 +754,7 @@ query_delete_selected_item(void *context_)
MSG_BOX_BUTTON(N_("~Yes"), push_ok_delete_button, B_ENTER),
MSG_BOX_BUTTON(N_("~No"), done_listbox_context, B_ESC));
} else {
unsigned char *msg = ops->get_info(item, term);
char *msg = ops->get_info(item, term);
ops->lock(item);
@ -888,7 +888,7 @@ static int
scan_for_matches(struct listbox_item *item, void *info_, int *offset)
{
struct listbox_context *context = info_;
unsigned char *text = (unsigned char *) context->widget_data;
char *text = (char *) context->widget_data;
if (!*text) {
item->visible = 1;
@ -922,7 +922,7 @@ mark_visible(struct listbox_item *item, void *xxx, int *offset)
static void
search_hierbox_browser(void *data, unsigned char *text)
search_hierbox_browser(void *data, char *text)
{
struct dialog_data *dlg_data = data;
struct listbox_data *box = get_dlg_listbox_data(dlg_data);

View File

@ -15,7 +15,7 @@ struct session;
struct hierbox_browser_button {
/** The button label text
* It is automatically localized. */
unsigned char *label;
char *label;
/** The button handler
* The handler gets called when the button is activated */
@ -39,7 +39,7 @@ struct hierbox_browser_button {
struct hierbox_browser {
/** The title of the browser
* Note, it is automatically localized. */
unsigned char *title;
char *title;
/** Callback for (un)expansion of the listboxes
* Can be used by subsystems to install a handler to be called

View File

@ -22,10 +22,10 @@
/* Return position (starting at 1) of the first tilde in text,
* or 0 if not found. */
static inline int
find_hotkey_pos(unsigned char *text)
find_hotkey_pos(char *text)
{
if (text && *text) {
unsigned char *p = strchr((const char *)text, '~');
char *p = strchr((const char *)text, '~');
if (p) return (int) (p - text) + 1;
}
@ -46,7 +46,7 @@ init_hotkeys(struct terminal *term, struct menu *menu)
memset(used_hotkeys, 0, sizeof(used_hotkeys));
foreach_menu_item(mi, menu->items) {
unsigned char *text = mi->text;
char *text = mi->text;
if (!mi_has_left_text(mi)) continue;
if (mi_text_translate(mi)) text = _(text, term);
@ -80,7 +80,7 @@ init_hotkeys(struct terminal *term, struct menu *menu)
mi->hotkey_state = HKS_IGNORE;
} else if (mi->hotkey_state != HKS_CACHED
&& !mi->hotkey_pos) {
unsigned char *text = mi->text;
char *text = mi->text;
if (!mi_has_left_text(mi)) continue;
if (mi_text_translate(mi)) text = _(text, term);
@ -142,7 +142,7 @@ check_hotkeys_common(struct menu *menu, term_event_char_T hotkey, struct termina
start = i;
do {
struct menu_item *item;
unsigned char *text;
char *text;
#ifdef CONFIG_UTF8
unicode_val_T items_hotkey;
#endif

View File

@ -12,7 +12,7 @@ extern "C" {
struct menu;
struct terminal;
/* int find_hotkey_pos(unsigned char *text); */
/* int find_hotkey_pos(char *text); */
void init_hotkeys(struct terminal *term, struct menu *menu);
#ifdef CONFIG_NLS
void clear_hotkeys_cache(struct menu *menu);

View File

@ -38,7 +38,7 @@
#define INPUTFIELD_FLOAT_SEPARATOR_LEN 1
void
add_dlg_field_do(struct dialog *dlg, enum widget_type type, unsigned char *label,
add_dlg_field_do(struct dialog *dlg, enum widget_type type, char *label,
int min, int max, widget_handler_T *handler,
int datalen, void *data,
struct input_history *history, enum inpfield_flags flags)
@ -89,7 +89,7 @@ check_number(struct dialog_data *dlg_data, struct widget_data *widget_data)
widget_handler_status_T
check_nonempty(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
unsigned char *p;
char *p;
for (p = widget_data->cdata; *p; p++)
if (*p > ' ')
@ -110,7 +110,7 @@ dlg_format_field(struct dialog_data *dlg_data,
struct terminal *term = dlg_data->win->term;
static int max_label_width;
static int *prev_y; /* Assert the uniqueness of y */ /* TODO: get rid of this !! --Zas */
unsigned char *label = widget_data->widget->text;
char *label = widget_data->widget->text;
struct color_pair *text_color = NULL;
int label_width = 0;
int float_label = widget_data->widget->info.field.flags & (INPFIELD_FLOAT|INPFIELD_FLOAT2);
@ -177,9 +177,9 @@ input_field_cancel(struct dialog_data *dlg_data, struct widget_data *widget_data
static widget_handler_status_T
input_field_ok(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
void (*fn)(void *, unsigned char *) = widget_data->widget->data;
void (*fn)(void *, char *) = widget_data->widget->data;
void *data = dlg_data->dlg->udata2;
unsigned char *text = dlg_data->widgets_data->cdata;
char *text = dlg_data->widgets_data->cdata;
if (check_dialog(dlg_data)) return EVENT_NOT_PROCESSED;
@ -194,18 +194,18 @@ input_field_ok(struct dialog_data *dlg_data, struct widget_data *widget_data)
void
input_field(struct terminal *term, struct memory_list *ml, int intl,
unsigned char *title,
unsigned char *text,
unsigned char *okbutton,
unsigned char *cancelbutton,
char *title,
char *text,
char *okbutton,
char *cancelbutton,
void *data, struct input_history *history, int l,
unsigned char *def, int min, int max,
char *def, int min, int max,
widget_handler_T *check,
void (*fn)(void *, unsigned char *),
void (*fn)(void *, char *),
void (*cancelfn)(void *))
{
struct dialog *dlg;
unsigned char *field;
char *field;
if (intl) {
title = _(title, term);
@ -245,12 +245,12 @@ input_field(struct terminal *term, struct memory_list *ml, int intl,
void
input_dialog(struct terminal *term, struct memory_list *ml,
unsigned char *title,
unsigned char *text,
char *title,
char *text,
void *data, struct input_history *history, int l,
unsigned char *def, int min, int max,
char *def, int min, int max,
widget_handler_T *check,
void (*fn)(void *, unsigned char *),
void (*fn)(void *, char *),
void (*cancelfn)(void *))
{
/* [gettext_accelerator_context(input_dialog)] */
@ -273,7 +273,7 @@ display_field_do(struct dialog_data *dlg_data, struct widget_data *widget_data,
#ifdef CONFIG_UTF8
if (term->utf8_cp) {
unsigned char *t = widget_data->cdata;
char *t = widget_data->cdata;
int p = widget_data->info.field.cpos;
len = utf8_ptr2cells(t, &t[p]);
@ -295,7 +295,7 @@ display_field_do(struct dialog_data *dlg_data, struct widget_data *widget_data,
color = get_bfu_color(term, "dialog.field-text");
if (color) {
unsigned char *text = widget_data->cdata + widget_data->info.field.vpos;
char *text = widget_data->cdata + widget_data->info.field.vpos;
int len, w;
#ifdef CONFIG_UTF8
@ -476,8 +476,8 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
if (widget_data->info.field.cpos < strlen(widget_data->cdata)) {
#ifdef CONFIG_UTF8
if (term->utf8_cp) {
unsigned char *next = widget_data->cdata + widget_data->info.field.cpos;
unsigned char *end = strchr((const char *)next, '\0');
char *next = widget_data->cdata + widget_data->info.field.cpos;
char *end = strchr((const char *)next, '\0');
utf8_to_unicode(&next, end);
widget_data->info.field.cpos = (int)(next - widget_data->cdata);
@ -494,8 +494,8 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
widget_data->info.field.cpos--;
#ifdef CONFIG_UTF8
if (widget_data->info.field.cpos && term->utf8_cp) {
unsigned char *t = widget_data->cdata;
unsigned char *t2 = t;
char *t = widget_data->cdata;
char *t2 = t;
int p = widget_data->info.field.cpos;
unsigned char tmp = t[p];
@ -523,8 +523,8 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
/* FIXME: This isn't nice. We remove last byte
* from UTF-8 character to detect
* character before it. */
unsigned char *text = widget_data->cdata;
unsigned char *end = widget_data->cdata + widget_data->info.field.cpos - 1;
char *text = widget_data->cdata;
char *end = widget_data->cdata + widget_data->info.field.cpos - 1;
unicode_val_T data;
int old = widget_data->info.field.cpos;
@ -561,9 +561,9 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
#ifdef CONFIG_UTF8
if (term->utf8_cp) {
unsigned char *end = widget_data->cdata + cdata_len;
unsigned char *text = widget_data->cdata + widget_data->info.field.cpos;
unsigned char *old = text;
char *end = widget_data->cdata + cdata_len;
char *text = widget_data->cdata + widget_data->info.field.cpos;
char *old = text;
utf8_to_unicode(&text, end);
if (old != text) {
@ -642,7 +642,7 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
case ACT_EDIT_PASTE_CLIPBOARD:
{
/* Paste from clipboard */
unsigned char *clipboard = get_clipboard_text();
char *clipboard = get_clipboard_text();
if (!clipboard) goto display_field;
@ -679,14 +679,14 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
default:
if (check_kbd_textinput_key(ev)) {
unsigned char *text = widget_data->cdata;
char *text = widget_data->cdata;
int textlen = strlen(text);
#ifndef CONFIG_UTF8
/* Both get_kbd_key(ev) and @text
* are in the terminal's charset. */
const int inslen = 1;
#else /* CONFIG_UTF8 */
const unsigned char *ins;
const char *ins;
int inslen;
/* get_kbd_key(ev) is UCS-4, and @text
@ -874,11 +874,11 @@ cancel_input_line:
}
void
input_field_line(struct session *ses, unsigned char *prompt, void *data,
input_field_line(struct session *ses, char *prompt, void *data,
struct input_history *history, input_line_handler_T handler)
{
struct dialog *dlg;
unsigned char *buffer;
char *buffer;
struct input_line *input_line;
assert(ses);

View File

@ -38,7 +38,7 @@ struct widget_data_info_field {
};
void
add_dlg_field_do(struct dialog *dlg, enum widget_type type, unsigned char *label,
add_dlg_field_do(struct dialog *dlg, enum widget_type type, char *label,
int min, int max, widget_handler_T *handler,
int data_len, void *data,
struct input_history *history, enum inpfield_flags flags);
@ -67,21 +67,21 @@ widget_handler_status_T check_nonempty(struct dialog_data *, struct widget_data
void dlg_format_field(struct dialog_data *, struct widget_data *, int, int *, int, int *, enum format_align, int format_only);
void input_field(struct terminal *, struct memory_list *, int, unsigned char *,
unsigned char *, unsigned char *, unsigned char *, void *,
struct input_history *, int, unsigned char *, int, int,
void input_field(struct terminal *, struct memory_list *, int, char *,
char *, char *, char *, void *,
struct input_history *, int, char *, int, int,
widget_handler_T *check,
void (*)(void *, unsigned char *),
void (*)(void *, char *),
void (*)(void *));
void
input_dialog(struct terminal *term, struct memory_list *ml,
unsigned char *title,
unsigned char *text,
char *title,
char *text,
void *data, struct input_history *history, int l,
unsigned char *def, int min, int max,
char *def, int min, int max,
widget_handler_T *check,
void (*fn)(void *, unsigned char *),
void (*fn)(void *, char *),
void (*cancelfn)(void *));
@ -105,11 +105,11 @@ struct input_line {
struct session *ses;
input_line_handler_T handler;
void *data;
unsigned char buffer[INPUT_LINE_BUFFER_SIZE];
char buffer[INPUT_LINE_BUFFER_SIZE];
};
void
input_field_line(struct session *ses, unsigned char *prompt, void *data,
input_field_line(struct session *ses, char *prompt, void *data,
struct input_history *history, input_line_handler_T handler);
#define widget_has_history(widget_data) ((widget_data)->widget->type == WIDGET_FIELD \

View File

@ -24,7 +24,7 @@
static void
tab_compl_n(struct dialog_data *dlg_data, unsigned char *item, int len)
tab_compl_n(struct dialog_data *dlg_data, char *item, int len)
{
struct widget_data *widget_data = selected_widget(dlg_data);
@ -40,7 +40,7 @@ tab_compl_n(struct dialog_data *dlg_data, unsigned char *item, int len)
}
static void
tab_compl(struct dialog_data *dlg_data, unsigned char *item)
tab_compl(struct dialog_data *dlg_data, char *item)
{
tab_compl_n(dlg_data, item, strlen(item));
}
@ -49,7 +49,7 @@ tab_compl(struct dialog_data *dlg_data, unsigned char *item)
static void
menu_tab_compl(struct terminal *term, void *item_, void *dlg_data_)
{
unsigned char *item = item_;
char *item = item_;
struct dialog_data *dlg_data = dlg_data_;
tab_compl_n(dlg_data, item, strlen(item));
@ -90,9 +90,9 @@ do_tab_compl(struct dialog_data *dlg_data,
/* Return the length of the common substring from the starts
* of the two strings a and b. */
static inline int
strcommonlen(unsigned char *a, unsigned char *b)
strcommonlen(char *a, char *b)
{
unsigned char *start = a;
char *start = a;
while (*a && *a == *b)
++a, ++b;
@ -114,11 +114,11 @@ do_tab_compl_unambiguous(struct dialog_data *dlg_data,
/* Maximum number of characters in a match. Characters after this
* position are varying in other matches. */
int longest_common_match = 0;
unsigned char *match = NULL;
char *match = NULL;
struct input_history_entry *entry;
foreach (entry, *history) {
unsigned char *cur = entry->data;
char *cur = entry->data;
int cur_len = strcommonlen(cur, match ? match
: widget_data->cdata);
@ -160,7 +160,7 @@ set_complete_file_menu(struct terminal *term, void *filename_, void *dlg_data_)
{
struct dialog_data *dlg_data = dlg_data_;
struct widget_data *widget_data = selected_widget(dlg_data);
unsigned char *filename = filename_;
char *filename = filename_;
int filenamelen;
assert(widget_is_textfield(widget_data));
@ -182,7 +182,7 @@ static void
tab_complete_file_menu(struct terminal *term, void *path_, void *dlg_data_)
{
struct dialog_data *dlg_data = dlg_data_;
unsigned char *path = path_;
char *path = path_;
auto_complete_file(term, 0 /* no_elevator */, path,
set_complete_file_menu, tab_complete_file_menu,
@ -205,7 +205,7 @@ do_tab_compl_file(struct dialog_data *dlg_data,
/* Search for duplicate entries in history list, save first one and remove
* older ones. */
static struct input_history_entry *
check_duplicate_entries(struct input_history *history, unsigned char *data)
check_duplicate_entries(struct input_history *history, char *data)
{
struct input_history_entry *entry, *first_duplicate = NULL;
@ -237,7 +237,7 @@ check_duplicate_entries(struct input_history *history, unsigned char *data)
/* Add a new entry in inputbox history list, take care of duplicate if
* check_duplicate and respect history size limit. */
void
add_to_input_history(struct input_history *history, unsigned char *data,
add_to_input_history(struct input_history *history, char *data,
int check_duplicate)
{
struct input_history_entry *entry;
@ -284,16 +284,16 @@ add_to_input_history(struct input_history *history, unsigned char *data,
/* Load history file */
int
load_input_history(struct input_history *history, unsigned char *filename)
load_input_history(struct input_history *history, char *filename)
{
unsigned char *history_file = filename;
unsigned char line[MAX_STR_LEN];
char *history_file = filename;
char line[MAX_STR_LEN];
FILE *file;
if (get_cmd_opt_bool("anonymous")) return 0;
if (elinks_home) {
history_file = straconcat(elinks_home, filename,
(unsigned char *) NULL);
(char *) NULL);
if (!history_file) return 0;
}
@ -319,11 +319,11 @@ load_input_history(struct input_history *history, unsigned char *filename)
/* Write history list to file. It returns a value different from 0 in case of
* failure, 0 on success. */
int
save_input_history(struct input_history *history, unsigned char *filename)
save_input_history(struct input_history *history, char *filename)
{
struct input_history_entry *entry;
struct secure_save_info *ssi;
unsigned char *history_file;
char *history_file;
int i = 0;
if (!history->dirty
@ -332,7 +332,7 @@ save_input_history(struct input_history *history, unsigned char *filename)
return 0;
history_file = straconcat(elinks_home, filename,
(unsigned char *) NULL);
(char *) NULL);
if (!history_file) return -1;
ssi = secure_open(history_file);
@ -358,7 +358,7 @@ dlg_set_history(struct widget_data *widget_data)
assert(widget_data->widget->datalen > 0);
if ((void *) widget_data->info.field.cur_hist != &widget_data->info.field.history) {
unsigned char *s = widget_data->info.field.cur_hist->data;
char *s = widget_data->info.field.cur_hist->data;
widget_data->info.field.cpos = int_min(strlen(s), widget_data->widget->datalen - 1);
if (widget_data->info.field.cpos)

View File

@ -12,7 +12,7 @@ struct dialog_data;
struct input_history_entry {
LIST_HEAD(struct input_history_entry);
unsigned char data[1]; /* Must be last. */
char data[1]; /* Must be last. */
};
struct input_history {
@ -44,7 +44,7 @@ struct input_history {
if (!(history)->nosave) (history)->dirty = 1; \
} while (0)
void add_to_input_history(struct input_history *, unsigned char *, int);
void add_to_input_history(struct input_history *, char *, int);
void do_tab_compl(struct dialog_data *,
LIST_OF(struct input_history_entry) *);
@ -54,11 +54,11 @@ void do_tab_compl_unambiguous(struct dialog_data *,
LIST_OF(struct input_history_entry) *);
/* Load history file from elinks home. */
int load_input_history(struct input_history *history, unsigned char *filename);
int load_input_history(struct input_history *history, char *filename);
/* Write history list to @filebane in elinks home. It returns a value different
* from 0 in case of failure, 0 on success. */
int save_input_history(struct input_history *history, unsigned char *filename);
int save_input_history(struct input_history *history, char *filename);
void dlg_set_history(struct widget_data *);

View File

@ -165,7 +165,7 @@ init_led_panel(struct led_panel *leds)
static int
draw_timer(struct terminal *term, int xpos, int ypos, struct color_pair *color)
{
unsigned char s[64];
char s[64];
int i, length;
snprintf(s, sizeof(s), "[%d]", get_timer_duration());
@ -183,7 +183,7 @@ draw_show_ip(struct session *ses, int xpos, int ypos, struct color_pair *color)
if (ses->doc_view && ses->doc_view->document && ses->doc_view->document->ip) {
struct terminal *term = ses->tab->term;
unsigned char *s = ses->doc_view->document->ip;
char *s = ses->doc_view->document->ip;
int length = strlen(s);
int i;
@ -200,7 +200,7 @@ draw_show_ip(struct session *ses, int xpos, int ypos, struct color_pair *color)
static int
draw_clock(struct terminal *term, int xpos, int ypos, struct color_pair *color)
{
unsigned char s[64];
char s[64];
time_t curtime = time(NULL);
struct tm *loctime = localtime(&curtime);
int i, length;

View File

@ -460,7 +460,7 @@ display_listbox_item(struct listbox_item *item, void *data_, int *offset)
data->box->ops->draw(item, data, x, y, width);
} else {
unsigned char *text;
char *text;
const struct listbox_ops *ops = data->box->ops;
int len_bytes;

View File

@ -49,18 +49,18 @@ struct listbox_context {
};
struct listbox_ops_messages {
unsigned char *cant_delete_item; /* %s = text of item */
unsigned char *cant_delete_used_item; /* %s = text of item */
unsigned char *cant_delete_folder; /* %s = text of item */
unsigned char *cant_delete_used_folder; /* %s = text of item */
unsigned char *delete_marked_items_title; /* not a format string */
unsigned char *delete_marked_items; /* not a format string */
unsigned char *delete_folder_title; /* not a format string */
unsigned char *delete_folder; /* %s = text of item */
unsigned char *delete_item_title; /* not a format string */
unsigned char *delete_item; /* %s = text of item */
unsigned char *clear_all_items_title; /* not a format string */
unsigned char *clear_all_items; /* not a format string */
char *cant_delete_item; /* %s = text of item */
char *cant_delete_used_item; /* %s = text of item */
char *cant_delete_folder; /* %s = text of item */
char *cant_delete_used_folder; /* %s = text of item */
char *delete_marked_items_title; /* not a format string */
char *delete_marked_items; /* not a format string */
char *delete_folder_title; /* not a format string */
char *delete_folder; /* %s = text of item */
char *delete_item_title; /* not a format string */
char *delete_item; /* %s = text of item */
char *clear_all_items_title; /* not a format string */
char *clear_all_items; /* not a format string */
};
/* TODO: We can maybe find a better way of figuring out whether a user of a
@ -72,8 +72,8 @@ struct listbox_ops {
void (*unlock)(struct listbox_item *);
int (*is_used)(struct listbox_item *);
unsigned char *(*get_text)(struct listbox_item *, struct terminal *);
unsigned char *(*get_info)(struct listbox_item *, struct terminal *);
char *(*get_text)(struct listbox_item *, struct terminal *);
char *(*get_info)(struct listbox_item *, struct terminal *);
struct uri *(*get_uri)(struct listbox_item *);
@ -81,7 +81,7 @@ struct listbox_ops {
/* Do a search on the item. */
enum listbox_match (*match)(struct listbox_item *, struct terminal *,
unsigned char *text);
char *text);
/* Before calling delete() thou shall call can_delete(). */
int (*can_delete)(struct listbox_item *);

View File

@ -57,7 +57,7 @@ do_select_submenu(struct terminal *term, void *menu_, void *ses_)
}
void
new_menu_item(struct list_menu *menu, unsigned char *name, int data, int fullname)
new_menu_item(struct list_menu *menu, char *name, int data, int fullname)
/* name == NULL - up; data == -1 - down */
{
struct menu_item *new_menu_item = NULL; /* no uninitialized warnings */
@ -169,15 +169,15 @@ destroy_menu(struct list_menu *menu)
}
void
menu_labels(struct menu_item *items, unsigned char *base, unsigned char **lbls)
menu_labels(struct menu_item *items, char *base, char **lbls)
{
struct menu_item *item;
unsigned char *bs;
char *bs;
foreach_menu_item (item, items) {
bs = (item->flags & MENU_FULLNAME) ? (unsigned char *) ""
bs = (item->flags & MENU_FULLNAME) ? (char *) ""
: base;
bs = straconcat(bs, item->text, (unsigned char *) NULL);
bs = straconcat(bs, item->text, (char *) NULL);
if (!bs) continue;
if (item->func == do_select_submenu) {
@ -193,7 +193,7 @@ menu_labels(struct menu_item *items, unsigned char *base, unsigned char **lbls)
void
add_select_item(struct list_menu *menu, struct string *string,
struct string *orig_string, unsigned char **value,
struct string *orig_string, char **value,
int order, int dont_add)
{
int pos = order - 1;

View File

@ -17,10 +17,10 @@ struct list_menu {
void init_menu(struct list_menu *menu);
void destroy_menu(struct list_menu *menu);
void add_select_item(struct list_menu *menu, struct string *string, struct string *orig_string, unsigned char **value, int order, int dont_add);
void new_menu_item(struct list_menu *menu, unsigned char *name, int data, int fullname);
void add_select_item(struct list_menu *menu, struct string *string, struct string *orig_string, char **value, int order, int dont_add);
void new_menu_item(struct list_menu *menu, char *name, int data, int fullname);
struct menu_item *detach_menu(struct list_menu *menu);
void menu_labels(struct menu_item *m, unsigned char *base, unsigned char **lbls);
void menu_labels(struct menu_item *m, char *base, char **lbls);
void do_select_submenu(struct terminal *term, void *menu_, void *ses_);
void free_menu(struct menu_item *m);

View File

@ -54,7 +54,7 @@
/* Types and structures */
/* Submenu indicator, displayed at right. */
static unsigned char m_submenu[] = ">>";
static char m_submenu[] = ">>";
static int m_submenu_len = sizeof(m_submenu) - 1;
/* Prototypes */
@ -190,7 +190,7 @@ select_menu(struct terminal *term, struct menu *menu)
static int
get_menuitem_text_width(struct terminal *term, struct menu_item *mi)
{
unsigned char *text;
char *text;
if (!mi_has_left_text(mi)) return 0;
@ -229,7 +229,7 @@ get_menuitem_rtext_width(struct terminal *term, struct menu_item *mi)
}
} else if (mi_has_right_text(mi)) {
unsigned char *rtext = mi->rtext;
char *rtext = mi->rtext;
if (mi_rtext_translate(mi))
rtext = _(rtext, term);
@ -371,7 +371,7 @@ set_menu_selection(struct menu *menu, int pos)
* separators). For double-width glyph width == 2.
* len - length of text in bytes */
static inline void
draw_menu_left_text(struct terminal *term, unsigned char *text, int len,
draw_menu_left_text(struct terminal *term, char *text, int len,
int x, int y, int width, struct color_pair *color)
{
int w = width - (L_TEXT_SPACE + R_TEXT_SPACE);
@ -398,7 +398,7 @@ draw_menu_left_text(struct terminal *term, unsigned char *text, int len,
static inline void
draw_menu_left_text_hk(struct terminal *term, unsigned char *text,
draw_menu_left_text_hk(struct terminal *term, char *text,
int hotkey_pos, int x, int y, int width,
struct color_pair *color, int selected)
{
@ -411,7 +411,7 @@ draw_menu_left_text_hk(struct terminal *term, unsigned char *text,
int w = width - (L_TEXT_SPACE + R_TEXT_SPACE);
int hk_state = 0;
#ifdef CONFIG_UTF8
unsigned char *text2, *end;
char *text2, *end;
#endif
#ifdef CONFIG_DEBUG
@ -521,7 +521,7 @@ utf8:
}
static inline void
draw_menu_right_text(struct terminal *term, unsigned char *text, int len,
draw_menu_right_text(struct terminal *term, char *text, int len,
int x, int y, int width, struct color_pair *color)
{
int w = width - (L_RTEXT_SPACE + R_RTEXT_SPACE);
@ -611,7 +611,7 @@ display_menu(struct terminal *term, struct menu *menu)
if (mi_has_left_text(mi)) {
int l = mi->hotkey_pos;
unsigned char *text = mi->text;
char *text = mi->text;
if (mi_text_translate(mi))
text = _(text, term);
@ -658,7 +658,7 @@ display_menu(struct terminal *term, struct menu *menu)
}
} else if (mi_has_right_text(mi)) {
unsigned char *rtext = mi->rtext;
char *rtext = mi->rtext;
if (mi_rtext_translate(mi))
rtext = _(rtext, term);
@ -781,10 +781,10 @@ menu_page_down(struct menu *menu)
#undef DIST
static inline int
search_menu_item(struct menu_item *item, unsigned char *buffer,
search_menu_item(struct menu_item *item, char *buffer,
struct terminal *term)
{
unsigned char *text, *match;
char *text, *match;
/* set_menu_selection asserts selectability. */
if (!mi_has_left_text(item) || !mi_is_selectable(item)) return 0;
@ -810,7 +810,7 @@ menu_search_handler(struct input_line *line, int action_id)
{
struct menu *menu = line->data;
struct terminal *term = menu->win->term;
unsigned char *buffer = line->buffer;
char *buffer = line->buffer;
struct window *win;
int pos = menu->selected;
int start;
@ -871,7 +871,7 @@ search_menu(struct menu *menu)
struct terminal *term = menu->win->term;
struct window *current_tab = get_current_tab(term);
struct session *ses = current_tab ? current_tab->data : NULL;
unsigned char *prompt = _("Search menu/", term);
char *prompt = _("Search menu/", term);
if (menu->size < 1 || !ses) return;
@ -1127,7 +1127,7 @@ display_mainmenu(struct terminal *term, struct menu *menu)
for (i = menu->first; i < menu->size; i++) {
struct menu_item *mi = &menu->items[i];
struct color_pair *color = normal_color;
unsigned char *text = mi->text;
char *text = mi->text;
int l = mi->hotkey_pos;
int textlen;
int selected = (i == menu->selected);
@ -1248,7 +1248,7 @@ mainmenu_mouse_handler(struct menu *menu, struct term_event *ev)
/* We don't initialize to menu->first here, since it breaks
* horizontal scrolling using mouse in some cases. --Zas */
foreach_menu_item (item, menu->items) {
unsigned char *text = item->text;
char *text = item->text;
if (!mi_has_left_text(item)) continue;
@ -1386,7 +1386,7 @@ new_menu(enum menu_item_flags flags)
}
void
add_to_menu(struct menu_item **mi, unsigned char *text, unsigned char *rtext,
add_to_menu(struct menu_item **mi, char *text, char *rtext,
enum main_action action_id, menu_func_T func, void *data,
enum menu_item_flags flags)
{

View File

@ -80,7 +80,7 @@ enum hotkey_state {
/* XXX: keep order of fields, there's some hard initializations for it. --Zas
*/
struct menu_item {
unsigned char *text; /* The item label */
char *text; /* The item label */
/* The following three members are tightly coupled:
*
@ -91,7 +91,7 @@ struct menu_item {
* - A few places however there is no associated keybinding and no
* ``default'' handler defined in which case @rtext (if non NULL)
* will be drawn and @func will be called when selecting the item. */
unsigned char *rtext; /* Right aligned guiding text */
char *rtext; /* Right aligned guiding text */
enum main_action action_id; /* Default item handlers */
menu_func_T func; /* Called when selecting the item */
@ -106,8 +106,8 @@ struct menu_item {
#define INIT_MENU_ITEM(text, rtext, action_id, func, data, flags) \
{ \
(unsigned char *) (text), \
(unsigned char *) (rtext), \
(char *) (text), \
(char *) (rtext), \
(action_id), \
(func), \
(void *) (data), \
@ -128,8 +128,8 @@ struct menu_item {
#define SET_MENU_ITEM(e_, text_, rtext_, action_id_, func_, data_, \
flags_, hotkey_state_, hotkey_pos_) \
do { \
(e_)->text = (unsigned char *) (text_); \
(e_)->rtext = (unsigned char *) (rtext_); \
(e_)->text = (char *) (text_); \
(e_)->rtext = (char *) (rtext_); \
(e_)->action_id = (action_id_); \
(e_)->func = (func_); \
(e_)->data = (void *) (data_); \
@ -165,7 +165,7 @@ struct menu {
struct menu_item *new_menu(enum menu_item_flags);
void
add_to_menu(struct menu_item **mi, unsigned char *text, unsigned char *rtext,
add_to_menu(struct menu_item **mi, char *text, char *rtext,
enum main_action action_id, menu_func_T func, void *data,
enum menu_item_flags flags);

View File

@ -23,8 +23,8 @@
struct dialog_data *
msg_box(struct terminal *term, struct memory_list *ml, enum msgbox_flags flags,
unsigned char *title, enum format_align align,
unsigned char *text, void *udata, int buttons, ...)
char *title, enum format_align align,
char *text, void *udata, int buttons, ...)
{
struct dialog *dlg;
va_list ap;
@ -66,11 +66,11 @@ msg_box(struct terminal *term, struct memory_list *ml, enum msgbox_flags flags,
va_start(ap, buttons);
while (dlg->number_of_widgets < buttons + 1) {
unsigned char *label;
char *label;
done_handler_T *done;
int bflags;
label = va_arg(ap, unsigned char *);
label = va_arg(ap, char *);
done = va_arg(ap, done_handler_T *);
bflags = va_arg(ap, int);
@ -93,10 +93,10 @@ msg_box(struct terminal *term, struct memory_list *ml, enum msgbox_flags flags,
return do_dialog(term, dlg, ml);
}
static inline unsigned char *
msg_text_do(unsigned char *format, va_list ap)
static inline char *
msg_text_do(char *format, va_list ap)
{
unsigned char *info;
char *info;
int infolen, len;
va_list ap2;
@ -117,10 +117,10 @@ msg_text_do(unsigned char *format, va_list ap)
return info;
}
unsigned char *
msg_text(struct terminal *term, unsigned char *format, ...)
char *
msg_text(struct terminal *term, char *format, ...)
{
unsigned char *info;
char *info;
va_list ap;
va_start(ap, format);
@ -142,9 +142,9 @@ abort_refreshed_msg_box_handler(struct dialog_data *dlg_data)
static enum dlg_refresh_code
refresh_msg_box(struct dialog_data *dlg_data, void *data)
{
unsigned char *(*get_info)(struct terminal *, void *) = data;
char *(*get_info)(struct terminal *, void *) = data;
void *msg_data = dlg_data->dlg->udata2;
unsigned char *info = get_info(dlg_data->win->term, msg_data);
char *info = get_info(dlg_data->win->term, msg_data);
if (!info) return REFRESH_CANCEL;
@ -156,13 +156,13 @@ refresh_msg_box(struct dialog_data *dlg_data, void *data)
void
refreshed_msg_box(struct terminal *term, enum msgbox_flags flags,
unsigned char *title, enum format_align align,
unsigned char *(get_info)(struct terminal *, void *),
char *title, enum format_align align,
char *(get_info)(struct terminal *, void *),
void *data)
{
/* [gettext_accelerator_context(refreshed_msg_box)] */
struct dialog_data *dlg_data;
unsigned char *info = get_info(term, data);
char *info = get_info(term, data);
if (!info) return;
@ -183,8 +183,8 @@ refreshed_msg_box(struct terminal *term, enum msgbox_flags flags,
struct dialog_data *
info_box(struct terminal *term, enum msgbox_flags flags,
unsigned char *title, enum format_align align,
unsigned char *text)
char *title, enum format_align align,
char *text)
{
/* [gettext_accelerator_context(info_box)] */
return msg_box(term, NULL, flags,

View File

@ -94,8 +94,8 @@ enum msgbox_flags {
* ...no matter that it could fit on one line in case of a tiny message box. */
struct dialog_data *
msg_box(struct terminal *term, struct memory_list *mem_list,
enum msgbox_flags flags, unsigned char *title, enum format_align align,
unsigned char *text, void *udata, int buttons, ...);
enum msgbox_flags flags, char *title, enum format_align align,
char *text, void *udata, int buttons, ...);
/* Cast @value to @type and warn if the conversion is suspicious.
* If @value has side effects, this does them only once.
@ -108,7 +108,7 @@ msg_box(struct terminal *term, struct memory_list *mem_list,
/* A button in the variadic arguments of msg_box().
* This macro expands into three arguments. */
#define MSG_BOX_BUTTON(label, handler, flags) \
MSG_BOX_CAST(const unsigned char *, label), \
MSG_BOX_CAST(const char *, label), \
MSG_BOX_CAST(done_handler_T *, handler), \
MSG_BOX_CAST(int, flags)
@ -121,21 +121,21 @@ msg_box(struct terminal *term, struct memory_list *mem_list,
* This one automagically localizes the format string. The possible
* additional parameters still need to be localized manually at the user's
* side. */
unsigned char *msg_text(struct terminal *term, unsigned char *format, ...);
char *msg_text(struct terminal *term, char *format, ...);
/* A periodically refreshed message box with one OK button. The text in the
* message box is updated using the get_info() function. If get_info() returns
* NULL the message box is closed. */
void
refreshed_msg_box(struct terminal *term, enum msgbox_flags flags,
unsigned char *title, enum format_align align,
unsigned char *(get_info)(struct terminal *, void *),
char *title, enum format_align align,
char *(get_info)(struct terminal *, void *),
void *data);
struct dialog_data *
info_box(struct terminal *term, enum msgbox_flags flags,
unsigned char *title, enum format_align align,
unsigned char *text);
char *title, enum format_align align,
char *text);
#ifdef __cplusplus
}

View File

@ -28,7 +28,7 @@ struct bfu_color_entry {
static struct hash *bfu_colors = NULL;
struct color_pair *
get_bfu_color(struct terminal *term, unsigned char *stylename)
get_bfu_color(struct terminal *term, char *stylename)
{
static enum color_mode last_color_mode;
struct bfu_color_entry *entry;

View File

@ -23,7 +23,7 @@ struct terminal;
* @return A color pair matching the stylename or NULL.
*/
struct color_pair *
get_bfu_color(struct terminal *term, unsigned char *stylename);
get_bfu_color(struct terminal *term, char *stylename);
/** Cleanup after the BFU style cache
*

View File

@ -23,7 +23,7 @@
#define is_unsplitable(pos) (*(pos) && *(pos) != '\n' && !isspace(*(pos)))
void
add_dlg_text(struct dialog *dlg, unsigned char *text,
add_dlg_text(struct dialog *dlg, char *text,
enum format_align align, int bottom_pad)
{
struct widget *widget = &dlg->widgets[dlg->number_of_widgets++];
@ -38,26 +38,26 @@ add_dlg_text(struct dialog *dlg, unsigned char *text,
/* Returns length of substring (from start of @text) before a split. */
#ifdef CONFIG_UTF8
static inline int
split_line(unsigned char *text, int max_width, int *cells, int utf8)
split_line(char *text, int max_width, int *cells, int utf8)
#else
static inline int
split_line(unsigned char *text, int max_width, int *cells)
split_line(char *text, int max_width, int *cells)
#endif /* CONFIG_UTF8 */
{
unsigned char *split = text;
char *split = text;
#ifdef CONFIG_UTF8
unsigned char *text_end = split + strlen(split);
char *text_end = split + strlen(split);
#endif /* CONFIG_UTF8 */
int cells_save = *cells;
if (max_width <= 0) return 0;
while (*split && *split != '\n') {
unsigned char *next_split;
char *next_split;
#ifdef CONFIG_UTF8
if (utf8) {
unsigned char *next_char_begin = split
char *next_char_begin = split
+ utf8charlen(split);
next_split = split;
@ -153,15 +153,15 @@ split_line(unsigned char *text, int max_width, int *cells)
/* Find the start of each line with the current max width */
#ifdef CONFIG_UTF8
static unsigned char **
static char **
split_lines(struct widget_data *widget_data, int max_width, int utf8)
#else
static unsigned char **
static char **
split_lines(struct widget_data *widget_data, int max_width)
#endif /* CONFIG_UTF8 */
{
unsigned char *text = widget_data->widget->text;
unsigned char **lines = (unsigned char **) widget_data->cdata;
char *text = widget_data->widget->text;
char **lines = (char **) widget_data->cdata;
int line = 0;
if (widget_data->info.text.max_width == max_width) return lines;
@ -202,7 +202,7 @@ split_lines(struct widget_data *widget_data, int max_width)
/* Yes it might be a bit ugly on the other hand it will be autofreed
* for us. */
widget_data->cdata = (unsigned char *) lines;
widget_data->cdata = (char *) lines;
widget_data->info.text.lines = line;
widget_data->info.text.max_width = max_width;
@ -212,7 +212,7 @@ split_lines(struct widget_data *widget_data, int max_width)
/* Format text according to dialog box and alignment. */
void
dlg_format_text_do(struct dialog_data *dlg_data,
unsigned char *text,
char *text,
int x, int *y, int width, int *real_width,
struct color_pair *color, enum format_align align,
int format_only)
@ -270,9 +270,9 @@ dlg_format_text(struct dialog_data *dlg_data,
int format_only)
{
struct terminal *term = dlg_data->win->term;
unsigned char *text = widget_data->widget->text;
char *text = widget_data->widget->text;
unsigned char saved = 0;
unsigned char *saved_pos = NULL;
char *saved_pos = NULL;
int height;
height = int_max(0, max_height - 3);
@ -288,7 +288,7 @@ dlg_format_text(struct dialog_data *dlg_data,
&& (widget_data->info.text.max_width != width
|| height < widget_data->info.text.lines))
{
unsigned char **lines;
char **lines;
int current;
int visible;
@ -304,7 +304,7 @@ dlg_format_text(struct dialog_data *dlg_data,
return;
#endif
lines = (unsigned char **) widget_data->cdata;
lines = (char **) widget_data->cdata;
/* Make maximum number of lines available */
visible = int_max(widget_data->info.text.lines - height,

View File

@ -46,12 +46,12 @@ struct widget_data_info_text {
#endif
};
void add_dlg_text(struct dialog *dlg, unsigned char *text,
void add_dlg_text(struct dialog *dlg, char *text,
enum format_align align, int bottom_pad);
extern const struct widget_ops text_ops;
void dlg_format_text_do(struct dialog_data *dlg_data,
unsigned char *text, int x, int *y, int w, int *rw,
char *text, int x, int *y, int w, int *rw,
struct color_pair *scolor, enum format_align align, int format_only);
void

View File

@ -36,7 +36,7 @@ struct widget_ops {
struct widget {
const struct widget_ops *ops;
unsigned char *text;
char *text;
widget_handler_T *handler;
@ -61,14 +61,14 @@ struct widget_data {
* and is assumed to be unibyte otherwise.) The UTF-8 I/O
* option has no effect here.
*
* For WIDGET_TEXT: @cdata is cast from/to an unsigned char **
* For WIDGET_TEXT: @cdata is cast from/to an char **
* that points to the first element of an array. Each element
* in this array corresponds to one line of text, and is an
* unsigned char * that points to the first character of that
* char * that points to the first character of that
* line. The array has @widget_data.info.text.lines elements.
*
* For WIDGET_LISTBOX: @cdata points to struct listbox_data. */
unsigned char *cdata;
char *cdata;
struct el_box box;

View File

@ -47,7 +47,7 @@ bookmarks_read(void)
{
int backend_num = get_opt_int("bookmarks.file_format", NULL);
struct bookmarks_backend *backend = bookmarks_backends[backend_num];
unsigned char *file_name;
char *file_name;
FILE *f;
if (!backend
@ -58,7 +58,7 @@ bookmarks_read(void)
if (!file_name) return;
if (elinks_home) {
file_name = straconcat(elinks_home, file_name,
(unsigned char *) NULL);
(char *) NULL);
if (!file_name) return;
}
@ -79,7 +79,7 @@ bookmarks_write(LIST_OF(struct bookmark) *bookmarks_list)
int backend_num = get_opt_int("bookmarks.file_format", NULL);
struct bookmarks_backend *backend = bookmarks_backends[backend_num];
struct secure_save_info *ssi;
unsigned char *file_name;
char *file_name;
if (!bookmarks_are_dirty() && backend_num == loaded_backend_num) return;
if (!backend
@ -92,7 +92,7 @@ bookmarks_write(LIST_OF(struct bookmark) *bookmarks_list)
* they would be just truncated to zero by secure_open()). */
file_name = backend->filename(1);
if (!file_name) return;
file_name = straconcat(elinks_home, file_name, (unsigned char *) NULL);
file_name = straconcat(elinks_home, file_name, (char *) NULL);
if (!file_name) return;
ssi = secure_open(file_name);

View File

@ -12,7 +12,7 @@ extern "C" {
struct bookmarks_backend {
/* Order matters here. --Zas. */
unsigned char *(*filename)(int);
char *(*filename)(int);
void (*read)(FILE *);
void (*write)(struct secure_save_info *, LIST_OF(struct bookmark) *);
};

View File

@ -31,19 +31,19 @@ read_bookmarks_default(FILE *f)
* + 1 byte for end of line + 1 byte for null char + reserve */
#define INBUF_SIZE ((MAX_STR_LEN - 1) + 1 + (MAX_STR_LEN - 1) + 1 + 5 + 1 + 1 \
+ MAX_STR_LEN)
unsigned char in_buffer[INBUF_SIZE]; /* read buffer */
char in_buffer[INBUF_SIZE]; /* read buffer */
struct bookmark *last_bm = NULL;
int last_depth = 0;
const int file_cp = get_cp_index("System");
/* TODO: Ignore lines with bad chars in title or url (?). -- Zas */
while (fgets(in_buffer, INBUF_SIZE, f)) {
unsigned char *title = in_buffer;
unsigned char *url;
unsigned char *depth_str;
char *title = in_buffer;
char *url;
char *depth_str;
int depth = 0;
unsigned char *flags = NULL;
unsigned char *line_end;
char *flags = NULL;
char *line_end;
/* Load URL. */
@ -143,7 +143,7 @@ write_bookmarks_default_inner(const struct write_bookmarks_default *out,
struct bookmark *bm;
foreach (bm, *bookmarks_list) {
unsigned char *title, *url;
char *title, *url;
title = convert_string(out->conv_table, bm->title,
strlen(bm->title), out->codepage,
@ -189,7 +189,7 @@ write_bookmarks_default(struct secure_save_info *ssi,
write_bookmarks_default_inner(&out, bookmarks_list);
}
static unsigned char *
static char *
filename_bookmarks_default(int writing)
{
return BOOKMARKS_FILENAME;

View File

@ -38,8 +38,8 @@
struct attributes {
LIST_HEAD(struct attributes);
unsigned char *name;
unsigned char *value;
char *name;
char *value;
};
/* Prototypes */
@ -50,9 +50,9 @@ static void on_text(void *data, const XML_Char *text, int len);
static struct tree_node *new_node(struct tree_node *parent);
static void free_node(struct tree_node *node);
static void free_xbeltree(struct tree_node *node);
static struct tree_node *get_child(struct tree_node *node, unsigned char *name);
static unsigned char *get_attribute_value(struct tree_node *node,
unsigned char *name);
static struct tree_node *get_child(struct tree_node *node, char *name);
static char *get_attribute_value(struct tree_node *node,
char *name);
struct read_bookmarks_xbel {
@ -60,7 +60,7 @@ struct read_bookmarks_xbel {
};
static void read_bookmarks_xbel(FILE *f);
static unsigned char * filename_bookmarks_xbel(int writing);
static char * filename_bookmarks_xbel(int writing);
static int xbeltree_to_bookmarks_list(const struct read_bookmarks_xbel *preload,
struct tree_node *root,
struct bookmark *current_parent);
@ -72,8 +72,8 @@ static void write_bookmarks_xbel(struct secure_save_info *ssi,
/* Element */
struct tree_node {
unsigned char *name; /* Name of the element */
unsigned char *text; /* Text inside the element */
char *name; /* Name of the element */
char *text; /* Text inside the element */
LIST_OF(struct attributes) attrs;
struct tree_node *parent;
struct tree_node *children;
@ -92,7 +92,7 @@ static int readok = 1;
static void
read_bookmarks_xbel(FILE *f)
{
unsigned char in_buffer[BUFSIZ];
char in_buffer[BUFSIZ];
XML_Parser p;
int done = 0;
int err = 0;
@ -165,7 +165,7 @@ write_bookmarks_xbel(struct secure_save_info *ssi,
secure_fputs(ssi, "\n</xbel>\n");
}
static unsigned char *
static char *
filename_bookmarks_xbel(int writing)
{
if (writing && !readok) return NULL;
@ -182,7 +182,7 @@ indentation(struct secure_save_info *ssi, int num)
}
static void
print_xml_entities(struct secure_save_info *ssi, const unsigned char *str)
print_xml_entities(struct secure_save_info *ssi, const char *str)
{
struct string entitized = NULL_STRING;
@ -268,7 +268,7 @@ on_element_open(void *data, const char *name, const char **attr)
current_node = node;
current_node->name = stracpy((unsigned char *) name);
current_node->name = stracpy((char *) name);
if (!current_node->name) {
mem_free(current_node);
return;
@ -276,8 +276,8 @@ on_element_open(void *data, const char *name, const char **attr)
for (; *attr; attr += 2) {
struct attributes *attribute = mem_calloc(1, sizeof(*attribute));
unsigned char *name = stracpy((unsigned char *) attr[0]);
unsigned char *value = stracpy((unsigned char *) attr[1]);
char *name = stracpy((char *) attr[0]);
char *value = stracpy((char *) attr[1]);
if (!attribute || !name || !value) {
mem_free_if(attribute);
@ -301,10 +301,10 @@ on_element_close(void *data, const char *name)
current_node = current_node->parent;
}
static unsigned char *
delete_whites(const unsigned char *s)
static char *
delete_whites(const char *s)
{
unsigned char *r;
char *r;
int last_was_space = 0, c = 0, i;
int len = strlen(s);
@ -376,7 +376,7 @@ xbeltree_to_bookmarks_list(const struct read_bookmarks_xbel *preload,
while (node) {
if (!strcmp(node->name, "bookmark")) {
unsigned char *href;
char *href;
title = get_child(node, "title");
href = get_attribute_value(node, "href");
@ -385,13 +385,13 @@ xbeltree_to_bookmarks_list(const struct read_bookmarks_xbel *preload,
tmp = add_bookmark(current_parent, 0,
/* The <title> element is optional */
title && title->text ? title->text
: (unsigned char *) gettext("No title"),
: (char *) gettext("No title"),
/* XXX: The href attribute isn't optional but
* we don't validate the source XML yet, so
* we can't always assume a non NULL value for
* get_attribute_value() */
href ? href
: (unsigned char *) gettext("No URL"));
: (char *) gettext("No URL"));
/* Out of memory */
if (!tmp) return 0;
@ -400,14 +400,14 @@ xbeltree_to_bookmarks_list(const struct read_bookmarks_xbel *preload,
lastbm = tmp;
} else if (!strcmp(node->name, "folder")) {
unsigned char *folded;
char *folded;
title = get_child(node, "title");
intl_set_charset_by_index(preload->utf8_cp);
tmp = add_bookmark(current_parent, 0,
title && title->text ? title->text
: (unsigned char *) gettext("No title"),
: (char *) gettext("No title"),
NULL);
/* Out of memory */
@ -471,7 +471,7 @@ free_xbeltree(struct tree_node *node)
}
static struct tree_node *
get_child(struct tree_node *node, unsigned char *name)
get_child(struct tree_node *node, char *name)
{
struct tree_node *ret;
@ -489,8 +489,8 @@ get_child(struct tree_node *node, unsigned char *name)
return NULL;
}
static unsigned char *
get_attribute_value(struct tree_node *node, unsigned char *name)
static char *
get_attribute_value(struct tree_node *node, char *name)
{
struct attributes *attribute;

View File

@ -276,7 +276,7 @@ delete_bookmark(struct bookmark *bm)
* @param foldername
* The title of the folder, in UTF-8. */
static void
delete_folder_by_name(const unsigned char *foldername)
delete_folder_by_name(const char *foldername)
{
struct bookmark *bookmark, *next;
@ -305,7 +305,7 @@ delete_folder_by_name(const unsigned char *foldername)
*
* @return the new bookmark, or NULL on error. */
static struct bookmark *
init_bookmark(struct bookmark *root, unsigned char *title, unsigned char *url)
init_bookmark(struct bookmark *root, char *title, char *url)
{
struct bookmark *bm;
@ -379,8 +379,8 @@ add_bookmark_item_to_bookmarks(struct bookmark *bm, struct bookmark *root, int p
*
* @see add_bookmark_cp() */
struct bookmark *
add_bookmark(struct bookmark *root, int place, unsigned char *title,
unsigned char *url)
add_bookmark(struct bookmark *root, int place, char *title,
char *url)
{
enum listbox_item_type type;
struct bookmark *bm;
@ -435,12 +435,12 @@ add_bookmark(struct bookmark *root, int place, unsigned char *title,
* @see add_bookmark() */
struct bookmark *
add_bookmark_cp(struct bookmark *root, int place, int codepage,
unsigned char *title, unsigned char *url)
char *title, char *url)
{
const int utf8_cp = get_cp_index("UTF-8");
struct conv_table *table;
unsigned char *utf8_title = NULL;
unsigned char *utf8_url = NULL;
char *utf8_title = NULL;
char *utf8_url = NULL;
struct bookmark *bookmark = NULL;
if (!url)
@ -471,13 +471,13 @@ add_bookmark_cp(struct bookmark *root, int place, int codepage,
* If any of the fields are NULL, the value is left unchanged. */
int
update_bookmark(struct bookmark *bm, int codepage,
unsigned char *title, unsigned char *url)
char *title, char *url)
{
static int update_bookmark_event_id = EVENT_NONE;
const int utf8_cp = get_cp_index("UTF-8");
struct conv_table *table;
unsigned char *title2 = NULL;
unsigned char *url2 = NULL;
char *title2 = NULL;
char *url2 = NULL;
table = get_translation_table(codepage, utf8_cp);
if (!table)
@ -541,7 +541,7 @@ update_bookmark(struct bookmark *bm, int codepage,
*
* @return The bookmark, or NULL if not found. */
struct bookmark *
get_bookmark_by_name(struct bookmark *folder, unsigned char *title)
get_bookmark_by_name(struct bookmark *folder, char *title)
{
struct bookmark *bookmark;
LIST_OF(struct bookmark) *lh;
@ -556,7 +556,7 @@ get_bookmark_by_name(struct bookmark *folder, unsigned char *title)
/* Search bookmark cache for item matching url. */
struct bookmark *
get_bookmark(unsigned char *url)
get_bookmark(char *url)
{
struct hash_item *item;
@ -574,7 +574,7 @@ get_bookmark(unsigned char *url)
static void
bookmark_terminal(struct terminal *term, struct bookmark *folder)
{
unsigned char title[MAX_STR_LEN], url[MAX_STR_LEN];
char title[MAX_STR_LEN], url[MAX_STR_LEN];
struct window *tab;
int term_cp = get_terminal_codepage(term);
@ -600,7 +600,7 @@ bookmark_terminal(struct terminal *term, struct bookmark *folder)
* @param foldername
* The name of the new bookmark folder, in UTF-8. */
void
bookmark_terminal_tabs(struct terminal *term, unsigned char *foldername)
bookmark_terminal_tabs(struct terminal *term, char *foldername)
{
struct bookmark *folder = add_bookmark(NULL, 1, foldername, NULL);
@ -624,7 +624,7 @@ bookmark_all_terminals(struct bookmark *folder)
}
foreach (term, terminals) {
unsigned char subfoldername[4];
char subfoldername[4];
struct bookmark *subfolder;
if (ulongcat(subfoldername, NULL, n, sizeof(subfoldername), 0)
@ -643,10 +643,10 @@ bookmark_all_terminals(struct bookmark *folder)
}
unsigned char *
char *
get_auto_save_bookmark_foldername_utf8(void)
{
unsigned char *foldername;
char *foldername;
int from_cp, to_cp;
struct conv_table *convert_table;
@ -670,7 +670,7 @@ get_auto_save_bookmark_foldername_utf8(void)
void
bookmark_auto_save_tabs(struct terminal *term)
{
unsigned char *foldername; /* UTF-8 */
char *foldername; /* UTF-8 */
if (get_cmd_opt_bool("anonymous")
|| !get_opt_bool("ui.sessions.auto_save", NULL))
@ -726,7 +726,7 @@ bookmark_snapshot(void)
* @param foldername
* The name of the bookmark folder, in UTF-8. */
void
open_bookmark_folder(struct session *ses, unsigned char *foldername)
open_bookmark_folder(struct session *ses, char *foldername)
{
struct bookmark *bookmark;
struct bookmark *folder = NULL;

View File

@ -23,8 +23,8 @@ struct bookmark {
/** @todo Bug 1066: The bookmark::url string should be in UTF-8 too,
* but this has not yet been fully implemented. */
unsigned char *title; /* UTF-8 title of bookmark */
unsigned char *url; /* Location of bookmarked item */
char *title; /* UTF-8 title of bookmark */
char *url; /* Location of bookmarked item */
LIST_OF(struct bookmark) child;
};
@ -48,18 +48,18 @@ void bookmarks_unset_dirty(void);
int bookmarks_are_dirty(void);
void delete_bookmark(struct bookmark *);
struct bookmark *add_bookmark(struct bookmark *, int, unsigned char *, unsigned char *);
struct bookmark *add_bookmark(struct bookmark *, int, char *, char *);
struct bookmark *add_bookmark_cp(struct bookmark *, int, int,
unsigned char *, unsigned char *);
char *, char *);
struct bookmark *get_bookmark_by_name(struct bookmark *folder,
unsigned char *title);
struct bookmark *get_bookmark(unsigned char *url);
void bookmark_terminal_tabs(struct terminal *term, unsigned char *foldername);
unsigned char *get_auto_save_bookmark_foldername_utf8(void);
char *title);
struct bookmark *get_bookmark(char *url);
void bookmark_terminal_tabs(struct terminal *term, char *foldername);
char *get_auto_save_bookmark_foldername_utf8(void);
void bookmark_auto_save_tabs(struct terminal *term);
int update_bookmark(struct bookmark *, int,
unsigned char *, unsigned char *);
void open_bookmark_folder(struct session *ses, unsigned char *foldername);
char *, char *);
void open_bookmark_folder(struct session *ses, char *foldername);
#ifdef __cplusplus
}

View File

@ -52,7 +52,7 @@ is_bookmark_used(struct listbox_item *item)
return is_object_used((struct bookmark *) item->udata);
}
static unsigned char *
static char *
get_bookmark_text(struct listbox_item *item, struct terminal *term)
{
struct bookmark *bookmark = item->udata;
@ -73,14 +73,14 @@ get_bookmark_text(struct listbox_item *item, struct terminal *term)
* resulting string may be displayed in the UI but should not be saved
* to a file or given to another program. */
static void
add_converted_bytes_to_string(void *data, unsigned char *buf, int buflen)
add_converted_bytes_to_string(void *data, char *buf, int buflen)
{
struct string *string = data;
add_bytes_to_string(string, buf, buflen); /* ignore errors */
}
static unsigned char *
static char *
get_bookmark_info(struct listbox_item *item, struct terminal *term)
{
struct bookmark *bookmark = item->udata;
@ -255,7 +255,7 @@ move_bookmark_after_selected(struct bookmark *bookmark, struct bookmark *selecte
* or "" means add a bookmark folder, unless @a title is "-". */
static void
do_add_bookmark(struct terminal *term, struct dialog_data *dlg_data,
unsigned char *title, unsigned char *url)
char *title, char *url)
{
int term_cp = get_terminal_codepage(term);
struct bookmark *bm = NULL;
@ -307,7 +307,7 @@ do_add_bookmark(struct terminal *term, struct dialog_data *dlg_data,
* The folder name that the user typed in the input dialog.
* This is in the charset of the terminal. */
static void
do_add_folder(struct dialog_data *dlg_data, unsigned char *foldername)
do_add_folder(struct dialog_data *dlg_data, char *foldername)
{
do_add_bookmark(dlg_data->win->term, dlg_data, foldername, NULL);
}
@ -327,7 +327,7 @@ push_add_folder_button(struct dialog_data *dlg_data, struct widget_data *widget_
N_("Add folder"), N_("Folder name"),
dlg_data, NULL,
MAX_STR_LEN, NULL, 0, 0, NULL,
(void (*)(void *, unsigned char *)) do_add_folder,
(void (*)(void *, char *)) do_add_folder,
NULL);
return EVENT_PROCESSED;
}
@ -393,8 +393,8 @@ push_edit_button(struct dialog_data *dlg_data, struct widget_data *edit_btn)
convert_table = get_translation_table(utf8_cp, term_cp);
if (convert_table) {
unsigned char *title;
unsigned char *url;
char *title;
char *url;
title = convert_string(convert_table,
bm->title, strlen(bm->title),
@ -641,8 +641,8 @@ bookmark_manager(struct session *ses)
* rapid search of an already existing bookmark. --Zas */
struct bookmark_search_ctx {
unsigned char *url; /* UTF-8 */
unsigned char *title; /* system charset */
char *url; /* UTF-8 */
char *title; /* system charset */
int found;
int offset;
int utf8_cp;
@ -673,7 +673,7 @@ test_search(struct listbox_item *item, void *data_, int *offset)
* charset. So convert bm->title to that.
* (ctx->title has already been converted.) */
struct conv_table *convert_table;
unsigned char *title = NULL;
char *title = NULL;
convert_table = get_translation_table(ctx->utf8_cp,
ctx->system_cp);
@ -705,8 +705,8 @@ test_search(struct listbox_item *item, void *data_, int *offset)
/* Last searched values. Both are in UTF-8. (The title could be kept
* in the system charset, but that would be a bit risky, because
* setlocale calls from Lua scripts can change the system charset.) */
static unsigned char *bm_last_searched_title = NULL;
static unsigned char *bm_last_searched_url = NULL;
static char *bm_last_searched_title = NULL;
static char *bm_last_searched_url = NULL;
void
free_last_searched_bookmark(void)
@ -716,8 +716,8 @@ free_last_searched_bookmark(void)
}
static int
memorize_last_searched_bookmark(const unsigned char *title,
const unsigned char *url)
memorize_last_searched_bookmark(const char *title,
const char *url)
{
/* Memorize last searched title */
mem_free_set(&bm_last_searched_title, stracpy(title));
@ -743,9 +743,9 @@ bookmark_search_do(void *data)
struct dialog_data *dlg_data;
struct conv_table *convert_table;
int term_cp;
unsigned char *url_term;
unsigned char *title_term;
unsigned char *title_utf8 = NULL;
char *url_term;
char *title_term;
char *title_utf8 = NULL;
assertm(dlg->udata != NULL, "Bookmark search with NULL udata in dialog");
if_assert_failed return;
@ -797,8 +797,8 @@ launch_bm_search_doc_dialog(struct terminal *term,
struct dialog_data *parent,
struct session *ses)
{
unsigned char *title = NULL;
unsigned char *url = NULL;
char *title = NULL;
char *url = NULL;
if (bm_last_searched_title && bm_last_searched_url) {
int utf8_cp, term_cp;
@ -872,8 +872,8 @@ void
launch_bm_add_dialog(struct terminal *term,
struct dialog_data *parent,
struct session *ses,
unsigned char *title,
unsigned char *url)
char *title,
char *url)
{
/* When the user eventually pushes the OK button, BFU calls
* bookmark_add_add() and gives it the struct dialog * as the
@ -906,7 +906,7 @@ launch_bm_add_link_dialog(struct terminal *term,
struct dialog_data *parent,
struct session *ses)
{
unsigned char title[MAX_STR_LEN], url[MAX_STR_LEN];
char title[MAX_STR_LEN], url[MAX_STR_LEN];
launch_bm_add_dialog(term, parent, ses,
get_current_link_name(ses, title, MAX_STR_LEN),
@ -919,13 +919,13 @@ launch_bm_add_link_dialog(struct terminal *term,
\****************************************************************************/
static void
bookmark_terminal_tabs_ok(void *term_void, unsigned char *foldername)
bookmark_terminal_tabs_ok(void *term_void, char *foldername)
{
struct terminal *const term = term_void;
int from_cp = get_terminal_codepage(term);
int to_cp = get_cp_index("UTF-8");
struct conv_table *convert_table;
unsigned char *converted;
char *converted;
convert_table = get_translation_table(from_cp, to_cp);
if (convert_table == NULL) return; /** @todo Report the error */

View File

@ -21,8 +21,8 @@ void bookmark_manager(struct session *ses);
void launch_bm_add_dialog(struct terminal *term,
struct dialog_data *parent,
struct session *ses,
unsigned char *title,
unsigned char *url);
char *title,
char *url);
/* ...with the current document's title and URL */
void launch_bm_add_doc_dialog(struct terminal *term,

6
src/cache/cache.c vendored
View File

@ -374,7 +374,7 @@ remove_overlaps(struct cache_entry *cached, struct fragment *f, int *trunc)
* unhappy from that. */
int
add_fragment(struct cache_entry *cached, off_t offset,
const unsigned char *data, ssize_t length)
const char *data, ssize_t length)
{
struct fragment *f, *nf;
int trunc = 0;
@ -700,10 +700,10 @@ normalize_cache_entry(struct cache_entry *cached, off_t truncate_length)
struct uri *
redirect_cache(struct cache_entry *cached, unsigned char *location,
redirect_cache(struct cache_entry *cached, char *location,
int get, int incomplete)
{
unsigned char *uristring;
char *uristring;
/* XXX: I am a little puzzled whether we should only use the cache
* entry's URI if it is valid. Hopefully always using it won't hurt.

18
src/cache/cache.h vendored
View File

@ -39,12 +39,12 @@ struct cache_entry {
struct uri *proxy_uri; /* Proxy identifier or same as @uri */
struct uri *redirect; /* Location we were redirected to */
unsigned char *head; /* The protocol header */
unsigned char *content_type; /* MIME type: <type> "/" <subtype> */
unsigned char *last_modified; /* Latest modification date */
unsigned char *etag; /* ETag value from the HTTP header */
unsigned char *ssl_info; /* SSL ciphers used during transfer */
unsigned char *encoding_info; /* Encoding used during transfer */
char *head; /* The protocol header */
char *content_type; /* MIME type: <type> "/" <subtype> */
char *last_modified; /* Latest modification date */
char *etag; /* ETag value from the HTTP header */
char *ssl_info; /* SSL ciphers used during transfer */
char *encoding_info; /* Encoding used during transfer */
unsigned int cache_id; /* Change each time entry is modified. */
@ -81,7 +81,7 @@ struct fragment {
off_t offset;
off_t length;
off_t real_length;
unsigned char data[1]; /* Must be last */
char data[1]; /* Must be last */
};
@ -114,7 +114,7 @@ struct cache_entry *get_redirected_cache_entry(struct uri *uri);
* 1 if cache entry was enlarged,
* 0 if only old data were overwritten. */
int add_fragment(struct cache_entry *cached, off_t offset,
const unsigned char *data, ssize_t length);
const char *data, ssize_t length);
/* Defragments the cache entry and returns the resulting fragment containing the
* complete source of all currently downloaded fragments. Returns NULL if
@ -138,7 +138,7 @@ void delete_cache_entry(struct cache_entry *cached);
* Returns the URI being redirected to or NULL if allocation failed.
*/
struct uri *
redirect_cache(struct cache_entry *cached, unsigned char *location,
redirect_cache(struct cache_entry *cached, char *location,
int get, int incomplete);
/* The garbage collector trigger. If @whole is zero, remove unused cache

8
src/cache/dialogs.c vendored
View File

@ -45,7 +45,7 @@ is_cache_entry_used(struct listbox_item *item)
return is_object_used((struct cache_entry *) item->udata);
}
static unsigned char *
static char *
get_cache_entry_text(struct listbox_item *item, struct terminal *term)
{
struct cache_entry *cached = item->udata;
@ -53,7 +53,7 @@ get_cache_entry_text(struct listbox_item *item, struct terminal *term)
return get_uri_string(cached->uri, URI_PUBLIC);
}
static unsigned char *
static char *
get_cache_entry_info(struct listbox_item *item, struct terminal *term)
{
struct cache_entry *cached = item->udata;
@ -189,7 +189,7 @@ delete_cache_entry_item(struct listbox_item *item, int last)
static enum listbox_match
match_cache_entry(struct listbox_item *item, struct terminal *term,
unsigned char *text)
char *text)
{
struct cache_entry *cached = item->udata;
@ -202,7 +202,7 @@ match_cache_entry(struct listbox_item *item, struct terminal *term,
static enum listbox_match
match_cache_entry_contents(struct listbox_item *item, struct terminal *term,
unsigned char *text)
char *text)
{
struct cache_entry *cached = item->udata;
struct fragment *fragment = get_cache_fragment(cached);

View File

@ -41,10 +41,10 @@
/* Hack to handle URL extraction for -remote commands */
static unsigned char *remote_url;
static char *remote_url;
static enum retval
parse_options_(int argc, unsigned char *argv[], struct option *opt,
parse_options_(int argc, char *argv[], struct option *opt,
LIST_OF(struct string_list_item) *url_list)
{
while (argc) {
@ -52,9 +52,9 @@ parse_options_(int argc, unsigned char *argv[], struct option *opt,
if (argv[-1][0] == '-' && argv[-1][1]) {
struct option *option;
unsigned char *argname = &argv[-1][1];
unsigned char *oname = stracpy(argname);
unsigned char *err;
char *argname = &argv[-1][1];
char *oname = stracpy(argname);
char *err;
if (!oname) continue;
@ -64,7 +64,7 @@ parse_options_(int argc, unsigned char *argv[], struct option *opt,
option = get_opt_rec(opt, argname);
if (!option) option = get_opt_rec(opt, oname);
if (!option) {
unsigned char *pos;
char *pos;
oname++; /* the '-' */
/* Substitute '-' by '_'. This helps
@ -116,7 +116,7 @@ unknown_option:
}
enum retval
parse_options(int argc, unsigned char *argv[],
parse_options(int argc, char *argv[],
LIST_OF(struct string_list_item) *url_list)
{
return parse_options_(argc, argv, cmdline_options, url_list);
@ -127,8 +127,8 @@ parse_options(int argc, unsigned char *argv[],
Options handlers
**********************************************************************/
static unsigned char *
eval_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
eval_cmd(struct option *o, char ***argv, int *argc)
{
if (*argc < 1) return gettext("Parameter expected");
@ -141,15 +141,15 @@ eval_cmd(struct option *o, unsigned char ***argv, int *argc)
return NULL;
}
static unsigned char *
forcehtml_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
forcehtml_cmd(struct option *o, char ***argv, int *argc)
{
safe_strncpy(get_opt_str("mime.default_type", NULL), "text/html", MAX_STR_LEN);
return NULL;
}
static unsigned char *
lookup_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
lookup_cmd(struct option *o, char ***argv, int *argc)
{
struct sockaddr_storage *addrs = NULL;
int addrno, i;
@ -170,7 +170,7 @@ lookup_cmd(struct option *o, unsigned char ***argv, int *argc)
for (i = 0; i < addrno; i++) {
#ifdef CONFIG_IPV6
struct sockaddr_in6 addr = *((struct sockaddr_in6 *) &(addrs)[i]);
unsigned char p[INET6_ADDRSTRLEN];
char p[INET6_ADDRSTRLEN];
if (! inet_ntop(addr.sin6_family,
(addr.sin6_family == AF_INET6 ? (void *) &addr.sin6_addr
@ -181,7 +181,7 @@ lookup_cmd(struct option *o, unsigned char ***argv, int *argc)
printf("%s\n", p);
#else
struct sockaddr_in addr = *((struct sockaddr_in *) &(addrs)[i]);
unsigned char *p = (unsigned char *) &addr.sin_addr.s_addr;
char *p = (char *) &addr.sin_addr.s_addr;
printf("%d.%d.%d.%d\n", (int) p[0], (int) p[1],
(int) p[2], (int) p[3]);
@ -210,12 +210,12 @@ enum remote_method_enum {
};
struct remote_method {
unsigned char *name;
char *name;
enum remote_method_enum type;
};
static unsigned char *
remote_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
remote_cmd(struct option *o, char ***argv, int *argc)
{
struct remote_method remote_methods[] = {
{ "openURL", REMOTE_METHOD_OPENURL },
@ -227,9 +227,9 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
{ "search", REMOTE_METHOD_SEARCH },
{ NULL, REMOTE_METHOD_NOT_SUPPORTED },
};
unsigned char *command, *arg, *argend, *argstring;
char *command, *arg, *argend, *argstring;
int method, len = 0;
unsigned char *remote_argv[10];
char *remote_argv[10];
int remote_argc;
if (*argc < 1) return gettext("Parameter expected");
@ -265,7 +265,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
remote_argc = 0;
do {
unsigned char *start, *end;
char *start, *end;
if (remote_argc > sizeof_array(remote_argv)) {
mem_free(argstring);
@ -325,7 +325,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
} while (*arg);
for (method = 0; remote_methods[method].name; method++) {
unsigned char *name = remote_methods[method].name;
char *name = remote_methods[method].name;
if (!c_strlcasecmp(command, len, name, -1))
break;
@ -340,7 +340,7 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
}
if (remote_argc == 2) {
unsigned char *where = remote_argv[1];
char *where = remote_argv[1];
if (strstr((const char *)where, "new-window")) {
remote_session_flags |= SES_REMOTE_NEW_WINDOW;
@ -423,8 +423,8 @@ remote_cmd(struct option *o, unsigned char ***argv, int *argc)
return NULL;
}
static unsigned char *
version_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
version_cmd(struct option *o, char ***argv, int *argc)
{
printf("%s\n", full_static_version);
fflush(stdout);
@ -444,7 +444,7 @@ version_cmd(struct option *o, unsigned char ***argv, int *argc)
#define gettext_nonempty(x) (*(x) ? gettext(x) : (x))
static void print_option_desc(const unsigned char *desc)
static void print_option_desc(const char *desc)
{
struct string wrapped;
static const struct string indent = INIT_STRING(" ", 12);
@ -466,25 +466,25 @@ static void print_option_desc(const unsigned char *desc)
done_string(&wrapped);
}
static void print_full_help_outer(struct option *tree, unsigned char *path);
static void print_full_help_outer(struct option *tree, char *path);
static void
print_full_help_inner(struct option *tree, unsigned char *path,
print_full_help_inner(struct option *tree, char *path,
int trees)
{
struct option *option;
unsigned char saved[MAX_STR_LEN];
unsigned char *savedpos = saved;
char saved[MAX_STR_LEN];
char *savedpos = saved;
*savedpos = 0;
foreach (option, *tree->value.tree) {
enum option_type type = option->type;
unsigned char *help;
unsigned char *capt = option->capt;
unsigned char *desc = (option->desc && *option->desc)
? (unsigned char *) gettext(option->desc)
: (unsigned char *) "N/A";
char *help;
char *capt = option->capt;
char *desc = (option->desc && *option->desc)
? (char *) gettext(option->desc)
: (char *) "N/A";
if (trees != (type == OPT_TREE))
continue;
@ -496,7 +496,7 @@ print_full_help_inner(struct option *tree, unsigned char *path,
continue;
if (!capt && !c_strncasecmp(option->name, "_template_", 10))
capt = (unsigned char *) N_("Template option folder");
capt = (char *) N_("Template option folder");
if (!capt) {
int len = strlen(option->name);
@ -543,7 +543,7 @@ print_full_help_inner(struct option *tree, unsigned char *path,
case OPT_COLOR:
{
color_T color = option->value.color;
unsigned char hexcolor[8];
char hexcolor[8];
printf(gettext("(default: %s)"),
get_color_string(color, hexcolor));
@ -599,7 +599,7 @@ print_full_help_inner(struct option *tree, unsigned char *path,
}
static void
print_full_help_outer(struct option *tree, unsigned char *path)
print_full_help_outer(struct option *tree, char *path)
{
print_full_help_inner(tree, path, 0);
print_full_help_inner(tree, path, 1);
@ -612,17 +612,17 @@ print_short_help(void)
struct option *option;
struct string string = NULL_STRING;
struct string *saved = NULL;
unsigned char align[ALIGN_WIDTH];
char align[ALIGN_WIDTH];
/* Initialize @space used to align captions. */
memset(align, ' ', sizeof(align) - 1);
align[sizeof(align) - 1] = 0;
foreach (option, *cmdline_options->value.tree) {
unsigned char *capt;
unsigned char *help;
unsigned char *info = saved ? saved->source
: (unsigned char *) "";
char *capt;
char *help;
char *info = saved ? saved->source
: (char *) "";
int len = strlen(option->name);
/* Avoid printing compatibility options */
@ -666,10 +666,10 @@ print_short_help(void)
#undef gettext_nonempty
static unsigned char *
printhelp_cmd(struct option *option, unsigned char ***argv, int *argc)
static char *
printhelp_cmd(struct option *option, char ***argv, int *argc)
{
unsigned char *lineend = strchr((const char *)full_static_version, '\n');
char *lineend = strchr((const char *)full_static_version, '\n');
if (lineend) *lineend = '\0';
@ -693,10 +693,10 @@ printhelp_cmd(struct option *option, unsigned char ***argv, int *argc)
return "";
}
static unsigned char *
redir_cmd(struct option *option, unsigned char ***argv, int *argc)
static char *
redir_cmd(struct option *option, char ***argv, int *argc)
{
unsigned char *target;
char *target;
/* I can't get any dirtier. --pasky */
@ -732,10 +732,10 @@ redir_cmd(struct option *option, unsigned char ***argv, int *argc)
return NULL;
}
static unsigned char *
printconfigdump_cmd(struct option *option, unsigned char ***argv, int *argc)
static char *
printconfigdump_cmd(struct option *option, char ***argv, int *argc)
{
unsigned char *config_string;
char *config_string;
/* Print all. */
get_opt_int("config.saving_style", NULL) = 2;

View File

@ -8,7 +8,7 @@
extern "C" {
#endif
enum retval parse_options(int, unsigned char *[],
enum retval parse_options(int, char *[],
LIST_OF(struct string_list_item) *);
#ifdef __cplusplus

View File

@ -60,7 +60,7 @@
struct conf_parsing_pos {
/** Points to the next character to be parsed from the
* configuration file. */
unsigned char *look;
char *look;
/** The line number corresponding to #look. This is
* shown in error messages. */
@ -78,11 +78,11 @@ struct conf_parsing_state {
* to the mirror string. Otherwise, @c mirrored is not used.
*
* @invariant @c mirrored @<= @c pos.look */
unsigned char *mirrored;
char *mirrored;
/** File name for error messages. If NULL then do not display
* error messages. */
const unsigned char *filename;
const char *filename;
};
/** Tell the user about an error in the configuration file.
@ -90,7 +90,7 @@ struct conf_parsing_state {
static enum parse_error
show_parse_error(const struct conf_parsing_state *state, enum parse_error err)
{
static const unsigned char error_msg[][40] = {
static const char error_msg[][40] = {
"no error", /* ERROR_NONE */
"unknown command", /* ERROR_COMMAND */
"parse error", /* ERROR_PARSE */
@ -110,7 +110,7 @@ show_parse_error(const struct conf_parsing_state *state, enum parse_error err)
static void
skip_white(struct conf_parsing_pos *pos)
{
unsigned char *start = pos->look;
char *start = pos->look;
while (*start) {
while (isspace(*start)) {
@ -202,12 +202,12 @@ static enum parse_error
parse_set_common(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf, int want_domain)
{
const unsigned char *domain_orig = NULL;
const char *domain_orig = NULL;
size_t domain_len = 0;
unsigned char *domain_copy = NULL;
const unsigned char *optname_orig;
char *domain_copy = NULL;
const char *optname_orig;
size_t optname_len;
unsigned char *optname_copy;
char *optname_copy;
skip_white(&state->pos);
if (!*state->pos.look) return show_parse_error(state, ERROR_PARSE);
@ -252,7 +252,7 @@ parse_set_common(struct option *opt_tree, struct conf_parsing_state *state,
/* Option value */
{
struct option *opt;
unsigned char *val;
char *val;
const struct conf_parsing_pos pos_before_value = state->pos;
if (want_domain && *domain_copy) {
@ -403,9 +403,9 @@ static enum parse_error
parse_unset(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
{
const unsigned char *optname_orig;
const char *optname_orig;
size_t optname_len;
unsigned char *optname_copy;
char *optname_copy;
skip_white(&state->pos);
if (!*state->pos.look) return show_parse_error(state, ERROR_PARSE);
@ -480,7 +480,7 @@ static enum parse_error
parse_bind(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
{
unsigned char *keymap, *keystroke, *action;
char *keymap, *keystroke, *action;
enum parse_error err = ERROR_NONE;
struct conf_parsing_pos before_error;
@ -550,7 +550,7 @@ parse_bind(struct option *opt_tree, struct conf_parsing_state *state,
/* Mirror what we already have. If the keystroke has
* been unbound, then act_str is simply "none" and
* this does not require special handling. */
unsigned char *act_str = bind_act(keymap, keystroke);
char *act_str = bind_act(keymap, keystroke);
if (act_str) {
add_bytes_to_string(mirror, state->mirrored,
@ -566,14 +566,14 @@ parse_bind(struct option *opt_tree, struct conf_parsing_state *state,
return err;
}
static int load_config_file(unsigned char *, unsigned char *, struct option *,
static int load_config_file(char *, char *, struct option *,
struct string *, int);
static enum parse_error
parse_include(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
{
unsigned char *fname;
char *fname;
struct string dumbstring;
struct conf_parsing_pos before_error;
@ -603,7 +603,7 @@ parse_include(struct option *opt_tree, struct conf_parsing_state *state,
* rarely-used option ;). */
/* XXX: We should try CONFDIR/<file> when proceeding
* CONFDIR/<otherfile> ;). --pasky */
if (load_config_file(fname[0] == '/' ? (unsigned char *) ""
if (load_config_file(fname[0] == '/' ? (char *) ""
: elinks_home,
fname, opt_tree,
mirror ? &dumbstring : NULL, 1)) {
@ -619,7 +619,7 @@ parse_include(struct option *opt_tree, struct conf_parsing_state *state,
struct parse_handler {
const unsigned char *command;
const char *command;
enum parse_error (*handler)(struct option *opt_tree,
struct conf_parsing_state *state,
struct string *mirror, int is_system_conf);
@ -673,7 +673,7 @@ parse_config_command(struct option *options, struct conf_parsing_state *state,
#ifdef CONFIG_EXMODE
enum parse_error
parse_config_exmode_command(unsigned char *cmd)
parse_config_exmode_command(char *cmd)
{
struct conf_parsing_state state = {{ 0 }};
@ -687,8 +687,8 @@ parse_config_exmode_command(unsigned char *cmd)
#endif /* CONFIG_EXMODE */
void
parse_config_file(struct option *options, unsigned char *name,
unsigned char *file, struct string *mirror,
parse_config_file(struct option *options, char *name,
char *file, struct string *mirror,
int is_system_conf)
{
struct conf_parsing_state state = {{ 0 }};
@ -761,11 +761,11 @@ parse_config_file(struct option *options, unsigned char *name,
static unsigned char *
read_config_file(unsigned char *name)
static char *
read_config_file(char *name)
{
#define FILE_BUF 1024
unsigned char cfg_buffer[FILE_BUF];
char cfg_buffer[FILE_BUF];
struct string string;
int fd;
ssize_t r;
@ -796,21 +796,21 @@ read_config_file(unsigned char *name)
/* Return 0 on success. */
static int
load_config_file(unsigned char *prefix, unsigned char *name,
load_config_file(char *prefix, char *name,
struct option *options, struct string *mirror,
int is_system_conf)
{
unsigned char *config_str, *config_file;
char *config_str, *config_file;
config_file = straconcat(prefix, STRING_DIR_SEP, name,
(unsigned char *) NULL);
(char *) NULL);
if (!config_file) return 1;
config_str = read_config_file(config_file);
if (!config_str) {
mem_free(config_file);
config_file = straconcat(prefix, STRING_DIR_SEP, ".", name,
(unsigned char *) NULL);
(char *) NULL);
if (!config_file) return 2;
config_str = read_config_file(config_file);
@ -830,7 +830,7 @@ load_config_file(unsigned char *prefix, unsigned char *name,
}
static void
load_config_from(unsigned char *file, struct option *tree)
load_config_from(char *file, struct option *tree)
{
load_config_file(CONFDIR, file, tree, NULL, 1);
load_config_file(empty_string_or_(elinks_home), file, tree, NULL, 0);
@ -848,8 +848,8 @@ static int indentation = 2;
/* 0 -> none, 1 -> only option full name+type, 2 -> only desc, 3 -> both */
static int comments = 3;
static inline unsigned char *
conf_i18n(unsigned char *s, int i18n)
static inline char *
conf_i18n(char *s, int i18n)
{
if (i18n) return gettext(s);
return s;
@ -864,11 +864,11 @@ add_indent_to_string(struct string *string, int depth)
}
struct string *
wrap_option_desc(struct string *out, const unsigned char *src,
wrap_option_desc(struct string *out, const char *src,
const struct string *indent, int maxwidth)
{
const unsigned char *last_space = NULL;
const unsigned char *uncopied = src;
const char *last_space = NULL;
const char *uncopied = src;
int width = 0;
/* TODO: multibyte or fullwidth characters */
@ -909,7 +909,7 @@ static void
output_option_desc_as_comment(struct string *out, const struct option *option,
int i18n, int depth)
{
unsigned char *desc_i18n = conf_i18n(option->desc, i18n);
char *desc_i18n = conf_i18n(option->desc, i18n);
struct string indent;
if (!init_string(&indent)) return;
@ -923,11 +923,11 @@ out_of_memory:
done_string(&indent);
}
static unsigned char *smart_config_output_fn_domain;
static char *smart_config_output_fn_domain;
static void
smart_config_output_fn(struct string *string, struct option *option,
unsigned char *path, int depth, int do_print_comment,
char *path, int depth, int do_print_comment,
int action, int i18n)
{
if (option->type == OPT_ALIAS)
@ -999,7 +999,7 @@ smart_config_output_fn(struct string *string, struct option *option,
static void
add_cfg_header_to_string(struct string *string, unsigned char *text)
add_cfg_header_to_string(struct string *string, char *text)
{
int n = strlen(text) + 2;
@ -1012,8 +1012,8 @@ add_cfg_header_to_string(struct string *string, unsigned char *text)
add_to_string(string, "#\n\n");
}
unsigned char *
create_config_string(unsigned char *prefix, unsigned char *name)
char *
create_config_string(char *prefix, char *name)
{
struct option *options = config_options;
struct string config;
@ -1130,23 +1130,23 @@ get_me_out:
}
static int
write_config_file(unsigned char *prefix, unsigned char *name,
write_config_file(char *prefix, char *name,
struct terminal *term)
{
int ret = -1;
struct secure_save_info *ssi;
unsigned char *config_file = NULL;
unsigned char *cfg_str = create_config_string(prefix, name);
char *config_file = NULL;
char *cfg_str = create_config_string(prefix, name);
int prefixlen = strlen(prefix);
int prefix_has_slash = (prefixlen && dir_sep(prefix[prefixlen - 1]));
int name_has_slash = dir_sep(name[0]);
unsigned char *slash = name_has_slash || prefix_has_slash ? "" : STRING_DIR_SEP;
char *slash = name_has_slash || prefix_has_slash ? "" : STRING_DIR_SEP;
if (!cfg_str) return -1;
if (name_has_slash && prefix_has_slash) name++;
config_file = straconcat(prefix, slash, name, (unsigned char *) NULL);
config_file = straconcat(prefix, slash, name, (char *) NULL);
if (!config_file) goto free_cfg_str;
ssi = secure_open(config_file);

View File

@ -19,17 +19,17 @@ enum parse_error {
void load_config(void);
#ifdef CONFIG_EXMODE
enum parse_error parse_config_exmode_command(unsigned char *cmd);
enum parse_error parse_config_exmode_command(char *cmd);
#endif
void parse_config_file(struct option *options, unsigned char *name,
unsigned char *file, struct string *mirror,
void parse_config_file(struct option *options, char *name,
char *file, struct string *mirror,
int is_system_conf);
int write_config(struct terminal *);
unsigned char *
create_config_string(unsigned char *prefix, unsigned char *name);
char *
create_config_string(char *prefix, char *name);
struct string *wrap_option_desc(struct string *out, const unsigned char *src,
struct string *wrap_option_desc(struct string *out, const char *src,
const struct string *indent, int maxwidth);
#ifdef __cplusplus

View File

@ -39,12 +39,12 @@ disable_success_msgbox(void *dummy)
}
void
write_config_dialog(struct terminal *term, unsigned char *config_file,
write_config_dialog(struct terminal *term, char *config_file,
int secsave_error, int stdio_error)
{
/* [gettext_accelerator_context(write_config_dialog)] */
unsigned char *errmsg = NULL;
unsigned char *strerr;
char *errmsg = NULL;
char *strerr;
if (secsave_error == SS_ERR_NONE && !stdio_error) {
if (!get_opt_bool("ui.success_msgbox", NULL)) return;
@ -63,7 +63,7 @@ write_config_dialog(struct terminal *term, unsigned char *config_file,
if (stdio_error > 0)
errmsg = straconcat(strerr, " (", strerror(stdio_error), ")",
(unsigned char *) NULL);
(char *) NULL);
info_box(term, MSGBOX_FREE_TEXT,
N_("Write config error"), ALIGN_CENTER,
@ -99,7 +99,7 @@ is_option_used(struct listbox_item *item)
return is_object_used((struct option *) item->udata);
}
static unsigned char *
static char *
get_range_string(struct option *option)
{
struct string info;
@ -114,25 +114,25 @@ get_range_string(struct option *option)
return info.source;
}
static unsigned char *
static char *
get_option_text(struct listbox_item *item, struct terminal *term)
{
struct option *option = item->udata;
unsigned char *desc = option->capt ? option->capt : option->name;
char *desc = option->capt ? option->capt : option->name;
if (option->flags & OPT_TOUCHED)
return straconcat(_(desc, term),
" (", _("modified", term), ")",
(unsigned char *) NULL);
(char *) NULL);
return stracpy(_(desc, term));
}
static unsigned char *
static char *
get_option_info(struct listbox_item *item, struct terminal *term)
{
struct option *option = item->udata;
unsigned char *desc, *type;
char *desc, *type;
struct string info;
if (!init_string(&info)) return NULL;
@ -143,7 +143,7 @@ get_option_info(struct listbox_item *item, struct terminal *term)
if (option->type == OPT_TREE) {
type = straconcat(type, " ",
_("(expand by pressing space)", term),
(unsigned char *) NULL);
(char *) NULL);
}
add_format_to_string(&info, "\n%s: %s", _("Type", term), type);
@ -153,7 +153,7 @@ get_option_info(struct listbox_item *item, struct terminal *term)
}
if (option_types[option->type].write) {
unsigned char *range;
char *range;
struct string value;
if (!init_string(&value)) {
@ -181,7 +181,7 @@ get_option_info(struct listbox_item *item, struct terminal *term)
}
desc = _(option->desc ? option->desc : (unsigned char *) "N/A", term);
desc = _(option->desc ? option->desc : (char *) "N/A", term);
if (*desc)
add_format_to_string(&info, "\n\n%s:\n%s", _("Description", term), desc);
@ -202,7 +202,7 @@ get_option_root(struct listbox_item *item)
static enum listbox_match
match_option(struct listbox_item *item, struct terminal *term,
unsigned char *text)
char *text)
{
struct option *option = item->udata;
@ -268,8 +268,8 @@ check_valid_option(struct dialog_data *dlg_data, struct widget_data *widget_data
struct terminal *term = dlg_data->win->term;
struct option *option = dlg_data->dlg->udata;
struct session *ses = dlg_data->dlg->udata2;
unsigned char *value = widget_data->cdata;
unsigned char *chinon;
char *value = widget_data->cdata;
char *chinon;
int dummy_line = 0;
commandline = 1;
@ -301,7 +301,7 @@ build_edit_dialog(struct terminal *term, struct session *ses,
/* [gettext_accelerator_context(.build_edit_dialog)] */
#define EDIT_WIDGETS_COUNT 5
struct dialog *dlg;
unsigned char *value, *name, *desc, *range;
char *value, *name, *desc, *range;
struct string tvalue;
if (!init_string(&tvalue)) return;
@ -329,18 +329,18 @@ build_edit_dialog(struct terminal *term, struct session *ses,
name = straconcat(_("Name", term), ": ", option->name, "\n",
_("Type", term), ": ",
_(option_types[option->type].name, term),
(unsigned char *) NULL);
(char *) NULL);
desc = straconcat(_("Description", term), ": \n",
_(option->desc ? option->desc
: (unsigned char *) "N/A", term),
(unsigned char *) NULL);
: (char *) "N/A", term),
(char *) NULL);
range = get_range_string(option);
if (range) {
if (*range) {
unsigned char *tmp;
char *tmp;
tmp = straconcat(name, " ", range,
(unsigned char *) NULL);
(char *) NULL);
if (tmp) {
mem_free(name);
name = tmp;
@ -406,7 +406,7 @@ struct add_option_to_tree_ctx {
};
static void
add_option_to_tree(void *data, unsigned char *name)
add_option_to_tree(void *data, char *name)
{
struct add_option_to_tree_ctx *ctx = data;
struct option *old = get_opt_rec_real(ctx->option, name);
@ -422,7 +422,7 @@ add_option_to_tree(void *data, unsigned char *name)
static widget_handler_status_T
check_option_name(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
unsigned char *p;
char *p;
for (p = widget_data->cdata; *p; p++)
if (!is_option_name_char(*p)) {
@ -632,7 +632,7 @@ is_keybinding_used(struct listbox_item *item)
return is_object_used((struct keybinding *) item->udata);
}
static unsigned char *
static char *
get_keybinding_text(struct listbox_item *item, struct terminal *term)
{
struct keybinding *keybinding = item->udata;
@ -655,11 +655,11 @@ get_keybinding_text(struct listbox_item *item, struct terminal *term)
return info.source;
}
static unsigned char *
static char *
get_keybinding_info(struct listbox_item *item, struct terminal *term)
{
struct keybinding *keybinding = item->udata;
unsigned char *action, *keymap;
char *action, *keymap;
struct string info;
if (item->depth < 2) return NULL;
@ -698,10 +698,10 @@ get_keybinding_root(struct listbox_item *item)
static enum listbox_match
match_keybinding(struct listbox_item *item, struct terminal *term,
unsigned char *text)
char *text)
{
const struct action *action = item->udata;
unsigned char *desc;
char *desc;
if (item->depth != 1)
return LISTBOX_MATCH_IMPOSSIBLE;
@ -783,7 +783,7 @@ really_really_add_keybinding(void *data)
}
static void
really_add_keybinding(void *data, unsigned char *keystroke)
really_add_keybinding(void *data, char *keystroke)
{
/* [gettext_accelerator_context(.really_add_keybinding.yn)] */
struct kbdbind_add_hop *hop = data;
@ -834,7 +834,7 @@ static widget_handler_status_T
check_keystroke(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct kbdbind_add_hop *hop = dlg_data->dlg->udata2;
unsigned char *keystroke = widget_data->cdata;
char *keystroke = widget_data->cdata;
if (parse_keystroke(keystroke, &hop->kbd) >= 0)
return EVENT_PROCESSED;
@ -853,7 +853,7 @@ push_kbdbind_add_button(struct dialog_data *dlg_data,
struct listbox_data *box = get_dlg_listbox_data(dlg_data);
struct listbox_item *item = box->sel;
struct kbdbind_add_hop *hop;
unsigned char *text;
char *text;
if (!item || !item->depth) {
info_box(term, 0, N_("Add keybinding"), ALIGN_CENTER,

View File

@ -14,7 +14,7 @@ extern "C" {
extern struct hierbox_browser option_browser;
extern struct hierbox_browser keybinding_browser;
void write_config_dialog(struct terminal *term, unsigned char *config_file,
void write_config_dialog(struct terminal *term, char *config_file,
int secsave_error, int stdio_error);
void options_manager(struct session *);
void keybinding_manager(struct session *);

View File

@ -24,8 +24,8 @@ INIT_LIST_OF(struct domain_tree, domain_trees);
* match the given domain-name. Return the option from the the shadow tree
* that best matches the given domain name. */
static struct option *
get_domain_option(unsigned char *domain_name, int domain_len,
unsigned char *name)
get_domain_option(char *domain_name, int domain_len,
char *name)
{
struct option *opt, *longest_match_opt = NULL;
struct domain_tree *longest_match = NULL;
@ -46,7 +46,7 @@ get_domain_option(unsigned char *domain_name, int domain_len,
}
struct option *
get_domain_option_from_session(unsigned char *name, struct session *ses)
get_domain_option_from_session(char *name, struct session *ses)
{
struct uri *uri;
@ -66,7 +66,7 @@ get_domain_option_from_session(unsigned char *name, struct session *ses)
/* Return the shadow shadow tree for the given domain name, and
* if the domain does not yet have a shadow tree, create it. */
struct option *
get_domain_tree(unsigned char *domain_name)
get_domain_tree(char *domain_name)
{
struct domain_tree *domain;
int domain_len;

View File

@ -18,14 +18,14 @@ struct domain_tree {
int len;
unsigned char name[1]; /* Must be at end of struct. */
char name[1]; /* Must be at end of struct. */
};
extern LIST_OF(struct domain_tree) domain_trees;
struct option *get_domain_tree(unsigned char *);
struct option *get_domain_tree(char *);
struct option *get_domain_option_from_session(unsigned char *,
struct option *get_domain_option_from_session(char *,
struct session *);
void done_domain_trees(void);

View File

@ -24,11 +24,11 @@
#include "util/string.h"
unsigned char *elinks_home = NULL;
char *elinks_home = NULL;
int first_use = 0;
static inline void
strip_trailing_dir_sep(unsigned char *path)
strip_trailing_dir_sep(char *path)
{
int i;
@ -39,18 +39,18 @@ strip_trailing_dir_sep(unsigned char *path)
path[i + 1] = 0;
}
static unsigned char *
test_confdir(unsigned char *home, unsigned char *path,
unsigned char *error_message)
static char *
test_confdir(char *home, char *path,
char *error_message)
{
struct stat st;
unsigned char *confdir;
char *confdir;
if (!path || !*path) return NULL;
if (home && *home && !dir_sep(*path))
confdir = straconcat(home, STRING_DIR_SEP, path,
(unsigned char *) NULL);
(char *) NULL);
else
confdir = stracpy(path);
@ -86,11 +86,11 @@ test_confdir(unsigned char *home, unsigned char *path,
}
/* TODO: Check possibility to use <libgen.h> dirname. */
static unsigned char *
elinks_dirname(unsigned char *path)
static char *
elinks_dirname(char *path)
{
int i;
unsigned char *dir;
char *dir;
if (!path) return NULL;
@ -106,12 +106,12 @@ elinks_dirname(unsigned char *path)
return dir;
}
static unsigned char *
static char *
get_home(void)
{
unsigned char *home_elinks;
unsigned char *envhome = getenv("HOME");
unsigned char *home = NULL;
char *home_elinks;
char *envhome = getenv("HOME");
char *home = NULL;
if (!home && envhome)
home = stracpy(envhome);

View File

@ -5,7 +5,7 @@
extern "C" {
#endif
extern unsigned char *elinks_home;
extern char *elinks_home;
extern int first_use;
void init_home(void);

View File

@ -231,7 +231,7 @@ kbd_act_lookup(enum keymap_id keymap_id, action_id_T action_id)
}
struct keybinding *
kbd_nm_lookup(enum keymap_id keymap_id, unsigned char *name)
kbd_nm_lookup(enum keymap_id keymap_id, char *name)
{
action_id_T action_id = get_action_from_string(keymap_id, name);
@ -241,7 +241,7 @@ kbd_nm_lookup(enum keymap_id keymap_id, unsigned char *name)
}
static struct keybinding *
kbd_stroke_lookup(enum keymap_id keymap_id, const unsigned char *keystroke_str)
kbd_stroke_lookup(enum keymap_id keymap_id, const char *keystroke_str)
{
struct term_event_keyboard kbd;
@ -260,7 +260,7 @@ kbd_stroke_lookup(enum keymap_id keymap_id, const unsigned char *keystroke_str)
static const struct action *
get_action_from_keystroke(enum keymap_id keymap_id,
const unsigned char *keystroke_str)
const char *keystroke_str)
{
struct keybinding *keybinding = kbd_stroke_lookup(keymap_id,
keystroke_str);
@ -268,9 +268,9 @@ get_action_from_keystroke(enum keymap_id keymap_id,
return keybinding ? get_action(keymap_id, keybinding->action_id) : NULL;
}
unsigned char *
char *
get_action_name_from_keystroke(enum keymap_id keymap_id,
const unsigned char *keystroke_str)
const char *keystroke_str)
{
const struct action *action = get_action_from_keystroke(keymap_id,
keystroke_str);
@ -279,7 +279,7 @@ get_action_name_from_keystroke(enum keymap_id keymap_id,
}
action_id_T
get_action_from_string(enum keymap_id keymap_id, unsigned char *str)
get_action_from_string(enum keymap_id keymap_id, char *str)
{
const struct action *action;
@ -303,7 +303,7 @@ get_action(enum keymap_id keymap_id, action_id_T action_id)
return NULL;
}
unsigned char *
char *
get_action_name(enum keymap_id keymap_id, action_id_T action_id)
{
const struct action *action = get_action(keymap_id, action_id);
@ -311,7 +311,7 @@ get_action_name(enum keymap_id keymap_id, action_id_T action_id)
return action ? action->str : NULL;
}
static unsigned char *
static char *
get_action_desc(enum keymap_id keymap_id, action_id_T action_id)
{
const struct action *action = get_action(keymap_id, action_id);
@ -330,7 +330,7 @@ get_keymap(enum keymap_id keymap_id)
}
static enum keymap_id
get_keymap_id(unsigned char *keymap_str)
get_keymap_id(char *keymap_str)
{
int keymap_id;
@ -341,7 +341,7 @@ get_keymap_id(unsigned char *keymap_str)
return KEYMAP_INVALID;
}
unsigned char *
char *
get_keymap_name(enum keymap_id keymap_id)
{
return get_keymap(keymap_id)->str;
@ -349,7 +349,7 @@ get_keymap_name(enum keymap_id keymap_id)
struct named_key {
const unsigned char *str;
const char *str;
term_event_key_T num;
};
@ -385,7 +385,7 @@ static const struct named_key key_table[] = {
};
term_event_key_T
read_key(const unsigned char *key_str)
read_key(const char *key_str)
{
const struct named_key *key;
@ -406,7 +406,7 @@ read_key(const unsigned char *key_str)
* This function does not support ::KBD_MOD_PASTE, because keystrokes
* that include it should never be bound to actions. */
int
parse_keystroke(const unsigned char *s, struct term_event_keyboard *kbd)
parse_keystroke(const char *s, struct term_event_keyboard *kbd)
{
kbd->modifier = KBD_MOD_NONE;
while (1) {
@ -470,8 +470,8 @@ void
add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd,
int escape)
{
unsigned char key_buffer[3] = "\\x";
const unsigned char *key_string = NULL;
char key_buffer[3] = "\\x";
const char *key_string = NULL;
const struct named_key *key;
if (kbd->key == KBD_UNDEF) return;
@ -512,7 +512,7 @@ add_keystroke_action_to_string(struct string *string, action_id_T action_id,
add_keystroke_to_string(string, &keybinding->kbd, 0);
}
unsigned char *
char *
get_keystroke(action_id_T action_id, enum keymap_id keymap_id)
{
struct string keystroke;
@ -540,7 +540,7 @@ add_actions_to_string(struct string *string, action_id_T action_ids[],
for (i = 0; action_ids[i] != ACT_MAIN_NONE; i++) {
struct keybinding *keybinding = kbd_act_lookup(keymap_id, action_ids[i]);
int keystrokelen = string->length;
unsigned char *desc = get_action_desc(keymap_id, action_ids[i]);
char *desc = get_action_desc(keymap_id, action_ids[i]);
if (!keybinding) continue;
@ -582,8 +582,8 @@ free_keymaps(struct module *xxx)
*/
#ifdef CONFIG_SCRIPTING
static unsigned char *
bind_key_to_event(unsigned char *ckmap, const unsigned char *ckey, int event)
static char *
bind_key_to_event(char *ckmap, const char *ckey, int event)
{
struct term_event_keyboard kbd;
action_id_T action_id;
@ -605,8 +605,8 @@ bind_key_to_event(unsigned char *ckmap, const unsigned char *ckey, int event)
}
int
bind_key_to_event_name(unsigned char *ckmap, const unsigned char *ckey,
unsigned char *event_name, unsigned char **err)
bind_key_to_event_name(char *ckmap, const char *ckey,
char *event_name, char **err)
{
int event_id;
@ -849,7 +849,7 @@ add_default_keybindings(void)
*/
struct action_alias {
const unsigned char *str;
const char *str;
action_id_T action_id;
};
@ -887,7 +887,7 @@ static const struct action_alias *action_aliases[KEYMAP_MAX] = {
};
static action_id_T
get_aliased_action(enum keymap_id keymap_id, unsigned char *action_str)
get_aliased_action(enum keymap_id keymap_id, char *action_str)
{
assert(keymap_id >= 0 && keymap_id < KEYMAP_MAX);
@ -904,8 +904,8 @@ get_aliased_action(enum keymap_id keymap_id, unsigned char *action_str)
/* Return 0 when ok, something strange otherwise. */
int
bind_do(unsigned char *keymap_str, const unsigned char *keystroke_str,
unsigned char *action_str, int is_system_conf)
bind_do(char *keymap_str, const char *keystroke_str,
char *action_str, int is_system_conf)
{
enum keymap_id keymap_id;
action_id_T action_id;
@ -927,11 +927,11 @@ bind_do(unsigned char *keymap_str, const unsigned char *keystroke_str,
return 0;
}
unsigned char *
bind_act(unsigned char *keymap_str, const unsigned char *keystroke_str)
char *
bind_act(char *keymap_str, const char *keystroke_str)
{
enum keymap_id keymap_id;
unsigned char *action;
char *action;
struct keybinding *keybinding;
keymap_id = get_keymap_id(keymap_str);
@ -946,15 +946,15 @@ bind_act(unsigned char *keymap_str, const unsigned char *keystroke_str)
return NULL;
keybinding->flags |= KBDB_WATERMARK;
return straconcat("\"", action, "\"", (unsigned char *) NULL);
return straconcat("\"", action, "\"", (char *) NULL);
}
static void
single_bind_config_string(struct string *file, enum keymap_id keymap_id,
struct keybinding *keybinding)
{
unsigned char *keymap_str = get_keymap_name(keymap_id);
unsigned char *action_str = get_action_name(keymap_id, keybinding->action_id);
char *keymap_str = get_keymap_name(keymap_id);
char *action_str = get_action_name(keymap_id, keybinding->action_id);
if (!keymap_str || !action_str || action_str[0] == ' ')
return;

View File

@ -26,10 +26,10 @@ enum keymap_id {
};
struct action {
unsigned char *str;
char *str;
action_id_T num;
enum keymap_id keymap_id;
unsigned char *desc;
char *desc;
unsigned int flags;
};
@ -38,9 +38,9 @@ struct action_list {
int num_actions;
};
struct keymap {
unsigned char *str;
char *str;
enum keymap_id keymap_id;
unsigned char *desc;
char *desc;
};
enum action_flags {
@ -109,10 +109,10 @@ int keybinding_exists(enum keymap_id keymap_id, struct term_event_keyboard *kbd,
void free_keybinding(struct keybinding *);
const struct action *get_action(enum keymap_id keymap_id, action_id_T action_id);
unsigned char *get_action_name(enum keymap_id keymap_id, action_id_T action_id);
action_id_T get_action_from_string(enum keymap_id keymap_id, unsigned char *str);
unsigned char *get_action_name_from_keystroke(enum keymap_id keymap_id,
const unsigned char *keystroke_str);
char *get_action_name(enum keymap_id keymap_id, action_id_T action_id);
action_id_T get_action_from_string(enum keymap_id keymap_id, char *str);
char *get_action_name_from_keystroke(enum keymap_id keymap_id,
const char *keystroke_str);
static inline unsigned int
action_is_anonymous_safe(enum keymap_id keymap_id, action_id_T action_id)
@ -162,10 +162,10 @@ action_requires_form(enum keymap_id keymap_id, action_id_T action_id)
return action && (action->flags & ACTION_REQUIRE_FORM);
}
term_event_key_T read_key(const unsigned char *);
unsigned char *get_keymap_name(enum keymap_id);
term_event_key_T read_key(const char *);
char *get_keymap_name(enum keymap_id);
int parse_keystroke(const unsigned char *, struct term_event_keyboard *);
int parse_keystroke(const char *, struct term_event_keyboard *);
void add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd, int escape);
/* void add_accesskey_to_string(struct string *str, unicode_val_T accesskey); */
@ -184,19 +184,19 @@ void add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd
action_id_T kbd_action(enum keymap_id, struct term_event *, int *);
struct keybinding *kbd_ev_lookup(enum keymap_id, struct term_event_keyboard *kbd, int *);
struct keybinding *kbd_nm_lookup(enum keymap_id, unsigned char *);
struct keybinding *kbd_nm_lookup(enum keymap_id, char *);
int bind_do(unsigned char *, const unsigned char *, unsigned char *, int);
unsigned char *bind_act(unsigned char *, const unsigned char *);
int bind_do(char *, const char *, char *, int);
char *bind_act(char *, const char *);
void bind_config_string(struct string *);
#ifdef CONFIG_SCRIPTING
int bind_key_to_event_name(unsigned char *, const unsigned char *, unsigned char *,
unsigned char **);
int bind_key_to_event_name(char *, const char *, char *,
char **);
#endif
void add_keystroke_action_to_string(struct string *string, action_id_T action_id, enum keymap_id keymap_id);
unsigned char *get_keystroke(action_id_T action_id, enum keymap_id keymap_id);
char *get_keystroke(action_id_T action_id, enum keymap_id keymap_id);
void add_actions_to_string(struct string *string, action_id_T actions[],
enum keymap_id keymap_id, struct terminal *term);

View File

@ -68,7 +68,7 @@ static struct option options_root = INIT_OPTION(
struct option *config_options;
struct option *cmdline_options;
static void add_opt_rec(struct option *, unsigned char *, struct option *);
static void add_opt_rec(struct option *, char *, struct option *);
static void free_options_tree(LIST_OF(struct option) *, int recursive);
#ifdef CONFIG_DEBUG
@ -78,7 +78,7 @@ static void free_options_tree(LIST_OF(struct option) *, int recursive);
#define bad_punct(c) (c != ')' && c != '>' && !isquote(c) && ispunct(c))
static void
check_caption(unsigned char *caption)
check_caption(char *caption)
{
int len;
unsigned char c;
@ -106,7 +106,7 @@ check_caption(unsigned char *caption)
#undef bad_punct
static void
check_description(unsigned char *desc)
check_description(char *desc)
{
int len;
unsigned char c;
@ -170,12 +170,12 @@ static int no_autocreate = 0;
*
* @relates option */
struct option *
get_opt_rec(struct option *tree, const unsigned char *name_)
get_opt_rec(struct option *tree, const char *name_)
{
struct option *option;
unsigned char *aname = stracpy(name_);
unsigned char *name = aname;
unsigned char *sep;
char *aname = stracpy(name_);
char *name = aname;
char *sep;
if (!aname) return NULL;
@ -243,7 +243,7 @@ get_opt_rec(struct option *tree, const unsigned char *name_)
* enabled.
* @relates option */
struct option *
get_opt_rec_real(struct option *tree, const unsigned char *name)
get_opt_rec_real(struct option *tree, const char *name)
{
struct option *opt;
@ -282,9 +282,9 @@ indirect_option(struct option *alias)
union option_value *
get_opt_(
#ifdef CONFIG_DEBUG
unsigned char *file, int line, enum option_type option_type,
char *file, int line, enum option_type option_type,
#endif
struct option *tree, unsigned char *name, struct session *ses)
struct option *tree, char *name, struct session *ses)
{
struct option *opt = NULL;
@ -437,7 +437,7 @@ append:
/** Add option to tree.
* @relates option */
static void
add_opt_rec(struct option *tree, unsigned char *path, struct option *option)
add_opt_rec(struct option *tree, char *path, struct option *option)
{
int abi = 0;
@ -502,9 +502,9 @@ init_option_listbox_item(struct option *option)
/*! @relates option */
struct option *
add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
unsigned char *name, enum option_flags flags, enum option_type type,
long min, long max, longptr_T value, unsigned char *desc)
add_opt(struct option *tree, char *path, char *capt,
char *name, enum option_flags flags, enum option_type type,
long min, long max, longptr_T value, char *desc)
{
struct option *option = mem_calloc(1, sizeof(*option));
@ -539,10 +539,10 @@ add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
mem_free(option);
return NULL;
}
option->value.string = (unsigned char *) value;
option->value.string = (char *) value;
break;
case OPT_ALIAS:
option->value.string = (unsigned char *) value;
option->value.string = (char *) value;
break;
case OPT_BOOL:
case OPT_INT:
@ -553,7 +553,7 @@ add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
option->value.big_number = (long) value; /* FIXME: cast from void * */
break;
case OPT_COLOR:
decode_color((unsigned char *) value, strlen((unsigned char *) value),
decode_color((char *) value, strlen((char *) value),
&option->value.color);
break;
case OPT_COMMAND:
@ -1059,9 +1059,9 @@ check_nonempty_tree(LIST_OF(struct option) *options)
void
smart_config_string(struct string *str, int print_comment, int i18n,
LIST_OF(struct option) *options,
unsigned char *path, int depth,
char *path, int depth,
void (*fn)(struct string *, struct option *,
unsigned char *, int, int, int, int))
char *, int, int, int, int))
{
struct option *option;
@ -1202,7 +1202,7 @@ commit_option_values(struct option_resolver *resolvers,
assert(resolvers && root && values && size);
for (i = 0; i < size; i++) {
unsigned char *name = resolvers[i].name;
char *name = resolvers[i].name;
struct option *option = get_opt_rec(root, name);
int id = resolvers[i].id;
@ -1239,7 +1239,7 @@ checkout_option_values(struct option_resolver *resolvers,
int i;
for (i = 0; i < size; i++) {
unsigned char *name = resolvers[i].name;
char *name = resolvers[i].name;
struct option *option = get_opt_rec(root, name);
int id = resolvers[i].id;
@ -1273,7 +1273,7 @@ register_options(union option_info info[], struct option *tree)
const struct option_init init = info[i].init;
struct option *option = &info[i].option;
unsigned char *string;
char *string;
*option = zero;
option->name = init.name;

View File

@ -136,8 +136,8 @@ struct session; /* session/session.h */
*
* @return NULL if successful, or a localized error string that the
* caller will not free. */
typedef unsigned char *option_command_fn_T(struct option *option,
unsigned char ***argv, int *argc);
typedef char *option_command_fn_T(struct option *option,
char ***argv, int *argc);
union option_value {
/** The ::OPT_TREE list_head is allocated.
@ -161,7 +161,7 @@ union option_value {
* The ::OPT_ALIAS string is NOT allocated, has variable length
* (option.max) and should remain untouched! It contains the full path to
* the "real" / aliased option. */
unsigned char *string;
char *string;
};
@ -190,13 +190,13 @@ typedef int (*change_hook_T)(struct session *session, struct option *current,
struct option {
OBJECT_HEAD(struct option);
unsigned char *name;
char *name;
enum option_flags flags;
enum option_type type;
long min, max;
union option_value value;
unsigned char *desc;
unsigned char *capt;
char *desc;
char *capt;
struct option *root;
@ -224,7 +224,7 @@ extern void done_options(void);
struct change_hook_info {
unsigned char *name;
char *name;
change_hook_T change_hook;
};
@ -236,9 +236,9 @@ extern void prepare_mustsave_flags(LIST_OF(struct option) *, int set_all);
extern void untouch_options(LIST_OF(struct option) *);
extern void smart_config_string(struct string *, int, int,
LIST_OF(struct option) *, unsigned char *, int,
LIST_OF(struct option) *, char *, int,
void (*)(struct string *, struct option *,
unsigned char *, int, int, int, int));
char *, int, int, int, int));
enum copy_option_flags {
/* Do not create a listbox option for the new option. */
@ -259,7 +259,7 @@ void mark_option_as_deleted(struct option *);
/** Some minimal option cache */
struct option_resolver {
int id;
unsigned char *name;
char *name;
};
/** Update the visibility of the box item of each option
@ -295,14 +295,14 @@ extern void checkout_option_values(struct option_resolver *resolvers,
* use get_opt_type() and add_opt_type(). For command line options, you want to
* use get_opt_type_tree(cmdline_options, "option", NULL). */
extern struct option *get_opt_rec(struct option *, const unsigned char *);
extern struct option *get_opt_rec_real(struct option *, const unsigned char *);
extern struct option *get_opt_rec(struct option *, const char *);
extern struct option *get_opt_rec_real(struct option *, const char *);
struct option *indirect_option(struct option *);
#ifdef CONFIG_DEBUG
extern union option_value *get_opt_(unsigned char *, int, enum option_type, struct option *, unsigned char *, struct session *);
extern union option_value *get_opt_(char *, int, enum option_type, struct option *, char *, struct session *);
#define get_opt(tree, name, ses, type) get_opt_(__FILE__, __LINE__, type, tree, name, ses)
#else
extern union option_value *get_opt_(struct option *, unsigned char *, struct session *);
extern union option_value *get_opt_(struct option *, char *, struct session *);
#define get_opt(tree, name, ses, type) get_opt_(tree, name, ses)
#endif
@ -330,9 +330,9 @@ extern union option_value *get_opt_(struct option *, unsigned char *, struct ses
#define get_cmd_opt_color(name) get_opt_color_tree(cmdline_options, name, NULL)
#define get_cmd_opt_tree(name) get_opt_tree_tree(cmdline_options, name, NULL)
extern struct option *add_opt(struct option *, unsigned char *, unsigned char *,
unsigned char *, enum option_flags, enum option_type,
long, long, longptr_T, unsigned char *);
extern struct option *add_opt(struct option *, char *, char *,
char *, enum option_flags, enum option_type,
long, long, longptr_T, char *);
/** Check whether the character @a c may be used in the name of an
* option. This does not allow the '.' used in multi-part names like
@ -350,7 +350,7 @@ extern struct option *add_opt(struct option *, unsigned char *, unsigned char *,
#ifndef CONFIG_SMALL
#define DESC(x) (x)
#else
#define DESC(x) ((unsigned char *) "")
#define DESC(x) ((char *) "")
#endif
@ -369,7 +369,7 @@ extern struct option *add_opt(struct option *, unsigned char *, unsigned char *,
/*! @relates option */
#define add_opt_str_tree(tree, path, capt, name, flags, def, desc) \
do { \
unsigned char *ptr = mem_alloc(MAX_STR_LEN); \
char *ptr = mem_alloc(MAX_STR_LEN); \
safe_strncpy(ptr, def, MAX_STR_LEN); \
add_opt(tree, path, capt, name, flags, OPT_STRING, 0, MAX_STR_LEN, (longptr_T) ptr, DESC(desc)); \
} while (0)
@ -409,18 +409,18 @@ do { \
struct option_init {
/** The name of the option tree where the option should be
* registered. option.root is computed from this. */
unsigned char *path;
char *path;
/** The name of the option. This goes to option.name. */
unsigned char *name;
char *name;
/** The caption shown in the option manager. This goes to
* option.capt. */
unsigned char *capt;
char *capt;
/** The long description shown when the user edits the option,
* or NULL if not available. This goes to option.desc. */
unsigned char *desc;
char *desc;
/** Flags for the option. These go to option.flags. */
enum option_flags flags;

View File

@ -29,10 +29,10 @@
* since you will parse the commandline _TWO TIMES_! Remember! :-) */
int commandline = 0;
static unsigned char *
gen_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
gen_cmd(struct option *o, char ***argv, int *argc)
{
unsigned char *str;
char *str;
int dummy_line = 0;
if (!*argc) return gettext("Parameter expected");
@ -56,8 +56,8 @@ gen_cmd(struct option *o, unsigned char ***argv, int *argc)
/* If 0 follows, disable option and eat 0. If 1 follows, enable option and
* eat 1. If anything else follow, enable option and don't eat anything. */
static unsigned char *
bool_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
bool_cmd(struct option *o, char ***argv, int *argc)
{
o->value.number = 1;
@ -77,8 +77,8 @@ bool_cmd(struct option *o, unsigned char ***argv, int *argc)
return NULL;
}
static unsigned char *
exec_cmd(struct option *o, unsigned char ***argv, int *argc)
static char *
exec_cmd(struct option *o, char ***argv, int *argc)
{
return o->value.command(o, argv, argc);
}
@ -90,11 +90,11 @@ exec_cmd(struct option *o, unsigned char ***argv, int *argc)
* possibly changing ptr to structure containing target name and pointer to
* options list? --pasky */
static unsigned char *
redir_cmd(struct option *opt, unsigned char ***argv, int *argc)
static char *
redir_cmd(struct option *opt, char ***argv, int *argc)
{
struct option *real = get_opt_rec(config_options, opt->value.string);
unsigned char * ret = NULL;
char * ret = NULL;
assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string);
if_assert_failed { return ret; }
@ -109,11 +109,11 @@ redir_cmd(struct option *opt, unsigned char ***argv, int *argc)
return ret;
}
static unsigned char *
redir_rd(struct option *opt, unsigned char **file, int *line)
static char *
redir_rd(struct option *opt, char **file, int *line)
{
struct option *real = get_opt_rec(config_options, opt->value.string);
unsigned char *ret = NULL;
char *ret = NULL;
assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string);
if_assert_failed { return ret; }
@ -141,7 +141,7 @@ redir_wr(struct option *opt, struct string *string)
}
static int
redir_set(struct option *opt, unsigned char *str)
redir_set(struct option *opt, char *str)
{
struct option *real = get_opt_rec(config_options, opt->value.string);
int ret = 0;
@ -154,7 +154,7 @@ redir_set(struct option *opt, unsigned char *str)
if ((opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
negated = !*(long *) str;
str = (unsigned char *) &negated;
str = (char *) &negated;
}
ret = option_types[real->type].set(real, str);
}
@ -163,7 +163,7 @@ redir_set(struct option *opt, unsigned char *str)
}
static int
redir_eq(struct option *opt, const unsigned char *str)
redir_eq(struct option *opt, const char *str)
{
struct option *real = get_opt_rec(config_options, opt->value.string);
int ret = 0;
@ -176,7 +176,7 @@ redir_eq(struct option *opt, const unsigned char *str)
if ((opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
negated = !*(const long *) str;
str = (unsigned char *) &negated;
str = (char *) &negated;
}
ret = option_types[real->type].equals(real, str);
}
@ -189,7 +189,7 @@ redir_eq(struct option *opt, const unsigned char *str)
/* Support functions for config file parsing. */
static void
add_optstring_to_string(struct string *s, const unsigned char *q, int qlen)
add_optstring_to_string(struct string *s, const char *q, int qlen)
{
if (!commandline) add_char_to_string(s, '"');
add_quoted_to_string(s, q, qlen);
@ -198,10 +198,10 @@ add_optstring_to_string(struct string *s, const unsigned char *q, int qlen)
/* Config file handlers. */
static unsigned char *
num_rd(struct option *opt, unsigned char **file, int *line)
static char *
num_rd(struct option *opt, char **file, int *line)
{
unsigned char *end = *file;
char *end = *file;
long *value = mem_alloc(sizeof(*value));
if (!value) return NULL;
@ -219,11 +219,11 @@ num_rd(struct option *opt, unsigned char **file, int *line)
return NULL;
}
return (unsigned char *) value;
return (char *) value;
}
static int
num_set(struct option *opt, unsigned char *str)
num_set(struct option *opt, char *str)
{
/* In num_rd(), num_set(), and num_eq(), str always points
* to a long, even though these functions are only used for
@ -235,7 +235,7 @@ num_set(struct option *opt, unsigned char *str)
}
static int
num_eq(struct option *opt, const unsigned char *str)
num_eq(struct option *opt, const char *str)
{
return str && opt->value.number == *(const long *) str;
}
@ -248,14 +248,14 @@ num_wr(struct option *option, struct string *string)
static int
long_set(struct option *opt, unsigned char *str)
long_set(struct option *opt, char *str)
{
opt->value.big_number = *((long *) str);
return 1;
}
static int
long_eq(struct option *opt, const unsigned char *str)
long_eq(struct option *opt, const char *str)
{
return str && opt->value.big_number == *(const long *) str;
}
@ -266,10 +266,10 @@ long_wr(struct option *option, struct string *string)
add_knum_to_string(string, option->value.big_number);
}
static unsigned char *
str_rd(struct option *opt, unsigned char **file, int *line)
static char *
str_rd(struct option *opt, char **file, int *line)
{
unsigned char *str = *file;
char *str = *file;
struct string str2;
if (!init_string(&str2)) return NULL;
@ -321,7 +321,7 @@ str_rd(struct option *opt, unsigned char **file, int *line)
}
static int
str_set(struct option *opt, unsigned char *str)
str_set(struct option *opt, char *str)
{
assert(opt->value.string);
@ -330,7 +330,7 @@ str_set(struct option *opt, unsigned char *str)
}
static int
str_eq(struct option *opt, const unsigned char *str)
str_eq(struct option *opt, const char *str)
{
return str && strcmp(opt->value.string, str) == 0;
}
@ -347,7 +347,7 @@ str_wr(struct option *o, struct string *s)
static void
str_dup(struct option *opt, struct option *template_, int flags)
{
unsigned char *new_ = mem_alloc(MAX_STR_LEN);
char *new_ = mem_alloc(MAX_STR_LEN);
if (new_) safe_strncpy(new_, template_->value.string, MAX_STR_LEN);
opt->value.string = new_;
@ -355,7 +355,7 @@ str_dup(struct option *opt, struct option *template_, int flags)
static int
cp_set(struct option *opt, unsigned char *str)
cp_set(struct option *opt, char *str)
{
int ret = get_cp_index(str);
@ -366,7 +366,7 @@ cp_set(struct option *opt, unsigned char *str)
}
static int
cp_eq(struct option *opt, const unsigned char *str)
cp_eq(struct option *opt, const char *str)
{
return str && get_cp_index(str) == opt->value.number;
}
@ -374,14 +374,14 @@ cp_eq(struct option *opt, const unsigned char *str)
static void
cp_wr(struct option *o, struct string *s)
{
unsigned char *mime_name = get_cp_config_name(o->value.number);
char *mime_name = get_cp_config_name(o->value.number);
add_optstring_to_string(s, mime_name, strlen(mime_name));
}
static int
lang_set(struct option *opt, unsigned char *str)
lang_set(struct option *opt, char *str)
{
#ifdef CONFIG_NLS
opt->value.number = name_to_language(str);
@ -391,7 +391,7 @@ lang_set(struct option *opt, unsigned char *str)
}
static int
lang_eq(struct option *opt, const unsigned char *str)
lang_eq(struct option *opt, const char *str)
{
#ifdef CONFIG_NLS
return str && name_to_language(str) == opt->value.number;
@ -403,7 +403,7 @@ lang_eq(struct option *opt, const unsigned char *str)
static void
lang_wr(struct option *o, struct string *s)
{
unsigned char *lang;
char *lang;
#ifdef CONFIG_NLS
lang = language_to_name(current_language);
@ -416,13 +416,13 @@ lang_wr(struct option *o, struct string *s)
static int
color_set(struct option *opt, unsigned char *str)
color_set(struct option *opt, char *str)
{
return !decode_color(str, strlen(str), &opt->value.color);
}
static int
color_eq(struct option *opt, const unsigned char *str)
color_eq(struct option *opt, const char *str)
{
color_T color;
@ -434,8 +434,8 @@ static void
color_wr(struct option *opt, struct string *str)
{
color_T color = opt->value.color;
unsigned char hexcolor[8];
const unsigned char *strcolor = get_color_string(color, hexcolor);
char hexcolor[8];
const char *strcolor = get_color_string(color, hexcolor);
add_optstring_to_string(str, strcolor, strlen(strcolor));
}
@ -502,7 +502,7 @@ const struct option_type_info option_types[] = {
{ N_("Folder"), NULL, NULL, NULL, tree_dup, NULL, NULL, "" },
};
unsigned char *
char *
get_option_type_name(enum option_type type)
{
assert(type >= 0 && type < sizeof(option_types)/sizeof(struct option_type_info));

View File

@ -9,14 +9,14 @@ extern "C" {
#endif
struct option_type_info {
unsigned char *name;
unsigned char *(*cmdline)(struct option *, unsigned char ***, int *);
unsigned char *(*read)(struct option *, unsigned char **, int *);
char *name;
char *(*cmdline)(struct option *, char ***, int *);
char *(*read)(struct option *, char **, int *);
void (*write)(struct option *, struct string *);
void (*dup)(struct option *, struct option *, int);
int (*set)(struct option *, unsigned char *);
int (*equals)(struct option *, const unsigned char *);
unsigned char *help_str;
int (*set)(struct option *, char *);
int (*equals)(struct option *, const char *);
char *help_str;
};
/* enum option_type is index in this array */
@ -24,7 +24,7 @@ extern const struct option_type_info option_types[];
extern int commandline;
unsigned char *get_option_type_name(enum option_type type);
char *get_option_type_name(enum option_type type);
#ifdef __cplusplus
}

View File

@ -57,7 +57,7 @@ static INIT_LIST_OF(struct cookie, cookies);
struct c_domain {
LIST_HEAD(struct c_domain);
unsigned char domain[1]; /* Must be at end of struct. */
char domain[1]; /* Must be at end of struct. */
};
/* List of domains for which there may be cookies. This supposedly
@ -137,7 +137,7 @@ static union option_info cookies_options[] = {
#define get_cookies_resave() get_opt_cookies(COOKIES_RESAVE).number
struct cookie_server *
get_cookie_server(unsigned char *host, int hostlen)
get_cookie_server(char *host, int hostlen)
{
struct cookie_server *sort_spot = NULL;
struct cookie_server *cs;
@ -226,7 +226,7 @@ delete_cookie(struct cookie *c)
/* Check whether cookie's domain matches server.
* It returns 1 if ok, 0 else. */
static int
is_domain_security_ok(unsigned char *domain, unsigned char *server, int server_len)
is_domain_security_ok(char *domain, char *server, int server_len)
{
int i;
int domain_len;
@ -301,7 +301,7 @@ is_domain_security_ok(unsigned char *domain, unsigned char *server, int server_l
* although you may also want to set the remaining members and check
* @get_cookies_accept_policy and @is_domain_security_ok.
*
* The unsigned char * arguments must be allocated with @mem_alloc or
* The char * arguments must be allocated with @mem_alloc or
* equivalent, because @done_cookie will @mem_free them. Likewise,
* the caller must already have locked @server. If @init_cookie
* fails, then it frees the strings itself, and unlocks @server.
@ -310,8 +310,8 @@ is_domain_security_ok(unsigned char *domain, unsigned char *server, int server_l
* consider that a bug. This means callers can use e.g. @stracpy
* and let @init_cookie check whether the call ran out of memory. */
struct cookie *
init_cookie(unsigned char *name, unsigned char *value,
unsigned char *path, unsigned char *domain,
init_cookie(char *name, char *value,
char *path, char *domain,
struct cookie_server *server)
{
struct cookie *cookie = mem_calloc(1, sizeof(*cookie));
@ -337,9 +337,9 @@ init_cookie(unsigned char *name, unsigned char *value,
}
void
set_cookie(struct uri *uri, unsigned char *str)
set_cookie(struct uri *uri, char *str)
{
unsigned char *path, *domain;
char *path, *domain;
struct cookie *cookie;
struct cookie_str cstr;
int max_age;
@ -354,7 +354,7 @@ set_cookie(struct uri *uri, unsigned char *str)
if (!parse_cookie_str(&cstr, str)) return;
switch (parse_header_param(str, "path", &path, 0)) {
unsigned char *path_end;
char *path_end;
case HEADER_PARAM_FOUND:
if (!path[0])
@ -421,7 +421,7 @@ set_cookie(struct uri *uri, unsigned char *str)
max_age = get_cookies_max_age();
if (max_age) {
unsigned char *date;
char *date;
time_t expires;
switch (parse_header_param(str, "expires", &date, 0)) {
@ -611,7 +611,7 @@ send_cookies_common(struct uri *uri, unsigned int httponly)
{
struct c_domain *cd;
struct cookie *c, *next;
unsigned char *path = NULL;
char *path = NULL;
static struct string header;
time_t now;
@ -693,14 +693,14 @@ load_cookies(void) {
/* Buffer size is set to be enough to read long lines that
* save_cookies may write. 6 is choosen after the fprintf(..) call
* in save_cookies(). --Zas */
unsigned char in_buffer[6 * MAX_STR_LEN];
unsigned char *cookfile = COOKIES_FILENAME;
char in_buffer[6 * MAX_STR_LEN];
char *cookfile = COOKIES_FILENAME;
FILE *fp;
time_t now;
if (elinks_home) {
cookfile = straconcat(elinks_home, cookfile,
(unsigned char *) NULL);
(char *) NULL);
if (!cookfile) return;
}
@ -721,11 +721,11 @@ load_cookies(void) {
now = time(NULL);
while (fgets(in_buffer, 6 * MAX_STR_LEN, fp)) {
struct cookie *cookie;
unsigned char *p, *q = in_buffer;
char *p, *q = in_buffer;
enum { NAME = 0, VALUE, SERVER, PATH, DOMAIN, EXPIRES, SECURE, HTTPONLY, MEMBERS };
int member;
struct {
unsigned char *pos;
char *pos;
int len;
} members[MEMBERS];
time_t expires;
@ -812,7 +812,7 @@ set_cookies_dirty(void)
void
save_cookies(struct terminal *term) {
struct cookie *c;
unsigned char *cookfile;
char *cookfile;
struct secure_save_info *ssi;
time_t now;
@ -844,7 +844,7 @@ save_cookies(struct terminal *term) {
}
cookfile = straconcat(elinks_home, COOKIES_FILENAME,
(unsigned char *) NULL);
(char *) NULL);
if (!cookfile) {
CANNOT_SAVE_COOKIES(0, N_("Out of memory"));
return;

View File

@ -33,14 +33,14 @@ struct cookie_server {
OBJECT_HEAD(struct cookie_server);
struct listbox_item *box_item;
unsigned char host[1]; /* Must be at end of struct. */
char host[1]; /* Must be at end of struct. */
};
struct cookie {
OBJECT_HEAD(struct cookie);
unsigned char *name, *value;
unsigned char *path, *domain;
char *name, *value;
char *path, *domain;
struct cookie_server *server; /* The host the cookie originated from */
time_t expires; /* Expiration time. Zero means undefined */
@ -50,14 +50,14 @@ struct cookie {
struct listbox_item *box_item;
};
struct cookie_server *get_cookie_server(unsigned char *host, int hostlen);
struct cookie *init_cookie(unsigned char *name, unsigned char *value,
unsigned char *path, unsigned char *domain,
struct cookie_server *get_cookie_server(char *host, int hostlen);
struct cookie *init_cookie(char *name, char *value,
char *path, char *domain,
struct cookie_server *server);
void accept_cookie(struct cookie *);
void done_cookie(struct cookie *);
void delete_cookie(struct cookie *);
void set_cookie(struct uri *, unsigned char *);
void set_cookie(struct uri *, char *);
void load_cookies(void);
void save_cookies(struct terminal *);
void set_cookies_dirty(void);

View File

@ -138,7 +138,7 @@ is_cookie_used(struct listbox_item *item)
return is_object_used((struct cookie *) item->udata);
}
static unsigned char *
static char *
get_cookie_text(struct listbox_item *item, struct terminal *term)
{
/* Are we dealing with a folder? */
@ -154,7 +154,7 @@ get_cookie_text(struct listbox_item *item, struct terminal *term)
}
}
static unsigned char *
static char *
get_cookie_info(struct listbox_item *item, struct terminal *term)
{
struct cookie *cookie = item->udata;
@ -259,7 +259,7 @@ static widget_handler_status_T
set_cookie_name(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct cookie *cookie = dlg_data->dlg->udata;
unsigned char *value = widget_data->cdata;
char *value = widget_data->cdata;
if (!value || !cookie) return EVENT_NOT_PROCESSED;
mem_free_set(&cookie->name, stracpy(value));
@ -271,7 +271,7 @@ static widget_handler_status_T
set_cookie_value(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct cookie *cookie = dlg_data->dlg->udata;
unsigned char *value = widget_data->cdata;
char *value = widget_data->cdata;
if (!value || !cookie) return EVENT_NOT_PROCESSED;
mem_free_set(&cookie->value, stracpy(value));
@ -283,7 +283,7 @@ static widget_handler_status_T
set_cookie_domain(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct cookie *cookie = dlg_data->dlg->udata;
unsigned char *value = widget_data->cdata;
char *value = widget_data->cdata;
if (!value || !cookie) return EVENT_NOT_PROCESSED;
mem_free_set(&cookie->domain, stracpy(value));
@ -295,8 +295,8 @@ static widget_handler_status_T
set_cookie_expires(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct cookie *cookie = dlg_data->dlg->udata;
unsigned char *value = widget_data->cdata;
unsigned char *end;
char *value = widget_data->cdata;
char *end;
if (!value || !cookie) return EVENT_NOT_PROCESSED;
#ifdef HAVE_STRPTIME
@ -324,8 +324,8 @@ static widget_handler_status_T
set_cookie_secure(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct cookie *cookie = dlg_data->dlg->udata;
unsigned char *value = widget_data->cdata;
unsigned char *end;
char *value = widget_data->cdata;
char *end;
long number;
if (!value || !cookie) return EVENT_NOT_PROCESSED;
@ -343,8 +343,8 @@ static widget_handler_status_T
set_cookie_httponly(struct dialog_data *dlg_data, struct widget_data *widget_data)
{
struct cookie *cookie = dlg_data->dlg->udata;
unsigned char *value = widget_data->cdata;
unsigned char *end;
char *value = widget_data->cdata;
char *end;
long number;
if (!value || !cookie) return EVENT_NOT_PROCESSED;
@ -365,8 +365,8 @@ build_edit_dialog(struct terminal *term, struct cookie *cookie)
#define EDIT_WIDGETS_COUNT 9
/* [gettext_accelerator_context(.build_edit_dialog)] */
struct dialog *dlg;
unsigned char *name, *value, *domain, *expires, *secure, *httponly;
unsigned char *dlg_server;
char *name, *value, *domain, *expires, *secure, *httponly;
char *dlg_server;
int length = 0;
dlg = calloc_dialog(EDIT_WIDGETS_COUNT, MAX_STR_LEN * 6);
@ -405,7 +405,7 @@ build_edit_dialog(struct terminal *term, struct cookie *cookie)
dlg_server = cookie->server->host;
dlg_server = straconcat(_("Server", term), ": ", dlg_server, "\n",
(unsigned char *) NULL);
(char *) NULL);
if (!dlg_server) {
mem_free(dlg);
@ -483,7 +483,7 @@ push_add_button(struct dialog_data *dlg_data, struct widget_data *button)
static void
add_server_do(void *data)
{
unsigned char *value = data;
char *value = data;
struct cookie *dummy_cookie;
if (!value) return;
@ -505,8 +505,8 @@ push_add_server_button(struct dialog_data *dlg_data, struct widget_data *button)
#define SERVER_WIDGETS_COUNT 3
struct terminal *term = dlg_data->win->term;
struct dialog *dlg;
unsigned char *name;
unsigned char *text;
char *name;
char *text;
dlg = calloc_dialog(SERVER_WIDGETS_COUNT, MAX_STR_LEN);
if (!dlg) return EVENT_NOT_PROCESSED;

View File

@ -17,7 +17,7 @@
#if 0
static inline void
debug_cookie_parser(struct cookie_str *cstr, unsigned char *pos, int ws, int eq)
debug_cookie_parser(struct cookie_str *cstr, char *pos, int ws, int eq)
{
int namelen = int_max(cstr->nam_end - cstr->str, 0);
int valuelen = int_max(cstr->val_end - cstr->val_start, 0);
@ -39,7 +39,7 @@ debug_cookie_parser(struct cookie_str *cstr, unsigned char *pos, int ws, int eq)
/* Defined in RFC 2965. */
/* Return cstr on success, NULL on failure. */
struct cookie_str *
parse_cookie_str(struct cookie_str *cstr, unsigned char *str)
parse_cookie_str(struct cookie_str *cstr, char *str)
{
memset(cstr, 0, sizeof(*cstr));
cstr->str = str;

View File

@ -6,11 +6,11 @@ extern "C" {
#endif
struct cookie_str {
unsigned char *str;
unsigned char *nam_end, *val_start, *val_end;
char *str;
char *nam_end, *val_start, *val_end;
};
struct cookie_str *parse_cookie_str(struct cookie_str *cstr, unsigned char *str);
struct cookie_str *parse_cookie_str(struct cookie_str *cstr, char *str);
#ifdef __cplusplus
}

View File

@ -15,7 +15,7 @@ int
main(int argc, char *argv[])
{
struct cookie_str cstr;
unsigned char name[1024], value[1024], string[1024];
char name[1024], value[1024], string[1024];
printf("This thing is for testing of cookies name-value pair parser.\n"
"You probably do not want to mess with it :).\n");

View File

@ -4,7 +4,7 @@
#include "cookies/path.h"
int
is_path_prefix(unsigned char *cookiepath, unsigned char *requestpath)
is_path_prefix(char *cookiepath, char *requestpath)
{
int dl = strlen(cookiepath);

View File

@ -5,7 +5,7 @@
extern "C" {
#endif
int is_path_prefix(unsigned char *d, unsigned char *s);
int is_path_prefix(char *d, char *s);
#ifdef __cplusplus
}

View File

@ -33,7 +33,7 @@
#include "viewer/text/view.h"
void
nowhere_box(struct terminal *term, unsigned char *title)
nowhere_box(struct terminal *term, char *title)
{
assert(term);
if_assert_failed return;
@ -50,7 +50,7 @@ add_link_info_to_string(struct string *msg, struct session *ses)
{
struct document_view *doc_view = current_frame(ses);
struct terminal *term = ses->tab->term;
unsigned char *a;
char *a;
struct link *link;
if (!doc_view) return;
@ -92,7 +92,7 @@ add_link_info_to_string(struct string *msg, struct session *ses)
#ifdef CONFIG_GLOBHIST
historyitem = get_global_history_item(link->where);
if (historyitem) {
unsigned char *last_visit;
char *last_visit;
last_visit = ctime(&historyitem->last_visit);
@ -170,7 +170,7 @@ document_info_dialog(struct session *ses)
if (doc_view && doc_view->document->cached) {
struct cache_entry *cached = doc_view->document->cached;
unsigned char *a;
char *a;
add_format_to_string(&msg, "\n%s: %" OFF_PRINT_FORMAT,
_("Size", term),
@ -234,7 +234,7 @@ document_info_dialog(struct session *ses)
#ifdef CONFIG_GLOBHIST
{
unsigned char *last_visit = NULL;
char *last_visit = NULL;
struct global_history_item *historyitem;
add_format_to_string(&msg, "\n%s: ",
@ -272,8 +272,8 @@ void
cached_header_dialog(struct session *ses, struct cache_entry *cached)
{
int msgbox_flags = 0;
unsigned char *title = N_("Header info");
unsigned char *headers = NULL;
char *title = N_("Header info");
char *headers = NULL;
int i = 0, j = 0;
if (!cached || !cached->head || !*cached->head)

View File

@ -7,7 +7,7 @@
extern "C" {
#endif
void nowhere_box(struct terminal *term, unsigned char *title);
void nowhere_box(struct terminal *term, char *title);
void link_info_dialog(struct session *ses);
void document_info_dialog(struct session *);
void cached_header_dialog(struct session *ses, struct cache_entry *cached);

View File

@ -133,10 +133,10 @@ download_dialog_layouter(struct dialog_data *dlg_data)
int rw = w;
int x, y = 0;
int url_len;
unsigned char *url;
char *url;
struct download *download = &file_download->download;
struct color_pair *dialog_text_color = get_bfu_color(term, "dialog.text");
unsigned char *msg = get_download_msg(download, term, 1, 1, "\n");
char *msg = get_download_msg(download, term, 1, 1, "\n");
int show_meter = (download_is_progressing(download)
&& download->progress->size >= 0);
#ifdef CONFIG_BITTORRENT
@ -306,11 +306,11 @@ is_file_download_used(struct listbox_item *item)
return is_object_used((struct file_download *) item->udata);
}
static unsigned char *
static char *
get_file_download_text(struct listbox_item *item, struct terminal *term)
{
struct file_download *file_download = item->udata;
unsigned char *uristring;
char *uristring;
uristring = get_uri_string(file_download->uri, URI_PUBLIC);
if (uristring) {
@ -325,7 +325,7 @@ get_file_download_text(struct listbox_item *item, struct terminal *term)
return uristring;
}
static unsigned char *
static char *
get_file_download_info(struct listbox_item *item, struct terminal *term)
{
return NULL;
@ -377,9 +377,9 @@ draw_file_download(struct listbox_item *item, struct listbox_context *context,
{
struct file_download *file_download = item->udata;
struct download *download = &file_download->download;
unsigned char *stylename;
char *stylename;
struct color_pair *color;
unsigned char *text;
char *text;
int length;
int trimmedlen;
int meter = DOWNLOAD_METER_WIDTH;

View File

@ -39,9 +39,9 @@ my_cancel_dialog(struct dialog_data *dlg_data, struct widget_data *widget_data)
/* TODO: In bookmark/dialogs.c most users seem to want also the dialog_data
* so we should make when_*() functions take dialog_data instead. --jonas */
void
do_edit_dialog(struct terminal *term, int intl, unsigned char *title,
const unsigned char *src_name,
const unsigned char *src_url,
do_edit_dialog(struct terminal *term, int intl, char *title,
const char *src_name,
const char *src_url,
struct session *ses, struct dialog_data *parent,
done_handler_T *when_done,
void when_cancel(struct dialog *),
@ -49,7 +49,7 @@ do_edit_dialog(struct terminal *term, int intl, unsigned char *title,
enum edit_dialog_type dialog_type)
{
/* [gettext_accelerator_context(do_edit_dialog)] */
unsigned char *name, *url;
char *name, *url;
struct dialog *dlg;
if (intl) title = _(title, term);

View File

@ -14,8 +14,8 @@ enum edit_dialog_type {
EDIT_DLG_ADD /* edit/add dialog */
};
void do_edit_dialog(struct terminal *, int, unsigned char *,
const unsigned char *, const unsigned char *,
void do_edit_dialog(struct terminal *, int, char *,
const char *, const char *,
struct session *, struct dialog_data *,
done_handler_T *when_done,
void when_cancel(struct dialog *),

View File

@ -35,11 +35,11 @@
static INIT_INPUT_HISTORY(exmode_history);
typedef int (*exmode_handler_T)(struct session *, unsigned char *, unsigned char *);
typedef int (*exmode_handler_T)(struct session *, char *, char *);
static int
exmode_action_handler(struct session *ses, unsigned char *command,
unsigned char *args)
exmode_action_handler(struct session *ses, char *command,
char *args)
{
enum main_action action_id = get_action_from_string(KEYMAP_MAIN, command);
@ -60,8 +60,8 @@ exmode_action_handler(struct session *ses, unsigned char *command,
}
static int
exmode_confcmd_handler(struct session *ses, unsigned char *command,
unsigned char *args)
exmode_confcmd_handler(struct session *ses, char *command,
char *args)
{
enum parse_error err;
@ -84,14 +84,14 @@ static const exmode_handler_T exmode_handlers[] = {
};
static void
exmode_exec(struct session *ses, unsigned char buffer[INPUT_LINE_BUFFER_SIZE])
exmode_exec(struct session *ses, char buffer[INPUT_LINE_BUFFER_SIZE])
{
/* First look it up as action, then try it as an event (but the event
* part should be thought out somehow yet, I s'pose... let's leave it
* off for now). Then try to evaluate it as configfile command. Then at
* least pop up an error. */
unsigned char *command = buffer;
unsigned char *args = command;
char *command = buffer;
char *args = command;
int i;
while (*command == ':') command++;

View File

@ -154,7 +154,7 @@ menu_copying(struct terminal *term, void *xxx, void *xxxx)
}
static unsigned char *
static char *
get_resource_info(struct terminal *term, void *data)
{
struct string info;

View File

@ -52,7 +52,7 @@
static void
menu_url_shortcut(struct terminal *term, void *url_, void *ses_)
{
unsigned char *url = url_;
char *url = url_;
struct session *ses = ses_;
struct uri *uri = get_uri(url, 0);
@ -62,7 +62,7 @@ menu_url_shortcut(struct terminal *term, void *url_, void *ses_)
}
static void
save_url(struct session *ses, unsigned char *url)
save_url(struct session *ses, char *url)
{
struct document_view *doc_view;
struct uri *uri;
@ -97,7 +97,7 @@ save_url_as(struct session *ses)
N_("Save URL"), N_("Enter URL"),
ses, &goto_url_history,
MAX_STR_LEN, "", 0, 0, NULL,
(void (*)(void *, unsigned char *)) save_url,
(void (*)(void *, char *)) save_url,
NULL);
}
@ -180,7 +180,7 @@ history_menu_common(struct terminal *term, struct session *ses, int unhist)
for (loc = unhist ? cur_loc(ses)->next : cur_loc(ses)->prev;
loc != (struct location *) &ses->history.history;
loc = unhist ? loc->next : loc->prev) {
unsigned char *url;
char *url;
if (!mi) {
mi = new_menu(FREE_LIST | FREE_TEXT | NO_INTL);
@ -537,13 +537,13 @@ activate_bfu_technology(struct session *ses, int item)
void
dialog_goto_url(struct session *ses, unsigned char *url)
dialog_goto_url(struct session *ses, char *url)
{
input_dialog(ses->tab->term, NULL,
N_("Go to URL"), N_("Enter URL"),
ses, &goto_url_history,
MAX_STR_LEN, url, 0, 0, NULL,
(void (*)(void *, unsigned char *)) goto_url_with_hook,
(void (*)(void *, char *)) goto_url_with_hook,
NULL);
}
@ -552,7 +552,7 @@ static INIT_INPUT_HISTORY(file_history);
void
query_file(struct session *ses, struct uri *uri, void *data,
void (*std)(void *, unsigned char *),
void (*std)(void *, char *),
void (*cancel)(void *), int interactive)
{
struct string def;
@ -601,7 +601,7 @@ query_file(struct session *ses, struct uri *uri, void *data,
N_("Download"), N_("Save to file"),
data, &file_history,
MAX_STR_LEN, def.source, 0, 0, check_nonempty,
(void (*)(void *, unsigned char *)) std,
(void (*)(void *, char *)) std,
(void (*)(void *)) cancel);
} else {
std(data, def.source);
@ -621,7 +621,7 @@ free_history_lists(void)
static void
add_cmdline_bool_option(struct string *string, unsigned char *name)
add_cmdline_bool_option(struct string *string, char *name)
{
if (!get_cmd_opt_bool(name)) return;
add_to_string(string, " -");
@ -736,7 +736,7 @@ open_in_new_window(struct terminal *term, void *func_, void *ses_)
void
add_new_win_to_menu(struct menu_item **mi, unsigned char *text,
add_new_win_to_menu(struct menu_item **mi, char *text,
struct terminal *term)
{
int c = can_open_in_new(term);
@ -761,7 +761,7 @@ add_new_win_to_menu(struct menu_item **mi, unsigned char *text,
static void
do_pass_uri_to_command(struct terminal *term, void *command_, void *xxx)
{
unsigned char *command = command_;
char *command = command_;
exec_on_terminal(term, command, "", TERM_EXEC_BG);
mem_free(command);
@ -771,8 +771,8 @@ do_pass_uri_to_command(struct terminal *term, void *command_, void *xxx)
* - Support for passing MIME type
* - Merge this function with rewrite_uri(), subst_cmd(), subst_file()
* and subst_url(). */
static unsigned char *
format_command(unsigned char *format, struct uri *uri)
static char *
format_command(char *format, struct uri *uri)
{
struct string string;
@ -792,7 +792,7 @@ format_command(unsigned char *format, struct uri *uri)
switch (*format) {
case 'c':
{
unsigned char *str = struri(uri);
char *str = struri(uri);
int length = get_real_uri_length(uri);
add_shell_quoted_to_string(&string,
@ -856,7 +856,7 @@ pass_uri_to_command(struct session *ses, struct document_view *doc_view,
}
foreach (option, *tree) {
unsigned char *text, *data;
char *text, *data;
if (!strcmp(option->name, "_template_"))
continue;
@ -895,7 +895,7 @@ pass_uri_to_command(struct session *ses, struct document_view *doc_view,
* choose an available accelerator key. */
void
add_uri_command_to_menu(struct menu_item **mi, enum pass_uri_type type,
unsigned char *text)
char *text)
{
LIST_OF(struct option) *tree = get_opt_tree("document.uri_passing",
NULL);
@ -949,7 +949,7 @@ static struct menu_item empty_directory_menu[] = {
static void
complete_file_menu(struct terminal *term, int no_elevator, void *data,
menu_func_T file_func, menu_func_T dir_func,
unsigned char *dirname, unsigned char *filename)
char *dirname, char *filename)
{
struct menu_item *menu = new_menu(FREE_LIST | NO_INTL);
struct directory_entry *entries, *entry;
@ -965,7 +965,7 @@ complete_file_menu(struct terminal *term, int no_elevator, void *data,
}
for (entry = entries; entry->name; entry++) {
unsigned char *text;
char *text;
int is_dir = (*entry->attrib == 'd');
int is_file = (*entry->attrib == '-');
@ -1018,7 +1018,7 @@ complete_file_menu(struct terminal *term, int no_elevator, void *data,
/* Only one entry */
if (direntries + fileentries == 1) {
unsigned char *text = menu[FILE_COMPLETION_MENU_OFFSET].data;
char *text = menu[FILE_COMPLETION_MENU_OFFSET].data;
mem_free(menu);
@ -1047,12 +1047,12 @@ complete_file_menu(struct terminal *term, int no_elevator, void *data,
/* Prepares the launching of the file completion menu by expanding the @path
* and splitting it in directory and file name part. */
void
auto_complete_file(struct terminal *term, int no_elevator, unsigned char *path,
auto_complete_file(struct terminal *term, int no_elevator, char *path,
menu_func_T file_func, menu_func_T dir_func, void *data)
{
struct uri *uri;
unsigned char *dirname;
unsigned char *filename;
char *dirname;
char *filename;
assert(term && data && file_func && dir_func && data);
@ -1093,7 +1093,7 @@ auto_complete_file(struct terminal *term, int no_elevator, unsigned char *path,
/* Make sure the dirname has an ending slash */
if (!dir_sep(path[-1])) {
unsigned char separator = *dirname;
char separator = *dirname;
int dirnamelen = path - dirname;
insert_in_string(&dirname, dirnamelen, &separator, 1);

View File

@ -18,7 +18,7 @@ struct uri;
void activate_bfu_technology(struct session *, int);
void dialog_goto_url(struct session *ses, unsigned char *url);
void dialog_goto_url(struct session *ses, char *url);
/* void dialog_save_url(struct session *ses); */
void tab_menu(struct session *ses, int x, int y,
@ -26,7 +26,7 @@ void tab_menu(struct session *ses, int x, int y,
void free_history_lists(void);
void query_file(struct session *, struct uri *, void *, void (*)(void *, unsigned char *), void (*)(void *), int);
void query_file(struct session *, struct uri *, void *, void (*)(void *, char *), void (*)(void *), int);
void query_exit(struct session *ses);
void exit_prog(struct session *ses, int query);
@ -43,7 +43,7 @@ void send_open_in_new_window(struct terminal *term, const struct open_in_new *op
void open_in_new_window(struct terminal *term, void *func_, void *ses_);
void add_new_win_to_menu(struct menu_item **mi, unsigned char *text, struct terminal *term);
void add_new_win_to_menu(struct menu_item **mi, char *text, struct terminal *term);
/* URI passing: */
@ -54,11 +54,11 @@ enum pass_uri_type {
PASS_URI_TAB,
};
void add_uri_command_to_menu(struct menu_item **mi, enum pass_uri_type type, unsigned char *text);
void add_uri_command_to_menu(struct menu_item **mi, enum pass_uri_type type, char *text);
enum frame_event_status pass_uri_to_command(struct session *ses, struct document_view *doc_view, int /* enum pass_uri_type */ type);
void
auto_complete_file(struct terminal *term, int no_elevator, unsigned char *path,
auto_complete_file(struct terminal *term, int no_elevator, char *path,
menu_func_T file_func, menu_func_T dir_func, void *data);
#ifdef __cplusplus

View File

@ -29,7 +29,7 @@
static void
display_codepage(struct terminal *term, void *name_, void *xxx)
{
unsigned char *name = name_;
char *name = name_;
struct option *opt = get_opt_rec(term->spec, "charset");
int index = get_cp_index(name);
@ -49,14 +49,14 @@ charset_list(struct terminal *term, void *xxx, void *ses_)
struct session *ses = ses_;
int i, items;
int sel = 0;
const unsigned char *const sel_mime = get_cp_mime_name(
const char *const sel_mime = get_cp_mime_name(
get_terminal_codepage(term));
struct menu_item *mi = new_menu(FREE_LIST);
if (!mi) return;
for (i = 0, items = 0; ; i++) {
unsigned char *name = get_cp_name(i);
char *name = get_cp_name(i);
if (!name) break;
@ -168,7 +168,7 @@ terminal_options(struct terminal *term, void *xxx, struct session *ses)
struct dialog *dlg;
union option_value *values;
int anonymous = get_cmd_opt_bool("anonymous");
unsigned char help_text[MAX_STR_LEN], *text;
char help_text[MAX_STR_LEN], *text;
size_t help_textlen = 0;
size_t add_size = TERM_OPTION_VALUE_SIZE;
@ -203,7 +203,7 @@ terminal_options(struct terminal *term, void *xxx, struct session *ses)
dlg->layout.padding_top = 1;
dlg->udata = values;
text = ((unsigned char *) values) + TERM_OPTION_VALUE_SIZE;
text = ((char *) values) + TERM_OPTION_VALUE_SIZE;
memcpy(text, help_text, help_textlen);
add_dlg_text(dlg, text, ALIGN_LEFT, 1);
@ -279,14 +279,14 @@ menu_language_list(struct terminal *term, void *xxx, void *ses)
/* FIXME: This doesn't in fact belong here at all. --pasky */
static unsigned char width_str[4];
static unsigned char height_str[4];
static char width_str[4];
static char height_str[4];
static void
push_resize_button(void *data)
{
struct terminal *term = data;
unsigned char str[MAX_STR_LEN];
char str[MAX_STR_LEN];
snprintf(str, sizeof(str), "%s,%s,%d,%d",
width_str, height_str, term->width, term->height);

View File

@ -16,9 +16,9 @@
#include "util/memory.h"
#include "util/string.h"
static unsigned char *
static char *
get_progress_msg_2(struct progress *progress, struct terminal *term,
int wide, int full, unsigned char *separator, unsigned char *type)
int wide, int full, char *separator, char *type)
{
struct string msg;
int newlines = separator[strlen(separator) - 1] == '\n';
@ -90,16 +90,16 @@ get_progress_msg_2(struct progress *progress, struct terminal *term,
return msg.source;
}
unsigned char *
char *
get_upload_progress_msg(struct progress *progress, struct terminal *term,
int wide, int full, unsigned char *separator)
int wide, int full, char *separator)
{
return get_progress_msg_2(progress, term, wide, full, separator, _("Sent", term));
}
unsigned char *
char *
get_progress_msg(struct progress *progress, struct terminal *term,
int wide, int full, unsigned char *separator)
int wide, int full, char *separator)
{
return get_progress_msg_2(progress, term, wide, full, separator, _("Received", term));
}
@ -107,7 +107,7 @@ get_progress_msg(struct progress *progress, struct terminal *term,
void
draw_progress_bar(struct progress *progress, struct terminal *term,
int x, int y, int width,
unsigned char *text, struct color_pair *meter_color)
char *text, struct color_pair *meter_color)
{
/* Note : values > 100% are theorically possible and were seen. */
int percent = 0;
@ -133,7 +133,7 @@ draw_progress_bar(struct progress *progress, struct terminal *term,
width = int_min(width, strlen(text));
} else if (width > 1) {
static unsigned char s[] = "????"; /* Reduce or enlarge at will. */
static char s[] = "????"; /* Reduce or enlarge at will. */
unsigned int slen = 0;
int max = int_min(sizeof(s), width) - 1;

View File

@ -8,21 +8,21 @@ extern "C" {
struct progress;
struct terminal;
unsigned char *
char *
get_progress_msg(struct progress *progress, struct terminal *term,
int wide, int full, unsigned char *separator);
int wide, int full, char *separator);
unsigned char *
char *
get_upload_progress_msg(struct progress *progress, struct terminal *term,
int wide, int full, unsigned char *separator);
int wide, int full, char *separator);
/* Draws a progress bar meter or progress coloured text depending on whether
* @text is NULL. If @meter_color is NULL dialog.meter color is used. */
void
draw_progress_bar(struct progress *progress, struct terminal *term,
int x, int y, int width,
unsigned char *text, struct color_pair *meter_color);
char *text, struct color_pair *meter_color);
#ifdef __cplusplus
}

View File

@ -41,9 +41,9 @@
#include "viewer/text/view.h"
unsigned char *
char *
get_download_msg(struct download *download, struct terminal *term,
int wide, int full, unsigned char *separator)
int wide, int full, char *separator)
{
if (!download_is_progressing(download)) {
/* DBG("%d -> %s", download->state, _(get_err_msg(download->state), term)); */
@ -142,11 +142,11 @@ update_status(void)
}
}
static unsigned char *
static char *
get_current_link_info_and_title(struct session *ses,
struct document_view *doc_view)
{
unsigned char *link_info, *link_title, *ret = NULL;
char *link_info, *link_title, *ret = NULL;
link_info = get_current_link_info(ses, doc_view);
if (!link_info) return NULL;
@ -156,7 +156,7 @@ get_current_link_info_and_title(struct session *ses,
assert(*link_title);
ret = straconcat(link_info, " - ", link_title,
(unsigned char *) NULL);
(char *) NULL);
mem_free(link_info);
mem_free(link_title);
}
@ -169,7 +169,7 @@ get_current_link_info_and_title(struct session *ses,
static inline void
display_status_bar(struct session *ses, struct terminal *term, int tabs_count)
{
unsigned char *msg = NULL;
char *msg = NULL;
unsigned int tab_info_len = 0;
struct download *download = get_current_download(ses);
struct session_status *status = &ses->status;
@ -245,7 +245,7 @@ display_status_bar(struct session *ses, struct terminal *term, int tabs_count)
draw_box(term, &box, ' ', 0, get_bfu_color(term, "status.status-bar"));
if (!status->show_tabs_bar && tabs_count > 1) {
unsigned char tab_info[8];
char tab_info[8];
tab_info[tab_info_len++] = '[';
ulongcat(tab_info, &tab_info_len, term->current_tab + 1, 4, 0);
@ -312,7 +312,7 @@ display_tab_bar(struct session *ses, struct terminal *term, int tabs_count)
struct document_view *doc_view;
struct session *tab_ses = tab->data;
int actual_tab_width = tab_width - 1;
unsigned char *msg;
char *msg;
/* Adjust tab size to use full term width. */
if (tab_remain_width) {
@ -398,7 +398,7 @@ display_title_bar(struct session *ses, struct terminal *term)
struct document_view *doc_view;
struct document *document;
struct string title;
unsigned char buf[40];
char buf[40];
int buflen = 0;
int height;
@ -486,8 +486,8 @@ display_window_title(struct session *ses, struct terminal *term)
{
static struct session *last_ses;
struct session_status *status = &ses->status;
unsigned char *doc_title = NULL;
unsigned char *title;
char *doc_title = NULL;
char *title;
int titlelen;
if (ses->doc_view
@ -497,7 +497,7 @@ display_window_title(struct session *ses, struct terminal *term)
doc_title = ses->doc_view->document->title;
title = doc_title ? straconcat(doc_title, " - ELinks",
(unsigned char *) NULL)
(char *) NULL)
: stracpy("ELinks");
if (!title) return;

View File

@ -13,9 +13,9 @@ void print_screen_status(struct session *);
void update_status(void);
unsigned char *
char *
get_download_msg(struct download *download, struct terminal *term,
int wide, int full, unsigned char *separator);
int wide, int full, char *separator);
#ifdef __cplusplus
}

View File

@ -235,10 +235,10 @@ examine_element(struct html_context *html_context, struct css_selector *base,
}
if (element->attr.class_ && seltype <= CST_CLASS) {
const unsigned char *class_ = element->attr.class_;
const char *class_ = element->attr.class_;
for (;;) {
const unsigned char *begin;
const char *begin;
while (*class_ == ' ') ++class_;
if (*class_ == '\0') break;
@ -266,7 +266,7 @@ get_css_selector_for_element(struct html_context *html_context,
struct css_stylesheet *css,
LIST_OF(struct html_element) *html_stack)
{
unsigned char *code;
char *code;
struct css_selector *selector;
assert(element && element->options && css);

View File

@ -84,14 +84,14 @@ union option_info css_options_info[] = {
*
* @return nonzero if the media type is supported, 0 if not. */
int
supports_css_media_type(const unsigned char *optstr,
const unsigned char *token, size_t token_length)
supports_css_media_type(const char *optstr,
const char *token, size_t token_length)
{
/* Split @optstr into comma-delimited strings, strip leading
* and trailing spaces from each, and compare them to the
* token. */
while (*optstr != '\0') {
const unsigned char *beg, *end;
const char *beg, *end;
while (*optstr == ' ')
++optstr;
@ -142,7 +142,7 @@ import_css(struct css_stylesheet *css, struct uri *uri)
fragment = get_cache_fragment(cached);
if (fragment) {
unsigned char *end = fragment->data + fragment->length;
char *end = fragment->data + fragment->length;
css->import_level++;
css_parse_stylesheet(css, uri, fragment->data, end);
@ -153,7 +153,7 @@ import_css(struct css_stylesheet *css, struct uri *uri)
static void
import_css_file(struct css_stylesheet *css, struct uri *base_uri,
const unsigned char *url, int urllen)
const char *url, int urllen)
{
struct string string, filename;
@ -169,7 +169,7 @@ import_css_file(struct css_stylesheet *css, struct uri *base_uri,
add_bytes_to_string(&filename, url, urllen);
if (is_in_state(read_encoded_file(&filename, &string), S_OK)) {
unsigned char *end = string.source + string.length;
char *end = string.source + string.length;
css->import_level++;
css_parse_stylesheet(css, base_uri, string.source, end);
@ -185,7 +185,7 @@ struct css_stylesheet default_stylesheet = INIT_CSS_STYLESHEET(default_styleshee
static void
import_default_css(void)
{
unsigned char *url = get_opt_str("document.css.stylesheet", NULL);
char *url = get_opt_str("document.css.stylesheet", NULL);
if (!css_selector_set_empty(&default_stylesheet.selectors))
done_css_stylesheet(&default_stylesheet);

View File

@ -27,8 +27,8 @@ extern struct module css_module;
/** This function will try to import the given @a url from the cache. */
void import_css(struct css_stylesheet *css, struct uri *uri);
int supports_css_media_type(const unsigned char *optstr,
const unsigned char *token, size_t token_length);
int supports_css_media_type(const char *optstr,
const char *token, size_t token_length);
#ifdef __cplusplus
}

View File

@ -137,7 +137,7 @@ css_parse_media_types(struct scanner *scanner)
{
int matched = 0;
int empty = 1;
const unsigned char *const optstr = get_opt_str("document.css.media", NULL);
const char *const optstr = get_opt_str("document.css.media", NULL);
struct scanner_token *token = get_scanner_token(scanner);
while (token && token->type == CSS_TOKEN_IDENT) {
@ -629,7 +629,7 @@ css_parse_ruleset(struct css_stylesheet *css, struct scanner *scanner)
void
css_parse_stylesheet(struct css_stylesheet *css, struct uri *base_uri,
const unsigned char *string, const unsigned char *end)
const char *string, const char *end)
{
struct scanner scanner;

View File

@ -28,7 +28,7 @@ void css_parse_properties(LIST_OF(struct css_property) *props,
* given stylesheet @a css. If the selector is already in the stylesheet it
* properties are added to the that selector. */
void css_parse_stylesheet(struct css_stylesheet *css, struct uri *base_uri,
const unsigned char *string, const unsigned char *end);
const char *string, const char *end);
#ifdef __cplusplus
}

View File

@ -114,7 +114,7 @@ typedef int (*css_property_value_parser_T)(struct css_property_info *propinfo,
/** The struct css_property_info describes what values the properties can
* have and what internal type they have. */
struct css_property_info {
unsigned char *name;
char *name;
enum css_property_type type;
/** This is the storage type, basically describing what to save to

View File

@ -91,7 +91,7 @@ struct scanner_info css_scanner_info = {
scan_css_tokens,
};
#define check_css_table(c, bit) (css_scanner_info.scan_table[(c)] & (bit))
#define check_css_table(c, bit) (css_scanner_info.scan_table[(unsigned char)(c)] & (bit))
#define scan_css(scanner, s, bit) \
while ((s) < (scanner)->end && check_css_table(*(s), bit)) (s)++;
@ -113,7 +113,7 @@ struct scanner_info css_scanner_info = {
&& check_css_precedence(*(s), skipto)) { \
if (isquote(*(s))) { \
int size = (scanner)->end - (s); \
unsigned char *end = memchr(s + 1, *(s), size); \
char *end = memchr(s + 1, *(s), size); \
\
if (end) (s) = end; \
} \
@ -124,7 +124,7 @@ struct scanner_info css_scanner_info = {
static inline void
scan_css_token(struct scanner *scanner, struct scanner_token *token)
{
const unsigned char *string = scanner->position;
const char *string = scanner->position;
unsigned char first_char = *string;
enum css_token_type type = CSS_TOKEN_GARBAGE;
int real_length = -1;
@ -158,7 +158,7 @@ scan_css_token(struct scanner *scanner, struct scanner_token *token)
type = CSS_TOKEN_NUMBER;
} else {
const unsigned char *ident = string;
const char *ident = string;
scan_css(scanner, string, CSS_CHAR_IDENT);
type = map_scanner_string(scanner, ident, string,
@ -169,7 +169,7 @@ scan_css_token(struct scanner *scanner, struct scanner_token *token)
scan_css(scanner, string, CSS_CHAR_IDENT);
if (*string == '(') {
const unsigned char *function_end = string + 1;
const char *function_end = string + 1;
/* Make sure that we have an ending ')' */
skip_css(scanner, function_end, ')');
@ -193,8 +193,8 @@ scan_css_token(struct scanner *scanner, struct scanner_token *token)
* we should of course handle escape
* sequences .. but that will have to
* be fixed later. */
const unsigned char *from = string + 1;
const unsigned char *to = function_end - 1;
const char *from = string + 1;
const char *to = function_end - 1;
scan_css(scanner, from, CSS_CHAR_WHITESPACE);
scan_back_css(scanner, to, CSS_CHAR_WHITESPACE);
@ -258,7 +258,7 @@ scan_css_token(struct scanner *scanner, struct scanner_token *token)
} else if (first_char == '@') {
/* Compose token containing @<ident> */
if (is_css_ident_start(*string)) {
const unsigned char *ident = string;
const char *ident = string;
/* Scan both ident start and ident */
scan_css(scanner, string, CSS_CHAR_IDENT);
@ -302,7 +302,7 @@ scan_css_token(struct scanner *scanner, struct scanner_token *token)
} else if (isquote(first_char)) {
/* TODO: Escaped delimiters --jonas */
int size = scanner->end - string;
unsigned char *string_end = memchr(string, first_char, size);
char *string_end = memchr(string, first_char, size);
if (string_end) {
/* We don't want the delimiters in the token */
@ -320,7 +320,7 @@ scan_css_token(struct scanner *scanner, struct scanner_token *token)
type = CSS_TOKEN_NONE;
} else {
const unsigned char *sgml = string;
const char *sgml = string;
/* Skip anything looking like SGML "<!--" and "-->"
* comments + <![CDATA[ and ]]> notations. */

View File

@ -29,7 +29,7 @@ struct css_selector *
find_css_selector(struct css_selector_set *sels,
enum css_selector_type type,
enum css_selector_relation rel,
const unsigned char *name, int namelen)
const char *name, int namelen)
{
struct css_selector *selector;
@ -50,7 +50,7 @@ struct css_selector *
init_css_selector(struct css_selector_set *sels,
enum css_selector_type type,
enum css_selector_relation relation,
const unsigned char *name, int namelen)
const char *name, int namelen)
{
struct css_selector *selector;
@ -97,7 +97,7 @@ struct css_selector *
get_css_selector(struct css_selector_set *sels,
enum css_selector_type type,
enum css_selector_relation rel,
const unsigned char *name, int namelen)
const char *name, int namelen)
{
struct css_selector *selector = NULL;

View File

@ -96,7 +96,7 @@ struct css_selector {
struct css_selector_set leaves;
enum css_selector_type type;
unsigned char *name;
char *name;
LIST_OF(struct css_property) properties;
};
@ -104,7 +104,7 @@ struct css_selector {
struct css_stylesheet;
typedef void (*css_stylesheet_importer_T)(struct css_stylesheet *, struct uri *,
const unsigned char *url, int urllen);
const char *url, int urllen);
/** The struct css_stylesheet describes all the useful data that was extracted
* from the CSS source. Currently we don't cache anything but the default user
@ -148,7 +148,7 @@ void done_css_stylesheet(struct css_stylesheet *css);
struct css_selector *get_css_selector(struct css_selector_set *set,
enum css_selector_type type,
enum css_selector_relation rel,
const unsigned char *name, int namelen);
const char *name, int namelen);
#define get_css_base_selector(stylesheet, type, rel, name, namelen) \
get_css_selector((stylesheet) ? &(stylesheet)->selectors : NULL, \
@ -159,7 +159,7 @@ struct css_selector *get_css_selector(struct css_selector_set *set,
struct css_selector *find_css_selector(struct css_selector_set *set,
enum css_selector_type type,
enum css_selector_relation rel,
const unsigned char *name, int namelen);
const char *name, int namelen);
#define find_css_base_selector(stylesheet, type, rel, name, namelen) \
find_css_selector(&stylesheet->selectors, rel, type, name, namelen)
@ -169,7 +169,7 @@ struct css_selector *find_css_selector(struct css_selector_set *set,
struct css_selector *init_css_selector(struct css_selector_set *set,
enum css_selector_type type,
enum css_selector_relation relation,
const unsigned char *name, int namelen);
const char *name, int namelen);
/** Add all properties from the list to the given @a selector. */
void add_selector_properties(struct css_selector *selector,

View File

@ -40,7 +40,7 @@ css_parse_color_value(struct css_property_info *propinfo,
/* The first two args are terminated by ',' and the
* last one by ')'. */
unsigned char paskynator = shift ? ',' : ')';
const unsigned char *nstring = token->string;
const char *nstring = token->string;
int part;
/* Are the current and next token valid? */
@ -152,7 +152,7 @@ css_parse_font_weight_value(struct css_property_info *propinfo,
struct scanner *scanner)
{
struct scanner_token *token = get_scanner_token(scanner);
unsigned char *nstring;
char *nstring;
int weight;
assert(propinfo->value_type == CSS_VT_FONT_ATTRIBUTE);

View File

@ -74,10 +74,10 @@ static INIT_LIST_OF(struct document, format_cache);
static void
found_dns(void *data, struct sockaddr_storage *addr, int addrlen)
{
unsigned char buf[64];
const unsigned char *res;
char buf[64];
const char *res;
struct sockaddr *s;
unsigned char **ip = (unsigned char **)data;
char **ip = (char **)data;
void *src;
if (!ip || !addr) return;
@ -265,7 +265,7 @@ release_document(struct document *document)
}
int
find_tag(struct document *document, unsigned char *name, int namelen)
find_tag(struct document *document, char *name, int namelen)
{
struct tag *tag;

View File

@ -64,7 +64,7 @@ struct tag {
LIST_HEAD(struct tag);
int x, y;
unsigned char name[1]; /* must be last of struct. --Zas */
char name[1]; /* must be last of struct. --Zas */
};
@ -92,7 +92,7 @@ struct script_event_hook {
LIST_HEAD(struct script_event_hook);
enum script_event_hook_type type;
unsigned char *src;
char *src;
};
struct link {
@ -100,13 +100,13 @@ struct link {
enum link_type type;
unsigned char *where;
unsigned char *target;
unsigned char *where_img;
char *where;
char *target;
char *where_img;
/** The title of the link. This is in the document charset,
* and entities have already been decoded. */
unsigned char *title;
char *title;
/** The set of characters belonging to this link (their coordinates
* in the document) - each character has own struct point. */
@ -125,7 +125,7 @@ struct link {
LIST_OF(struct script_event_hook) *event_hooks;
union {
unsigned char *name;
char *name;
struct el_form_control *form_control;
} data;
};
@ -225,10 +225,10 @@ struct document {
/* for obtaining IP */
void *querydns;
unsigned char *ip;
char *ip;
/** The title of the document. The charset of this string is
* document.options.cp. */
unsigned char *title;
char *title;
struct cache_entry *cached;
struct frame_desc *frame;
@ -250,7 +250,7 @@ struct document {
struct point *search_points;
#ifdef CONFIG_UTF8
unsigned char buf[7];
char buf[7];
unsigned char buf_length;
#endif
#ifdef CONFIG_COMBINE
@ -321,7 +321,7 @@ extern struct module document_module;
* For now, we only support simple printable character. */
#define accesskey_string_to_unicode(s) (((s)[0] && !(s)[1] && isprint((s)[0])) ? (s)[0] : 0)
int find_tag(struct document *document, unsigned char *name, int namelen);
int find_tag(struct document *document, char *name, int namelen);
#ifdef __cplusplus
}

View File

@ -81,13 +81,13 @@ void
render_dom_document(struct cache_entry *cached, struct document *document,
struct string *buffer)
{
unsigned char *head = empty_string_or_(cached->head);
char *head = empty_string_or_(cached->head);
struct dom_renderer renderer;
struct dom_config config;
struct conv_table *convert_table;
struct sgml_parser *parser;
enum sgml_parser_type parser_type;
unsigned char *string = struri(cached->uri);
char *string = struri(cached->uri);
size_t length = strlen(string);
struct dom_string uri = INIT_DOM_STRING(string, length);

View File

@ -66,7 +66,7 @@ render_rss_item(struct dom_renderer *renderer, struct dom_node *item)
if (title && is_dom_string_set(title)) {
if (item->data.element.type == RSS_ELEMENT_CHANNEL) {
unsigned char *str;
char *str;
str = convert_string(renderer->convert_table,
title->string, title->length,
@ -175,12 +175,12 @@ dom_rss_push_document(struct dom_stack *stack, struct dom_node *root, void *xxx)
static int i_want_struct_module_for_dom;
if (!i_want_struct_module_for_dom) {
static const unsigned char default_colors[] =
static const char default_colors[] =
"title { color: lightgreen } "
"author { color: aqua }"
"author-date-sep{ color: aqua }"
"date { color: aqua }";
unsigned char *styles = (unsigned char *) default_colors;
char *styles = (char *) default_colors;
i_want_struct_module_for_dom = 1;
/* When someone will get here earlier than at 4am,
@ -198,7 +198,7 @@ dom_rss_push_document(struct dom_stack *stack, struct dom_node *root, void *xxx)
for (type = 0; type < RSS_STYLES; type++) {
struct screen_char *template_ = &rss->styles[type];
static const unsigned char *names[RSS_STYLES] =
static const char *names[RSS_STYLES] =
{ "title", "author", "author-date-sep", "date" };
struct css_selector *selector = NULL;

View File

@ -60,7 +60,7 @@ struct source_renderer {
static inline void
render_dom_flush(struct dom_renderer *renderer, unsigned char *string)
render_dom_flush(struct dom_renderer *renderer, char *string)
{
struct source_renderer *data = renderer->data;
struct screen_char *template_ = &data->styles[DOM_NODE_TEXT];
@ -80,7 +80,7 @@ static inline void
render_dom_node_text(struct dom_renderer *renderer, struct screen_char *template_,
struct dom_node *node)
{
unsigned char *string = node->string.string;
char *string = node->string.string;
int length = node->string.length;
if (node->type == DOM_NODE_ENTITY_REFERENCE) {
@ -104,10 +104,10 @@ render_dom_node_enhanced_text(struct dom_renderer *renderer, struct dom_node *no
struct source_renderer *data = renderer->data;
regex_t *regex = &data->url_regex;
regmatch_t regmatch;
unsigned char *string = node->string.string;
char *string = node->string.string;
int length = node->string.length;
struct screen_char *template_ = &data->styles[node->type];
unsigned char *alloc_string;
char *alloc_string;
if (check_dom_node_source(renderer, string, length)) {
render_dom_flush(renderer, string);
@ -188,7 +188,7 @@ render_dom_element_end_source(struct dom_stack *stack, struct dom_node *node, vo
struct dom_stack_state *state = get_dom_stack_top(stack);
struct sgml_parser_state *pstate = get_dom_stack_state_data(stack->contexts[0], state);
struct dom_scanner_token *token = &pstate->end_token;
unsigned char *string = token->string.string;
char *string = token->string.string;
int length = token->string.length;
assert(node && renderer && renderer->document);
@ -208,10 +208,10 @@ render_dom_element_end_source(struct dom_stack *stack, struct dom_node *node, vo
}
static void
set_base_uri(struct dom_renderer *renderer, unsigned char *value, size_t valuelen)
set_base_uri(struct dom_renderer *renderer, char *value, size_t valuelen)
{
unsigned char *href = memacpy(value, valuelen);
unsigned char *uristring;
char *href = memacpy(value, valuelen);
char *uristring;
struct uri *uri;
if (!href) return;
@ -241,7 +241,7 @@ render_dom_attribute_source(struct dom_stack *stack, struct dom_node *node, void
if (is_dom_string_set(&node->data.attribute.value)) {
int quoted = node->data.attribute.quoted == 1;
unsigned char *value = node->data.attribute.value.string - quoted;
char *value = node->data.attribute.value.string - quoted;
int valuelen = node->data.attribute.value.length + quoted * 2;
if (check_dom_node_source(renderer, value, 0)) {
@ -309,7 +309,7 @@ render_dom_cdata_source(struct dom_stack *stack, struct dom_node *node, void *xx
{
struct dom_renderer *renderer = stack->current->data;
struct source_renderer *data = renderer->data;
unsigned char *string = node->string.string;
char *string = node->string.string;
assert(node && renderer && renderer->document);
@ -340,7 +340,7 @@ render_dom_document_start(struct dom_stack *stack, struct dom_node *node, void *
static int i_want_struct_module_for_dom;
if (!i_want_struct_module_for_dom) {
static const unsigned char default_colors[] =
static const char default_colors[] =
"document { color: yellow } "
"element { color: lightgreen } "
"entity-reference { color: red } "

View File

@ -116,7 +116,7 @@ add_search_node(struct dom_renderer *renderer, int width)
static void
render_dom_line(struct dom_renderer *renderer, struct screen_char *template_,
unsigned char *string, int length)
char *string, int length)
{
struct document *document = renderer->document;
struct conv_table *convert = renderer->convert_table;
@ -124,7 +124,7 @@ render_dom_line(struct dom_renderer *renderer, struct screen_char *template_,
int x, charlen;
#ifdef CONFIG_UTF8
int utf8 = document->options.utf8;
unsigned char *end;
char *end;
#endif /* CONFIG_UTF8 */
@ -145,7 +145,7 @@ render_dom_line(struct dom_renderer *renderer, struct screen_char *template_,
end = string + length;
#endif /* CONFIG_UTF8 */
for (x = 0, charlen = 1; x < length;x += charlen, renderer->canvas_x++) {
unsigned char *text = &string[x];
char *text = &string[x];
/* This is mostly to be able to break out so the indentation
* level won't get to high. */
@ -194,11 +194,11 @@ render_dom_line(struct dom_renderer *renderer, struct screen_char *template_,
mem_free(string);
}
static inline unsigned char *
split_dom_line(unsigned char *line, int length, int *linelen)
static inline char *
split_dom_line(char *line, int length, int *linelen)
{
unsigned char *end = line + length;
unsigned char *pos;
char *end = line + length;
char *pos;
/* End of line detection.
* We handle \r, \r\n and \n types here. */
@ -223,12 +223,12 @@ split_dom_line(unsigned char *line, int length, int *linelen)
void
render_dom_text(struct dom_renderer *renderer, struct screen_char *template_,
unsigned char *string, int length)
char *string, int length)
{
int linelen;
for (; length > 0; string += linelen, length -= linelen) {
unsigned char *newline = split_dom_line(string, length, &linelen);
char *newline = split_dom_line(string, length, &linelen);
if (linelen)
render_dom_line(renderer, template_, string, linelen);
@ -245,13 +245,13 @@ render_dom_text(struct dom_renderer *renderer, struct screen_char *template_,
ALIGN_LINK(&(doc)->links, (doc)->nlinks, size)
NONSTATIC_INLINE struct link *
add_dom_link(struct dom_renderer *renderer, unsigned char *string, int length,
unsigned char *uristring, int urilength)
add_dom_link(struct dom_renderer *renderer, char *string, int length,
char *uristring, int urilength)
{
struct document *document = renderer->document;
int x = renderer->canvas_x;
int y = renderer->canvas_y;
unsigned char *where;
char *where;
struct link *link;
struct point *point;
struct screen_char template_;

View File

@ -31,10 +31,10 @@ struct dom_renderer {
struct uri *base_uri;
unsigned char *source;
unsigned char *end;
char *source;
char *end;
unsigned char *position;
char *position;
int canvas_x, canvas_y;
/* Renderer-specific data */
@ -50,9 +50,9 @@ void init_template_by_style(struct screen_char *template_,
LIST_OF(struct css_property) *properties);
void render_dom_text(struct dom_renderer *renderer, struct screen_char *template_,
unsigned char *string, int length);
struct link *add_dom_link(struct dom_renderer *renderer, unsigned char *string,
int length, unsigned char *uristring, int urilength);
char *string, int length);
struct link *add_dom_link(struct dom_renderer *renderer, char *string,
int length, char *uristring, int urilength);
#ifdef __cplusplus
}

View File

@ -23,7 +23,7 @@
struct form_type_name {
enum form_type num;
unsigned char *name;
char *name;
};
static struct form_type_name form_type2name[] = {
@ -42,7 +42,7 @@ static struct form_type_name form_type2name[] = {
#define FORM_TYPE_COUNT (sizeof(form_type2name)/sizeof(struct form_type_name))
int
str2form_type(unsigned char *s)
str2form_type(char *s)
{
int n;
@ -53,7 +53,7 @@ str2form_type(unsigned char *s)
return -1;
}
unsigned char *
char *
form_type2str(enum form_type num)
{
int n;

View File

@ -35,10 +35,10 @@ struct form {
int form_num;
int form_end; /**< @see #form_num */
unsigned char *action;
unsigned char *name;
unsigned char *onsubmit;
unsigned char *target;
char *action;
char *name;
char *onsubmit;
char *target;
enum form_method method;
LIST_OF(struct el_form_control) items;
@ -88,33 +88,33 @@ struct el_form_control {
enum form_type type;
enum form_mode mode;
unsigned char *id; /**< used by scripts */
unsigned char *name;
unsigned char *alt;
char *id; /**< used by scripts */
char *name;
char *alt;
/** Default value, cannot be changed by document scripts.
* - For ::FC_TEXT, ::FC_PASSWORD, and ::FC_TEXTAREA:
* @c default_value is in the charset of the document.
* - For ::FC_FILE: The parser does not set @c default_value. */
unsigned char *default_value;
char *default_value;
int default_state;
int size;
int cols, rows;
enum form_wrap wrap;
int maxlength;
int nvalues;
unsigned char **values;
char **values;
/** Labels in a selection menu.
* - For ::FC_SELECT: @c labels are in the charset of the terminal.
* (That charset can be UTF-8 only if CONFIG_UTF8 is defined,
* and is assumed to be unibyte otherwise.) The charset of
* the document and the UTF-8 I/O option have no effect here. */
unsigned char **labels;
char **labels;
struct menu_item *menu;
};
/* Numerical form type <-> form type name */
int str2form_type(unsigned char *s);
unsigned char *form_type2str(enum form_type num);
int str2form_type(char *s);
char *form_type2str(enum form_type num);
struct form *init_form(void);
void done_form(struct form *form);

View File

@ -28,7 +28,7 @@
void
add_frameset_entry(struct frameset_desc *frameset_desc,
struct frameset_desc *subframe,
unsigned char *name, unsigned char *url)
char *name, char *url)
{
struct frame_desc *frame_desc;
int offset;
@ -127,7 +127,7 @@ add_frame_to_list(struct session *ses, struct document_view *doc_view)
}
static struct document_view *
find_fd(struct session *ses, unsigned char *name,
find_fd(struct session *ses, char *name,
int depth, int x, int y)
{
struct document_view *doc_view;
@ -389,15 +389,15 @@ distribute_rows_or_cols_that_left(int *val_, int max_value, int *values, int val
/* Returns 0 on error. */
static int
extract_rows_or_cols_values(unsigned char *str, int max_value, int pixels_per_char,
extract_rows_or_cols_values(char *str, int max_value, int pixels_per_char,
int **new_values, int *new_values_count)
{
unsigned char *tmp_str;
char *tmp_str;
int *values = NULL;
int values_count = 0;
while (1) {
unsigned char *end = str;
char *end = str;
int *tmp_values;
unsigned long number;
int val = -1; /* Wildcard */
@ -454,7 +454,7 @@ extract_rows_or_cols_values(unsigned char *str, int max_value, int pixels_per_ch
* <frameset cols="33%,33%,33%" rows="33%,33%,33%"> values in percentage
* */
void
parse_frame_widths(unsigned char *str, int max_value, int pixels_per_char,
parse_frame_widths(char *str, int max_value, int pixels_per_char,
int **new_values, int *new_values_count)
{
int val, ret;

View File

@ -17,7 +17,7 @@ struct frameset_desc;
struct frame_desc {
struct frameset_desc *subframe;
unsigned char *name;
char *name;
struct uri *uri;
int width, height;
@ -45,11 +45,11 @@ struct frameset_desc *create_frameset(struct frameset_param *fp);
void
add_frameset_entry(struct frameset_desc *parent,
struct frameset_desc *subframe,
unsigned char *name, unsigned char *url);
char *name, char *url);
void format_frames(struct session *ses, struct frameset_desc *fsd, struct document_options *op, int depth);
void parse_frame_widths(unsigned char *str, int max_value, int pixels_per_char,
void parse_frame_widths(char *str, int max_value, int pixels_per_char,
int **new_values, int *new_values_count);
#ifdef __cplusplus

Some files were not shown because too many files have changed in this diff Show More