1
0
Fork 0

Compile with C++.

Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
This commit is contained in:
Witold Filipczyk 2019-02-17 20:46:16 +01:00
parent 25dd2ecae9
commit 4f4df33638
141 changed files with 649 additions and 620 deletions

View File

@ -55,6 +55,7 @@ ASCIIDOC_FLAGS = --unsafe
AWK = @AWK@
CATALOGS = @CATALOGS@
CC = @CC@
CXX = @CXX@
LD = @LD@
GIT = @GIT@
CONFDIR = @CONFDIR@
@ -180,6 +181,7 @@ CONFIG_GSSAPI = @CONFIG_GSSAPI@
DEFS = @DEFS@
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
@ -187,7 +189,7 @@ LIBS = @LIBS@
INCLUDES = -I$(top_builddir) -I$(top_srcdir)/src
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
COMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
MAKE_COLOR = @MAKE_COLOR@

View File

@ -62,7 +62,7 @@ quiet_cmd_ld_objs = " [$(LD_COLOR)LD$(END_COLOR)] $(RELPATH)$@"
`test -e $(subdir)/$(LIB_O_NAME) && echo $(subdir)/$(LIB_O_NAME)`)
quiet_cmd_link = ' [$(LINK_COLOR)LINK$(END_COLOR)] $(RELPATH)$@'
cmd_link = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
cmd_link = $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
quiet_cmd_sparse = ' [SPARSE] $(RELPATH)$(2)'
cmd_sparse = $(SPARSE) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(SPARSE_FLAGS) $(2)

View File

@ -59,7 +59,8 @@ echo "Feature summary:" > features.log
# Checks for programs.
# ===================================================================
AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
AC_CHECK_TOOL([LD], [ld])
AC_PROG_AWK
AC_PATH_PROGS(AWK, "$AWK")
@ -279,7 +280,6 @@ EL_CHECK_CODE([variadic macros], HAVE_VARIADIC_MACROS,
# Checks for library functions.
# ===================================================================
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_STRFTIME
@ -1748,6 +1748,7 @@ if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
CFLAGS="$CFLAGS -Werror"
fi
GETTEXT_CFLAGS="-Wno-uninitialized"
CXXFLAGS="$CXXFLAGS -fpermissive"
case "`$CC -dumpversion`" in
3.0|3.1|3.2)
@ -1850,6 +1851,7 @@ fi
AC_SUBST(GETTEXT_CFLAGS)
EL_LOG_CONFIG(CFLAGS, [Compiler flags (CFLAGS)], [])
EL_LOG_CONFIG(CXXFLAGS, [Compiler flags (CXXFLAGS)], [])
EL_LOG_CONFIG(CPPFLAGS, [Preprocessor flags (CPPFLAGS)], [])
EL_LOG_CONFIG(LDFLAGS, [Linker flags (LDFLAGS)], [])
EL_LOG_CONFIG(LIBS, [Library flags (LIBS)], [])

View File

@ -594,7 +594,7 @@ static void
print_delete_error(struct listbox_item *item, struct terminal *term,
const struct listbox_ops *ops, enum delete_error err)
{
struct string msg;
struct string_ msg;
unsigned char *errmsg;
unsigned char *text;

View File

@ -108,7 +108,7 @@ void
do_tab_compl_unambiguous(struct dialog_data *dlg_data,
LIST_OF(struct input_history_entry) *history)
{
struct string completion;
struct string_ completion;
struct widget_data *widget_data = selected_widget(dlg_data);
int base_len = widget_data->info.field.cpos;
/* Maximum number of characters in a match. Characters after this

View File

@ -192,8 +192,8 @@ 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,
add_select_item(struct list_menu *menu, struct string_ *string,
struct string_ *orig_string, unsigned char **value,
int order, int dont_add)
{
int pos = order - 1;

View File

@ -3,7 +3,7 @@
#define EL__BFU_LISTMENU_H
struct session;
struct string;
struct string_;
struct terminal;
struct list_menu {
@ -13,7 +13,7 @@ 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 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);
struct menu_item *detach_menu(struct list_menu *menu);
void menu_labels(struct menu_item *m, unsigned char *base, unsigned char **lbls);

View File

@ -220,7 +220,7 @@ get_menuitem_rtext_width(struct terminal *term, struct menu_item *mi)
rtext_width = L_RTEXT_SPACE + m_submenu_len + R_RTEXT_SPACE;
} else if (mi->action_id != ACT_MAIN_NONE) {
struct string keystroke;
struct string_ keystroke;
if (init_string(&keystroke)) {
add_keystroke_action_to_string(&keystroke, mi->action_id, KEYMAP_MAIN);
@ -634,7 +634,7 @@ display_menu(struct terminal *term, struct menu *menu)
draw_menu_right_text(term, m_submenu, m_submenu_len,
menu->box.x, box.y, box.width, color);
} else if (mi->action_id != ACT_MAIN_NONE) {
struct string keystroke;
struct string_ keystroke;
#ifdef CONFIG_DEBUG
/* Help to detect action + right text. --Zas */

View File

@ -184,7 +184,7 @@ indentation(struct secure_save_info *ssi, int num)
static void
print_xml_entities(struct secure_save_info *ssi, const unsigned char *str)
{
struct string entitized = NULL_STRING;
struct string_ entitized = NULL_STRING;
if (init_string(&entitized)
&& add_html_to_string(&entitized, str, strlen(str))) {

View File

@ -690,7 +690,7 @@ bookmark_auto_save_tabs(struct terminal *term)
static void
bookmark_snapshot(void)
{
struct string folderstring;
struct string_ folderstring;
struct bookmark *folder;
if (!init_string(&folderstring)) return;

View File

@ -75,7 +75,7 @@ get_bookmark_text(struct listbox_item *item, struct terminal *term)
static void
add_converted_bytes_to_string(void *data, unsigned char *buf, int buflen)
{
struct string *string = data;
struct string_ *string = data;
add_bytes_to_string(string, buf, buflen); /* ignore errors */
}
@ -87,7 +87,7 @@ get_bookmark_info(struct listbox_item *item, struct terminal *term)
int utf8_cp = get_cp_index("UTF-8");
int term_cp = get_terminal_codepage(term);
struct conv_table *convert_table;
struct string info;
struct string_ info;
if (item->type == BI_FOLDER) return NULL;
convert_table = get_translation_table(utf8_cp, term_cp);
@ -943,7 +943,7 @@ bookmark_terminal_tabs_ok(void *term_void, unsigned char *foldername)
void
bookmark_terminal_tabs_dialog(struct terminal *term)
{
struct string string;
struct string_ string;
if (!init_string(&string)) return;

2
src/cache/dialogs.c vendored
View File

@ -57,7 +57,7 @@ static unsigned char *
get_cache_entry_info(struct listbox_item *item, struct terminal *term)
{
struct cache_entry *cached = item->udata;
struct string msg;
struct string_ msg;
if (item->type == BI_FOLDER) return NULL;
if (!init_string(&msg)) return NULL;

View File

@ -431,12 +431,12 @@ version_cmd(struct option *o, unsigned char ***argv, int *argc)
static void print_option_desc(const unsigned char *desc)
{
struct string wrapped;
static const struct string indent = INIT_STRING(" ", 12);
struct string_ wrapped;
static const struct string_ indent = INIT_STRING(" ", 12);
if (init_string(&wrapped)
&& wrap_option_desc(&wrapped, desc, &indent, 79 - indent.length)) {
/* struct string could in principle contain null
/* struct string_ could in principle contain null
* characters, so don't use printf() or fputs(). */
fwrite(wrapped.source, 1, wrapped.length, stdout);
} else {
@ -595,8 +595,8 @@ print_short_help(void)
{
#define ALIGN_WIDTH 20
struct option *option;
struct string string = NULL_STRING;
struct string *saved = NULL;
struct string_ string = NULL_STRING;
struct string_ *saved = NULL;
unsigned char align[ALIGN_WIDTH];
/* Initialize @space used to align captions. */

View File

@ -200,7 +200,7 @@ skip_to_unquoted_newline_or_comment(struct conf_parsing_pos *pos)
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)
struct string_ *mirror, int is_system_conf, int want_domain)
{
const unsigned char *domain_orig = NULL;
size_t domain_len = 0;
@ -386,14 +386,14 @@ parse_set_common(struct option *opt_tree, struct conf_parsing_state *state,
static enum parse_error
parse_set_domain(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
struct string_ *mirror, int is_system_conf)
{
return parse_set_common(opt_tree, state, mirror, is_system_conf, 1);
}
static enum parse_error
parse_set(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
struct string_ *mirror, int is_system_conf)
{
return parse_set_common(opt_tree, state, mirror, is_system_conf, 0);
}
@ -401,7 +401,7 @@ parse_set(struct option *opt_tree, struct conf_parsing_state *state,
static enum parse_error
parse_unset(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
struct string_ *mirror, int is_system_conf)
{
const unsigned char *optname_orig;
size_t optname_len;
@ -478,7 +478,7 @@ parse_unset(struct option *opt_tree, struct conf_parsing_state *state,
static enum parse_error
parse_bind(struct option *opt_tree, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
struct string_ *mirror, int is_system_conf)
{
unsigned char *keymap, *keystroke, *action;
enum parse_error err = ERROR_NONE;
@ -567,14 +567,14 @@ parse_bind(struct option *opt_tree, struct conf_parsing_state *state,
}
static int load_config_file(unsigned char *, unsigned char *, struct option *,
struct string *, int);
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)
struct string_ *mirror, int is_system_conf)
{
unsigned char *fname;
struct string dumbstring;
struct string_ dumbstring;
struct conf_parsing_pos before_error;
if (!init_string(&dumbstring))
@ -622,7 +622,7 @@ struct parse_handler {
const unsigned char *command;
enum parse_error (*handler)(struct option *opt_tree,
struct conf_parsing_state *state,
struct string *mirror, int is_system_conf);
struct string_ *mirror, int is_system_conf);
};
static const struct parse_handler parse_handlers[] = {
@ -637,7 +637,7 @@ static const struct parse_handler parse_handlers[] = {
static enum parse_error
parse_config_command(struct option *options, struct conf_parsing_state *state,
struct string *mirror, int is_system_conf)
struct string_ *mirror, int is_system_conf)
{
const struct parse_handler *handler;
@ -688,7 +688,7 @@ parse_config_exmode_command(unsigned char *cmd)
void
parse_config_file(struct option *options, unsigned char *name,
unsigned char *file, struct string *mirror,
unsigned char *file, struct string_ *mirror,
int is_system_conf)
{
struct conf_parsing_state state = {{ 0 }};
@ -766,7 +766,7 @@ read_config_file(unsigned char *name)
{
#define FILE_BUF 1024
unsigned char cfg_buffer[FILE_BUF];
struct string string;
struct string_ string;
int fd;
ssize_t r;
@ -797,7 +797,7 @@ read_config_file(unsigned char *name)
/* Return 0 on success. */
static int
load_config_file(unsigned char *prefix, unsigned char *name,
struct option *options, struct string *mirror,
struct option *options, struct string_ *mirror,
int is_system_conf)
{
unsigned char *config_str, *config_file;
@ -856,16 +856,16 @@ conf_i18n(unsigned char *s, int i18n)
}
static void
add_indent_to_string(struct string *string, int depth)
add_indent_to_string(struct string_ *string, int depth)
{
if (!depth) return;
add_xchar_to_string(string, ' ', depth * indentation);
}
struct string *
wrap_option_desc(struct string *out, const unsigned char *src,
const struct string *indent, int maxwidth)
struct string_ *
wrap_option_desc(struct string_ *out, const unsigned char *src,
const struct string_ *indent, int maxwidth)
{
const unsigned char *last_space = NULL;
const unsigned char *uncopied = src;
@ -906,11 +906,11 @@ split:
}
static void
output_option_desc_as_comment(struct string *out, const struct option *option,
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);
struct string indent;
struct string_ indent;
if (!init_string(&indent)) return;
@ -926,7 +926,7 @@ out_of_memory:
static unsigned char *smart_config_output_fn_domain;
static void
smart_config_output_fn(struct string *string, struct option *option,
smart_config_output_fn(struct string_ *string, struct option *option,
unsigned char *path, int depth, int do_print_comment,
int action, int i18n)
{
@ -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, unsigned char *text)
{
int n = strlen(text) + 2;
@ -1016,9 +1016,9 @@ unsigned char *
create_config_string(unsigned char *prefix, unsigned char *name)
{
struct option *options = config_options;
struct string config;
struct string_ config;
/* Don't write headers if nothing will be added anyway. */
struct string tmpstring;
struct string_ tmpstring;
int origlen;
int savestyle = get_opt_int("config.saving_style", NULL);
int i18n = get_opt_bool("config.i18n", NULL);

View File

@ -18,14 +18,14 @@ void load_config(void);
enum parse_error parse_config_exmode_command(unsigned char *cmd);
#endif
void parse_config_file(struct option *options, unsigned char *name,
unsigned char *file, struct string *mirror,
unsigned 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);
struct string *wrap_option_desc(struct string *out, const unsigned char *src,
const struct string *indent, int maxwidth);
struct string_ *wrap_option_desc(struct string_ *out, const unsigned char *src,
const struct string_ *indent, int maxwidth);
#endif

View File

@ -102,7 +102,7 @@ is_option_used(struct listbox_item *item)
static unsigned char *
get_range_string(struct option *option)
{
struct string info;
struct string_ info;
if (!init_string(&info)) return NULL;
@ -133,7 +133,7 @@ get_option_info(struct listbox_item *item, struct terminal *term)
{
struct option *option = item->udata;
unsigned char *desc, *type;
struct string info;
struct string_ info;
if (!init_string(&info)) return NULL;
@ -154,7 +154,7 @@ get_option_info(struct listbox_item *item, struct terminal *term)
if (option_types[option->type].write) {
unsigned char *range;
struct string value;
struct string_ value;
if (!init_string(&value)) {
done_string(&info);
@ -302,7 +302,7 @@ build_edit_dialog(struct terminal *term, struct session *ses,
#define EDIT_WIDGETS_COUNT 5
struct dialog *dlg;
unsigned char *value, *name, *desc, *range;
struct string tvalue;
struct string_ tvalue;
if (!init_string(&tvalue)) return;
@ -636,7 +636,7 @@ static unsigned char *
get_keybinding_text(struct listbox_item *item, struct terminal *term)
{
struct keybinding *keybinding = item->udata;
struct string info;
struct string_ info;
if (item->depth == 0) {
struct keymap *keymap = item->udata;
@ -660,7 +660,7 @@ get_keybinding_info(struct listbox_item *item, struct terminal *term)
{
struct keybinding *keybinding = item->udata;
unsigned char *action, *keymap;
struct string info;
struct string_ info;
if (item->depth < 2) return NULL;
if (item->type == BI_FOLDER) return NULL;
@ -793,7 +793,7 @@ really_add_keybinding(void *data, unsigned char *keystroke)
if (keybinding_exists(hop->keymap_id, &hop->kbd, &action_id)
&& action_id != ACT_MAIN_NONE) {
struct kbdbind_add_hop *new_hop;
struct string canonical;
struct string_ canonical;
/* Same keystroke for same action, just return. */
if (action_id == hop->action_id) return;

View File

@ -467,7 +467,7 @@ parse_keystroke(const unsigned char *s, struct term_event_keyboard *kbd)
}
void
add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd,
add_keystroke_to_string(struct string_ *str, struct term_event_keyboard *kbd,
int escape)
{
unsigned char key_buffer[3] = "\\x";
@ -503,7 +503,7 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd,
}
void
add_keystroke_action_to_string(struct string *string, action_id_T action_id,
add_keystroke_action_to_string(struct string_ *string, action_id_T action_id,
enum keymap_id keymap_id)
{
struct keybinding *keybinding = kbd_act_lookup(keymap_id, action_id);
@ -515,7 +515,7 @@ add_keystroke_action_to_string(struct string *string, action_id_T action_id,
unsigned char *
get_keystroke(action_id_T action_id, enum keymap_id keymap_id)
{
struct string keystroke;
struct string_ keystroke;
if (!init_string(&keystroke)) return NULL;
@ -528,7 +528,7 @@ get_keystroke(action_id_T action_id, enum keymap_id keymap_id)
}
void
add_actions_to_string(struct string *string, action_id_T action_ids[],
add_actions_to_string(struct string_ *string, action_id_T action_ids[],
enum keymap_id keymap_id, struct terminal *term)
{
int i;
@ -950,7 +950,7 @@ bind_act(unsigned char *keymap_str, const unsigned char *keystroke_str)
}
static void
single_bind_config_string(struct string *file, enum keymap_id keymap_id,
single_bind_config_string(struct string_ *file, enum keymap_id keymap_id,
struct keybinding *keybinding)
{
unsigned char *keymap_str = get_keymap_name(keymap_id);
@ -976,7 +976,7 @@ single_bind_config_string(struct string *file, enum keymap_id keymap_id,
}
void
bind_config_string(struct string *file)
bind_config_string(struct string_ *file)
{
int keymap_id;

View File

@ -162,9 +162,9 @@ term_event_key_T read_key(const unsigned char *);
unsigned char *get_keymap_name(enum keymap_id);
int parse_keystroke(const unsigned char *, struct term_event_keyboard *);
void add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd, int escape);
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); */
/* void add_accesskey_to_string(struct string_ *str, unicode_val_T accesskey); */
#define add_accesskey_to_string(str, accesskey) do { \
struct term_event_keyboard kbd; \
/* FIXME: #ifndef CONFIG_UTF8, kbd.key is encoded in \
@ -184,17 +184,17 @@ struct keybinding *kbd_nm_lookup(enum keymap_id, unsigned char *);
int bind_do(unsigned char *, const unsigned char *, unsigned char *, int);
unsigned char *bind_act(unsigned char *, const unsigned char *);
void bind_config_string(struct string *);
void bind_config_string(struct string_ *);
#ifdef CONFIG_SCRIPTING
int bind_key_to_event_name(unsigned char *, const unsigned char *, unsigned char *,
unsigned char **);
#endif
void add_keystroke_action_to_string(struct string *string, action_id_T action_id, enum keymap_id keymap_id);
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);
void add_actions_to_string(struct string *string, action_id_T actions[],
void add_actions_to_string(struct string_ *string, action_id_T actions[],
enum keymap_id keymap_id, struct terminal *term);
extern struct module kbdbind_module;

View File

@ -1044,10 +1044,10 @@ check_nonempty_tree(LIST_OF(struct option) *options)
/*! @relates option */
void
smart_config_string(struct string *str, int print_comment, int i18n,
smart_config_string(struct string_ *str, int print_comment, int i18n,
LIST_OF(struct option) *options,
unsigned char *path, int depth,
void (*fn)(struct string *, struct option *,
void (*fn)(struct string_ *, struct option *,
unsigned char *, int, int, int, int))
{
struct option *option;
@ -1106,7 +1106,7 @@ smart_config_string(struct string *str, int print_comment, int i18n,
do_print_comment, 2, i18n);
} else if (option->type == OPT_TREE) {
struct string newpath;
struct string_ newpath;
int pc = print_comment;
if (!init_string(&newpath)) continue; /* OK? */

View File

@ -231,9 +231,9 @@ extern LIST_OF(struct option) *init_options_tree(void);
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,
extern void smart_config_string(struct string_ *, int, int,
LIST_OF(struct option) *, unsigned char *, int,
void (*)(struct string *, struct option *,
void (*)(struct string_ *, struct option *,
unsigned char *, int, int, int, int));
enum copy_option_flags {

View File

@ -129,7 +129,7 @@ redir_rd(struct option *opt, unsigned char **file, int *line)
}
static void
redir_wr(struct option *opt, struct string *string)
redir_wr(struct option *opt, struct string_ *string)
{
struct option *real = get_opt_rec(config_options, opt->value.string);
@ -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 unsigned char *q, int qlen)
{
if (!commandline) add_char_to_string(s, '"');
add_quoted_to_string(s, q, qlen);
@ -241,7 +241,7 @@ num_eq(struct option *opt, const unsigned char *str)
}
static void
num_wr(struct option *option, struct string *string)
num_wr(struct option *option, struct string_ *string)
{
add_knum_to_string(string, option->value.number);
}
@ -261,7 +261,7 @@ long_eq(struct option *opt, const unsigned char *str)
}
static void
long_wr(struct option *option, struct string *string)
long_wr(struct option *option, struct string_ *string)
{
add_knum_to_string(string, option->value.big_number);
}
@ -270,7 +270,7 @@ static unsigned char *
str_rd(struct option *opt, unsigned char **file, int *line)
{
unsigned char *str = *file;
struct string str2;
struct string_ str2;
if (!init_string(&str2)) return NULL;
@ -336,7 +336,7 @@ str_eq(struct option *opt, const unsigned char *str)
}
static void
str_wr(struct option *o, struct string *s)
str_wr(struct option *o, struct string_ *s)
{
int len = strlen(o->value.string);
@ -372,7 +372,7 @@ cp_eq(struct option *opt, const unsigned char *str)
}
static void
cp_wr(struct option *o, struct string *s)
cp_wr(struct option *o, struct string_ *s)
{
unsigned char *mime_name = get_cp_config_name(o->value.number);
@ -401,7 +401,7 @@ lang_eq(struct option *opt, const unsigned char *str)
}
static void
lang_wr(struct option *o, struct string *s)
lang_wr(struct option *o, struct string_ *s)
{
unsigned char *lang;
@ -431,7 +431,7 @@ color_eq(struct option *opt, const unsigned char *str)
}
static void
color_wr(struct option *opt, struct string *str)
color_wr(struct option *opt, struct string_ *str)
{
color_T color = opt->value.color;
unsigned char hexcolor[8];

View File

@ -8,7 +8,7 @@ struct option_type_info {
unsigned char *name;
unsigned char *(*cmdline)(struct option *, unsigned char ***, int *);
unsigned char *(*read)(struct option *, unsigned char **, int *);
void (*write)(struct option *, struct string *);
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 *);

View File

@ -619,13 +619,13 @@ is_path_prefix(unsigned char *d, unsigned char *s)
}
static struct string *
static struct string_ *
send_cookies_common(struct uri *uri, unsigned int httponly)
{
struct c_domain *cd;
struct cookie *c, *next;
unsigned char *path = NULL;
static struct string header;
static struct string_ header;
time_t now;
if (!uri->host || !uri->data)
@ -686,13 +686,13 @@ send_cookies_common(struct uri *uri, unsigned int httponly)
return &header;
}
struct string *
struct string_ *
send_cookies(struct uri *uri)
{
return send_cookies_common(uri, 0);
}
struct string *
struct string_ *
send_cookies_js(struct uri *uri)
{
return send_cookies_common(uri, 1);

View File

@ -61,8 +61,8 @@ void set_cookies_dirty(void);
/* Note that the returned value points to a static structure and thus the
* string will be overwritten at the next call time. The string source
* itself is dynamically allocated, though. */
struct string *send_cookies(struct uri *uri);
struct string *send_cookies_js(struct uri *uri);
struct string_ *send_cookies(struct uri *uri);
struct string_ *send_cookies_js(struct uri *uri);
extern struct module cookies_module;

View File

@ -32,7 +32,7 @@
INIT_LIST_OF(struct cookie, cookie_queries);
static void
add_cookie_info_to_string(struct string *string, struct cookie *cookie,
add_cookie_info_to_string(struct string_ *string, struct cookie *cookie,
struct terminal *term)
{
add_format_to_string(string, "\n%s: %s", _("Name", term), cookie->name);
@ -74,7 +74,7 @@ accept_cookie_dialog(struct session *ses, void *data)
{
/* [gettext_accelerator_context(accept_cookie_dialog)] */
struct cookie *cookie = cookie_queries.next;
struct string string;
struct string_ string;
assert(ses);
@ -156,7 +156,7 @@ get_cookie_info(struct listbox_item *item, struct terminal *term)
{
struct cookie *cookie = item->udata;
struct cookie_server *server;
struct string string;
struct string_ string;
if (item->type == BI_FOLDER) return NULL;

View File

@ -46,7 +46,7 @@ nowhere_box(struct terminal *term, unsigned char *title)
}
static void
add_link_info_to_string(struct string *msg, struct session *ses)
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;
@ -73,7 +73,7 @@ add_link_info_to_string(struct string *msg, struct session *ses)
link = get_current_link_in_view(doc_view);
if (link) {
struct string img;
struct string_ img;
#ifdef CONFIG_GLOBHIST
struct global_history_item *historyitem;
#endif
@ -119,7 +119,7 @@ link_info_dialog(struct session *ses)
{
struct terminal *term = ses->tab->term;
struct location *location = cur_loc(ses);
struct string msg;
struct string_ msg;
if (!location) {
nowhere_box(term, NULL);
@ -142,7 +142,7 @@ document_info_dialog(struct session *ses)
struct terminal *term = ses->tab->term;
struct location *location = cur_loc(ses);
struct document_view *doc_view;
struct string msg;
struct string_ msg;
if (!location) {
nowhere_box(term, NULL);

View File

@ -87,7 +87,7 @@ menu_keys(struct terminal *term, void *d_, void *xxx)
ACT_MAIN_NONE,
};
struct string keys;
struct string_ keys;
struct keys_toggle_info *info;
info = mem_calloc(1, sizeof(*info));
@ -157,7 +157,7 @@ menu_copying(struct terminal *term, void *xxx, void *xxxx)
static unsigned char *
get_resource_info(struct terminal *term, void *data)
{
struct string info;
struct string_ info;
long val;
unsigned longlong bigval;

View File

@ -555,7 +555,7 @@ query_file(struct session *ses, struct uri *uri, void *data,
void (*std)(void *, unsigned char *),
void (*cancel)(void *), int interactive)
{
struct string def;
struct string_ def;
assert(ses && uri);
if_assert_failed return;
@ -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, unsigned char *name)
{
if (!get_cmd_opt_bool(name)) return;
add_to_string(string, " -");
@ -634,7 +634,7 @@ open_uri_in_new_window(struct session *ses, struct uri *uri, struct uri *referre
enum task_type task)
{
int ring = get_cmd_opt_int("session-ring");
struct string parameters;
struct string_ parameters;
int id;
assert(env && ses);
@ -774,7 +774,7 @@ do_pass_uri_to_command(struct terminal *term, void *command_, void *xxx)
static unsigned char *
format_command(unsigned char *format, struct uri *uri)
{
struct string string;
struct string_ string;
if (!init_string(&string)) return NULL;

View File

@ -19,7 +19,7 @@ static unsigned char *
get_progress_msg_2(struct progress *progress, struct terminal *term,
int wide, int full, unsigned char *separator, unsigned char *type)
{
struct string msg;
struct string_ msg;
int newlines = separator[strlen(separator) - 1] == '\n';
if (!init_string(&msg)) return NULL;

View File

@ -397,7 +397,7 @@ display_title_bar(struct session *ses, struct terminal *term)
{
struct document_view *doc_view;
struct document *document;
struct string title;
struct string_ title;
unsigned char buf[40];
int buflen = 0;
int height;

View File

@ -155,7 +155,7 @@ static void
import_css_file(struct css_stylesheet *css, struct uri *base_uri,
const unsigned char *url, int urllen)
{
struct string string, filename;
struct string_ string, filename;
if (!*url
|| css->import_level >= MAX_REDIRECTS

View File

@ -175,7 +175,7 @@ css_parse_atrule(struct css_stylesheet *css, struct scanner *scanner,
struct uri *base_uri)
{
struct scanner_token *token = get_scanner_token(scanner);
struct string import_uri;
struct string_ import_uri;
/* Skip skip skip that code */
switch (token->type) {

View File

@ -31,7 +31,7 @@
static inline void
init_dom_renderer(struct dom_renderer *renderer, struct document *document,
struct string *buffer, struct conv_table *convert_table)
struct string_ *buffer, struct conv_table *convert_table)
{
memset(renderer, 0, sizeof(*renderer));
@ -79,7 +79,7 @@ get_doctype(struct dom_renderer *renderer, struct cache_entry *cached)
/* Shared multiplexor between renderers */
void
render_dom_document(struct cache_entry *cached, struct document *document,
struct string *buffer)
struct string_ *buffer)
{
unsigned char *head = empty_string_or_(cached->head);
struct dom_renderer renderer;

View File

@ -4,8 +4,8 @@
struct cache_entry;
struct document;
struct string;
struct string_;
void render_dom_document(struct cache_entry *cached, struct document *document, struct string *buffer);
void render_dom_document(struct cache_entry *cached, struct document *document, struct string_ *buffer);
#endif

View File

@ -445,7 +445,7 @@ look_for_tag(unsigned char **pos, unsigned char *eof,
unsigned char *name, int namelen, unsigned char **label)
{
unsigned char *pos2;
struct string str;
struct string_ str;
if (!init_string(&str)) {
/* Is this the right way to bail out? --jonas */
@ -643,7 +643,7 @@ get_image_map(unsigned char *head, unsigned char *pos, unsigned char *eof,
int to, int def, int hdef)
{
struct conv_table *ct;
struct string hd;
struct string_ hd;
int look_result;
if (!init_string(&hd)) return -1;
@ -744,7 +744,7 @@ done_html_parser_state(struct html_context *html_context,
struct html_context *
init_html_parser(struct uri *uri, struct document_options *options,
unsigned char *start, unsigned char *end,
struct string *head, struct string *title,
struct string_ *head, struct string_ *title,
void (*put_chars)(struct html_context *, unsigned char *, int),
void (*line_break)(struct html_context *),
void *(*special)(struct html_context *, enum html_special_type, ...))

View File

@ -17,7 +17,7 @@ struct html_context;
struct memory_list;
struct menu_item;
struct part;
struct string;
struct string_;
struct uri;
/* XXX: This is just terible - this interface is from 75% only for other HTML
@ -165,7 +165,7 @@ struct html_element {
struct html_context *
init_html_parser(struct uri *uri, struct document_options *options,
unsigned char *start, unsigned char *end,
struct string *head, struct string *title,
struct string_ *head, struct string_ *title,
void (*put_chars)(struct html_context *, unsigned char *, int),
void (*line_break)(struct html_context *),
void *(*special)(struct html_context *, enum html_special_type,

View File

@ -341,7 +341,7 @@ do_html_select(unsigned char *attr, unsigned char *html,
{
struct conv_table *ct = html_context->special_f(html_context, SP_TABLE, NULL);
struct el_form_control *fc;
struct string lbl = NULL_STRING, orig_lbl = NULL_STRING;
struct string_ lbl = NULL_STRING, orig_lbl = NULL_STRING;
unsigned char **values = NULL;
unsigned char **labels;
unsigned char *name, *t_attr, *en;
@ -558,7 +558,7 @@ html_option(struct html_context *html_context, unsigned char *a,
val = get_attr_val(a, "value", html_context->doc_cp);
if (!val) {
struct string str;
struct string_ str;
unsigned char *p, *r;
unsigned char *name;
int namelen;

View File

@ -450,7 +450,7 @@ void
html_handle_body_meta(struct html_context *html_context, unsigned char *meta,
unsigned char *eof)
{
struct string head;
struct string_ head;
if (!init_string(&head)) return;
@ -826,7 +826,7 @@ static struct {
};
static void
roman(struct string *p, unsigned n)
roman(struct string_ *p, unsigned n)
{
int i = 0;
@ -884,7 +884,7 @@ html_li(struct html_context *html_context, unsigned char *a,
int nlen;
int t = par_format.flags & P_LISTMASK;
int s = get_num(a, "value", html_context->doc_cp);
struct string n;
struct string_ n;
if (!init_string(&n)) return;

View File

@ -865,7 +865,7 @@ html_link(struct html_context *html_context, unsigned char *a,
int link_display = html_context->options->meta_link_display;
unsigned char *name;
struct hlink link;
struct string text;
struct string_ text;
int name_neq_title = 0;
int first = 1;

View File

@ -1165,8 +1165,8 @@ process_element(unsigned char *name, int namelen, int endingtag,
}
void
scan_http_equiv(unsigned char *s, unsigned char *eof, struct string *head,
struct string *title, int cp)
scan_http_equiv(unsigned char *s, unsigned char *eof, struct string_ *head,
struct string_ *title, int cp)
{
unsigned char *name, *attr, *he, *c;
int namelen;