diff --git a/src/Doxyfile b/src/Doxyfile new file mode 100644 index 00000000..8fc9c1b2 --- /dev/null +++ b/src/Doxyfile @@ -0,0 +1,275 @@ +# Doxyfile 1.5.2 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = ELinks +PROJECT_NUMBER = 0.13.GIT +OUTPUT_DIRECTORY = ../doc/api +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = . +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 3 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +INPUT = . +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.h \ + *.inc +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = NO +USE_HTAGS = NO +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = "LIST_OF(element_T)=element_T list" \ + CONFIG_DEBUG \ + CONFIG_UTF8 \ + HAVE_VARIADIC_MACROS +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +CLASS_DIAGRAMS = NO +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +SEARCHENGINE = NO diff --git a/src/Makefile b/src/Makefile index 87955058..c751ed26 100644 --- a/src/Makefile +++ b/src/Makefile @@ -45,7 +45,7 @@ elinks: $(LIB_O_NAME) vernum.o TAGS: cd $(srcdir) \ && find . \( -name "*.[ch]" -o -name "*.inc" \) -print \ - | etags --regex='{c}/INIT_LIST_HEAD(\([[:alnum:]_]+\))/\1/' \ + | etags --regex='{c}/INIT_LIST_OF([^,]*,[ \t]*\([[:alnum:]_]+\))/\1/' \ --regex='{c}/struct_hierbox_browser(\n[ \t]*\([[:alnum:]_]+\),/\1/m' \ --regex='{c}/^ACTION_(\([[:alnum:]_]+\),[^,]*,[ \t]*\([[:alnum:]_]+\),/ACT_\1_\2/' \ --language=c - diff --git a/src/bfu/hierbox.h b/src/bfu/hierbox.h index 513d0974..b3c9d1d2 100644 --- a/src/bfu/hierbox.h +++ b/src/bfu/hierbox.h @@ -21,8 +21,8 @@ struct hierbox_browser { const struct hierbox_browser_button *buttons; size_t buttons_size; - struct list_head boxes; - struct list_head dialogs; + LIST_OF(struct listbox_data) boxes; + LIST_OF(struct hierbox_dialog_list_item) dialogs; struct listbox_item root; const struct listbox_ops *ops; diff --git a/src/bfu/inpfield.h b/src/bfu/inpfield.h index 2829eb70..d45a9020 100644 --- a/src/bfu/inpfield.h +++ b/src/bfu/inpfield.h @@ -30,7 +30,7 @@ struct widget_info_field { struct widget_data_info_field { int vpos; int cpos; - struct list_head history; + LIST_OF(struct input_history_entry) history; struct input_history_entry *cur_hist; }; diff --git a/src/bfu/inphist.c b/src/bfu/inphist.c index b3b714ab..8c6d005c 100644 --- a/src/bfu/inphist.c +++ b/src/bfu/inphist.c @@ -58,7 +58,8 @@ menu_tab_compl(struct terminal *term, void *item_, void *dlg_data_) /* Complete to last unambiguous character, and display menu for all possible * further completions. */ void -do_tab_compl(struct dialog_data *dlg_data, struct list_head *history) +do_tab_compl(struct dialog_data *dlg_data, + LIST_OF(struct input_history_entry) *history) { struct terminal *term = dlg_data->win->term; struct widget_data *widget_data = selected_widget(dlg_data); @@ -104,7 +105,8 @@ strcommonlen(unsigned char *a, unsigned char *b) * completes `go' to `google.com' and `google.com/' to `google.com/search?q='. */ void -do_tab_compl_unambiguous(struct dialog_data *dlg_data, struct list_head *history) +do_tab_compl_unambiguous(struct dialog_data *dlg_data, + LIST_OF(struct input_history_entry) *history) { struct string completion; struct widget_data *widget_data = selected_widget(dlg_data); @@ -188,7 +190,8 @@ tab_complete_file_menu(struct terminal *term, void *path_, void *dlg_data_) } void -do_tab_compl_file(struct dialog_data *dlg_data, struct list_head *history) +do_tab_compl_file(struct dialog_data *dlg_data, + LIST_OF(struct input_history_entry) *history) { struct widget_data *widget_data = selected_widget(dlg_data); diff --git a/src/bfu/inphist.h b/src/bfu/inphist.h index 0011ef9d..d7a5ecf0 100644 --- a/src/bfu/inphist.h +++ b/src/bfu/inphist.h @@ -12,7 +12,7 @@ struct input_history_entry { }; struct input_history { - struct list_head entries; + LIST_OF(struct input_history_entry) entries; int size; unsigned int dirty:1; unsigned int nosave:1; @@ -42,9 +42,12 @@ struct input_history { void add_to_input_history(struct input_history *, unsigned char *, int); -void do_tab_compl(struct dialog_data *, struct list_head *); -void do_tab_compl_file(struct dialog_data *, struct list_head *); -void do_tab_compl_unambiguous(struct dialog_data *, struct list_head *); +void do_tab_compl(struct dialog_data *, + LIST_OF(struct input_history_entry) *); +void do_tab_compl_file(struct dialog_data *, + LIST_OF(struct input_history_entry) *); +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); diff --git a/src/bfu/listbox.c b/src/bfu/listbox.c index 0b56109a..7ec1b660 100644 --- a/src/bfu/listbox.c +++ b/src/bfu/listbox.c @@ -407,7 +407,7 @@ display_listbox_item(struct listbox_item *item, void *data_, int *offset) str[1] = BORDER_SDLCORNER; } } else { - struct list_head *p = data->box->items; + LIST_OF(struct listbox_item) *p = data->box->items; if (p->next == item) { str[1] = BORDER_SULCORNER; diff --git a/src/bfu/listbox.h b/src/bfu/listbox.h index bca2a266..c3599e58 100644 --- a/src/bfu/listbox.h +++ b/src/bfu/listbox.h @@ -105,7 +105,7 @@ struct listbox_data { struct listbox_item *top; /* Item which is on the top line of the box */ int sel_offset; /* Offset of selected item against the box top */ - struct list_head *items; /* The list being displayed */ + LIST_OF(struct listbox_item) *items; /* The list being displayed */ }; enum listbox_item_type { @@ -119,7 +119,7 @@ struct listbox_item { LIST_HEAD(struct listbox_item); /* The list may be empty for leaf nodes or non-hiearchic listboxes */ - struct list_head child; + LIST_OF(struct listbox_item) child; enum listbox_item_type type; int depth; diff --git a/src/bookmarks/backend/common.c b/src/bookmarks/backend/common.c index 0890bbd4..4d386cdd 100644 --- a/src/bookmarks/backend/common.c +++ b/src/bookmarks/backend/common.c @@ -74,7 +74,7 @@ bookmarks_read(void) } void -bookmarks_write(struct list_head *bookmarks_list) +bookmarks_write(LIST_OF(struct bookmark) *bookmarks_list) { int backend_num = get_opt_int("bookmarks.file_format"); struct bookmarks_backend *backend = bookmarks_backends[backend_num]; diff --git a/src/bookmarks/backend/common.h b/src/bookmarks/backend/common.h index 6dec16c7..f406aa3c 100644 --- a/src/bookmarks/backend/common.h +++ b/src/bookmarks/backend/common.h @@ -10,10 +10,10 @@ struct bookmarks_backend { /* Order matters here. --Zas. */ unsigned char *(*filename)(int); void (*read)(FILE *); - void (*write)(struct secure_save_info *, struct list_head *); + void (*write)(struct secure_save_info *, LIST_OF(struct bookmark) *); }; void bookmarks_read(void); -void bookmarks_write(struct list_head *); +void bookmarks_write(LIST_OF(struct bookmark) *); #endif diff --git a/src/bookmarks/backend/default.c b/src/bookmarks/backend/default.c index f68d1c64..a098b7d3 100644 --- a/src/bookmarks/backend/default.c +++ b/src/bookmarks/backend/default.c @@ -128,7 +128,7 @@ read_bookmarks_default(FILE *f) /* Saves the bookmarks to file */ static void write_bookmarks_default(struct secure_save_info *ssi, - struct list_head *bookmarks_list) + LIST_OF(struct bookmark) *bookmarks_list) { int folder_state = get_opt_bool("bookmarks.folder_state"); struct bookmark *bm; diff --git a/src/bookmarks/backend/xbel.c b/src/bookmarks/backend/xbel.c index a7639290..d78a7684 100644 --- a/src/bookmarks/backend/xbel.c +++ b/src/bookmarks/backend/xbel.c @@ -58,16 +58,16 @@ static unsigned char * filename_bookmarks_xbel(int writing); static int xbeltree_to_bookmarks_list(struct tree_node *root, struct bookmark *current_parent); static void write_bookmarks_list(struct secure_save_info *ssi, - struct list_head *bookmarks_list, + LIST_OF(struct bookmark) *bookmarks_list, int n, int folder_state); static void write_bookmarks_xbel(struct secure_save_info *ssi, - struct list_head *bookmarks_list); + LIST_OF(struct bookmark) *bookmarks_list); /* Element */ struct tree_node { unsigned char *name; /* Name of the element */ unsigned char *text; /* Text inside the element */ - struct list_head attrs; /* {struct attributes} */ + LIST_OF(struct attributes) attrs; struct tree_node *parent; struct tree_node *children; @@ -134,7 +134,7 @@ read_bookmarks_xbel(FILE *f) static void write_bookmarks_xbel(struct secure_save_info *ssi, - struct list_head *bookmarks_list) + LIST_OF(struct bookmarks) *bookmarks_list) { int folder_state = get_opt_bool("bookmarks.folder_state"); /* We check for readok in filename_bookmarks_xbel(). */ @@ -208,7 +208,7 @@ print_xml_entities(struct secure_save_info *ssi, const unsigned char *str) static void write_bookmarks_list(struct secure_save_info *ssi, - struct list_head *bookmarks_list, + LIST_OF(struct bookmark) *bookmarks_list, int n, int folder_state) { struct bookmark *bm; diff --git a/src/bookmarks/bookmarks.c b/src/bookmarks/bookmarks.c index f9e9a45e..3439d901 100644 --- a/src/bookmarks/bookmarks.c +++ b/src/bookmarks/bookmarks.c @@ -32,7 +32,7 @@ #include "util/string.h" /* The list of bookmarks */ -INIT_LIST_HEAD(bookmarks); +INIT_LIST_OF(struct bookmark, bookmarks); /* Set to 1, if bookmarks have changed. */ static int bookmarks_dirty = 0; @@ -147,8 +147,8 @@ init_bookmarks(struct module *module) /* Clears the bookmark list */ static void -free_bookmarks(struct list_head *bookmarks_list, - struct list_head *box_items) +free_bookmarks(LIST_OF(struct bookmark) *bookmarks_list, + LIST_OF(struct listbox_item) *box_items) { struct bookmark *bm; @@ -441,7 +441,7 @@ struct bookmark * get_bookmark_by_name(struct bookmark *folder, unsigned char *title) { struct bookmark *bookmark; - struct list_head *lh; + LIST_OF(struct bookmark) *lh; lh = folder ? &folder->child : &bookmarks; diff --git a/src/bookmarks/bookmarks.h b/src/bookmarks/bookmarks.h index 4c576aa7..84fcc73f 100644 --- a/src/bookmarks/bookmarks.h +++ b/src/bookmarks/bookmarks.h @@ -20,12 +20,12 @@ struct bookmark { unsigned char *title; /* title of bookmark */ unsigned char *url; /* Location of bookmarked item */ - struct list_head child; + LIST_OF(struct bookmark) child; }; /* Bookmark lists */ -extern struct list_head bookmarks; /* struct bookmark */ +extern LIST_OF(struct bookmark) bookmarks; /* The bookmarks module */ diff --git a/src/bookmarks/dialogs.c b/src/bookmarks/dialogs.c index 1b020dca..66211089 100644 --- a/src/bookmarks/dialogs.c +++ b/src/bookmarks/dialogs.c @@ -344,7 +344,7 @@ enum move_bookmark_flags { * _into_ dest or, if insert_as_child is 0, _after_ dest. */ static enum move_bookmark_flags do_move_bookmark(struct bookmark *dest, int insert_as_child, - struct list_head *src, struct listbox_data *box) + LIST_OF(struct bookmark) *src, struct listbox_data *box) { static int move_bookmark_event_id = EVENT_NONE; struct bookmark *bm, *next; diff --git a/src/cache/cache.c b/src/cache/cache.c index dc746575..db9efe1e 100644 --- a/src/cache/cache.c +++ b/src/cache/cache.c @@ -24,7 +24,7 @@ #include "util/time.h" /* The list of cache entries */ -static INIT_LIST_HEAD(cache_entries); +static INIT_LIST_OF(struct cache_entry, cache_entries); static unsigned longlong cache_size; static int id_counter = 1; diff --git a/src/cache/cache.h b/src/cache/cache.h index 78180bce..8ee0ad6c 100644 --- a/src/cache/cache.h +++ b/src/cache/cache.h @@ -29,7 +29,7 @@ struct cache_entry { /* Items in this list are ALLOCATED IN A NON-STANDARD WAY! Thus if you * are gonna mess with them (you shouldn't), you need to use the * mmap suite. */ - struct list_head frag; /* -> struct fragment */ + LIST_OF(struct fragment) frag; struct uri *uri; /* Identifier for the cached data */ struct uri *proxy_uri; /* Proxy identifier or same as @uri */ diff --git a/src/config/cmdline.c b/src/config/cmdline.c index 179883ae..27eb83b8 100644 --- a/src/config/cmdline.c +++ b/src/config/cmdline.c @@ -45,7 +45,7 @@ static unsigned char *remote_url; static enum retval parse_options_(int argc, unsigned char *argv[], struct option *opt, - struct list_head *url_list) + LIST_OF(struct string_list_item) *url_list) { while (argc) { argv++, argc--; @@ -116,7 +116,8 @@ unknown_option: } enum retval -parse_options(int argc, unsigned char *argv[], struct list_head *url_list) +parse_options(int argc, unsigned char *argv[], + LIST_OF(struct string_list_item) *url_list) { return parse_options_(argc, argv, cmdline_options, url_list); } diff --git a/src/config/cmdline.h b/src/config/cmdline.h index cb085353..4ed39042 100644 --- a/src/config/cmdline.h +++ b/src/config/cmdline.h @@ -4,6 +4,7 @@ #include "main/main.h" #include "util/lists.h" -enum retval parse_options(int, unsigned char *[], struct list_head *); +enum retval parse_options(int, unsigned char *[], + LIST_OF(struct string_list_item) *); #endif diff --git a/src/config/dialogs.c b/src/config/dialogs.c index 0203c874..6a11c63f 100644 --- a/src/config/dialogs.c +++ b/src/config/dialogs.c @@ -924,8 +924,6 @@ push_kbdbind_save_button(struct dialog_data *dlg_data, } -static INIT_LIST_HEAD(keybinding_dialog_list); - static const struct hierbox_browser_button keybinding_buttons[] = { /* [gettext_accelerator_context(.keybinding_buttons)] */ { N_("~Add"), push_kbdbind_add_button, 0 }, diff --git a/src/config/kbdbind.c b/src/config/kbdbind.c index 6a58773e..db597af6 100644 --- a/src/config/kbdbind.c +++ b/src/config/kbdbind.c @@ -27,7 +27,7 @@ static struct action_list action_table[KEYMAP_MAX]; static struct keymap keymap_table[KEYMAP_MAX]; -static struct list_head keymaps[KEYMAP_MAX]; /* struct keybinding */ +static LIST_OF(struct keybinding) keymaps[KEYMAP_MAX]; static void add_default_keybindings(void); @@ -318,12 +318,12 @@ get_keymap_name(enum keymap_id keymap_id) } -struct key { - unsigned char *str; - int num; +struct named_key { + const unsigned char *str; + term_event_key_T num; }; -static struct key key_table[] = { +static const struct named_key key_table[] = { { "Enter", KBD_ENTER }, { "Space", ' ' }, { "Backspace", KBD_BS }, @@ -351,13 +351,13 @@ static struct key key_table[] = { { "F10", KBD_F10 }, { "F11", KBD_F11 }, { "F12", KBD_F12 }, - { NULL, 0 } + { NULL, KBD_UNDEF } }; term_event_key_T read_key(const unsigned char *key_str) { - struct key *key; + const struct named_key *key; if (key_str[0] && !key_str[1]) return key_str[0]; @@ -438,8 +438,8 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd, int escape) { unsigned char key_buffer[3] = "\\x"; - unsigned char *key_string = NULL; - struct key *key; + const unsigned char *key_string = NULL; + const struct named_key *key; if (kbd->key == KBD_UNDEF) return; @@ -459,7 +459,7 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd, if (!key_string) { key_string = key_buffer + 1; - *key_string = (unsigned char) kbd->key; + key_buffer[1] = (unsigned char) kbd->key; if (escape && strchr("'\"\\", kbd->key)) key_string--; } diff --git a/src/config/options.c b/src/config/options.c index 43d22446..025c9def 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -52,7 +52,7 @@ * (struct option *) instead. This applies to bookmarks, global history and * listbox items as well, though. --pasky */ -static INIT_LIST_HEAD(options_root_tree); +static INIT_LIST_OF(struct option, options_root_tree); static struct option options_root = INIT_OPTION( /* name: */ "", @@ -68,7 +68,7 @@ struct option *config_options; struct option *cmdline_options; static void add_opt_rec(struct option *, unsigned char *, struct option *); -static void free_options_tree(struct list_head *, int recursive); +static void free_options_tree(LIST_OF(struct option) *, int recursive); #ifdef CONFIG_DEBUG /* Detect ending '.' (and some others) in options captions. @@ -305,8 +305,8 @@ get_opt_( static void add_opt_sort(struct option *tree, struct option *option, int abi) { - struct list_head *cat = tree->value.tree; - struct list_head *bcat = &tree->box_item->child; + LIST_OF(struct option) *cat = tree->value.tree; + LIST_OF(struct listbox_item) *bcat = &tree->box_item->child; struct option *pos; /* The list is empty, just add it there. */ @@ -477,7 +477,7 @@ add_opt(struct option *tree, unsigned char *path, unsigned char *capt, mem_free(option); return NULL; } - option->value.tree = (struct list_head *) value; + option->value.tree = (LIST_OF(struct option) *) value; break; case OPT_STRING: if (!value) { @@ -642,10 +642,10 @@ copy_option(struct option *template) return option; } -struct list_head * +LIST_OF(struct option) * init_options_tree(void) { - struct list_head *ptr = mem_alloc(sizeof(*ptr)); + LIST_OF(struct option) *ptr = mem_alloc(sizeof(*ptr)); if (ptr) init_list(*ptr); return ptr; @@ -700,7 +700,7 @@ init_options(void) } static void -free_options_tree(struct list_head *tree, int recursive) +free_options_tree(LIST_OF(struct option) *tree, int recursive) { while (!list_empty(*tree)) delete_option_do(tree->next, recursive); @@ -730,7 +730,7 @@ register_change_hooks(const struct change_hook_info *change_hooks) } void -unmark_options_tree(struct list_head *tree) +unmark_options_tree(LIST_OF(struct option) *tree) { struct option *option; @@ -742,7 +742,7 @@ unmark_options_tree(struct list_head *tree) } void -watermark_deleted_options(struct list_head *tree) +watermark_deleted_options(LIST_OF(struct option) *tree) { struct option *option; @@ -755,7 +755,7 @@ watermark_deleted_options(struct list_head *tree) } static int -check_nonempty_tree(struct list_head *options) +check_nonempty_tree(LIST_OF(struct option) *options) { struct option *opt; @@ -773,7 +773,8 @@ check_nonempty_tree(struct list_head *options) void smart_config_string(struct string *str, int print_comment, int i18n, - struct list_head *options, unsigned char *path, int depth, + LIST_OF(struct option) *options, + unsigned char *path, int depth, void (*fn)(struct string *, struct option *, unsigned char *, int, int, int, int)) { @@ -917,7 +918,7 @@ change_hook_ui(struct session *ses, struct option *current, struct option *chang /* Bit 2 of show means we should always set visibility, otherwise we set it * only on templates. */ static void -update_visibility(struct list_head *tree, int show) +update_visibility(LIST_OF(struct option) *tree, int show) { struct option *opt; diff --git a/src/config/options.h b/src/config/options.h index 77e2a157..15d9d794 100644 --- a/src/config/options.h +++ b/src/config/options.h @@ -84,7 +84,7 @@ struct session; /* session/session.h */ union option_value { /* XXX: Keep first to make @options_root initialization possible. */ /* The OPT_TREE list_head is allocated. */ - struct list_head *tree; + LIST_OF(struct option) *tree; /* Used by OPT_BOOL, OPT_INT, OPT_CODEPAGE and OPT_LANGUAGE */ int number; @@ -142,7 +142,7 @@ struct option { }; #define INIT_OPTION(name, flags, type, min, max, value, desc, capt) \ - { NULL_LIST_HEAD, INIT_OBJECT("option"), name, flags, type, min, max, { (struct list_head *) (value) }, desc, capt } + { NULL_LIST_HEAD, INIT_OBJECT("option"), name, flags, type, min, max, { (LIST_OF(struct option) *) (value) }, desc, capt } extern struct option *config_options; extern struct option *cmdline_options; @@ -160,12 +160,14 @@ struct change_hook_info { extern void register_change_hooks(const struct change_hook_info *change_hooks); -extern struct list_head *init_options_tree(void); -extern void unmark_options_tree(struct list_head *); -void watermark_deleted_options(struct list_head *); +extern LIST_OF(struct option) *init_options_tree(void); +extern void unmark_options_tree(LIST_OF(struct option) *); +void watermark_deleted_options(LIST_OF(struct option) *); -extern void smart_config_string(struct string *, int, int, struct list_head *, unsigned char *, int, - void (*)(struct string *, struct option *, unsigned char *, int, int, int, int)); +extern void smart_config_string(struct string *, int, int, + LIST_OF(struct option) *, unsigned char *, int, + void (*)(struct string *, struct option *, + unsigned char *, int, int, int, int)); extern struct option *copy_option(struct option *); extern void delete_option(struct option *); diff --git a/src/config/opttypes.c b/src/config/opttypes.c index bc29b225..3a5c8915 100644 --- a/src/config/opttypes.c +++ b/src/config/opttypes.c @@ -368,8 +368,8 @@ color_wr(struct option *opt, struct string *str) static void tree_dup(struct option *opt, struct option *template) { - struct list_head *new = init_options_tree(); - struct list_head *tree = template->value.tree; + LIST_OF(struct option) *new = init_options_tree(); + LIST_OF(struct option) *tree = template->value.tree; struct option *option; if (!new) return; diff --git a/src/cookies/cookies.c b/src/cookies/cookies.c index 30269df7..639e8a60 100644 --- a/src/cookies/cookies.c +++ b/src/cookies/cookies.c @@ -51,7 +51,7 @@ static int cookies_nosave = 0; -static INIT_LIST_HEAD(cookies); +static INIT_LIST_OF(struct cookie, cookies); struct c_domain { LIST_HEAD(struct c_domain); @@ -64,11 +64,10 @@ struct c_domain { * struct c_domain. No other data structures have pointers to these * objects. Currently the domains remain in the list until * @done_cookies clears the whole list. */ -static INIT_LIST_HEAD(c_domains); +static INIT_LIST_OF(struct c_domain, c_domains); -/* List of servers for which there are cookies. Each element is a - * struct cookie_server. */ -static INIT_LIST_HEAD(cookie_servers); +/* List of servers for which there are cookies. */ +static INIT_LIST_OF(struct cookie_server, cookie_servers); /* Only @set_cookies_dirty may make this nonzero. */ static int cookies_dirty = 0; @@ -908,7 +907,7 @@ init_cookies(struct module *module) /* Like @delete_cookie, this function does not set @cookies_dirty. * The caller must do that if appropriate. */ static void -free_cookies_list(struct list_head *list) +free_cookies_list(LIST_OF(struct cookie) *list) { while (!list_empty(*list)) { struct cookie *cookie = list->next; diff --git a/src/cookies/dialogs.c b/src/cookies/dialogs.c index f4df50c8..696cad59 100644 --- a/src/cookies/dialogs.c +++ b/src/cookies/dialogs.c @@ -25,7 +25,7 @@ #include "util/string.h" -INIT_LIST_HEAD(cookie_queries); +INIT_LIST_OF(struct cookie, cookie_queries); static void add_cookie_info_to_string(struct string *string, struct cookie *cookie, diff --git a/src/cookies/dialogs.h b/src/cookies/dialogs.h index a7b6c214..8896d3f1 100644 --- a/src/cookies/dialogs.h +++ b/src/cookies/dialogs.h @@ -6,7 +6,7 @@ #include "terminal/terminal.h" #include "util/lists.h" -extern struct list_head cookie_queries; +extern LIST_OF(struct cookie) cookie_queries; void accept_cookie_dialog(struct session *ses, void *data); extern struct hierbox_browser cookie_browser; diff --git a/src/dialogs/menu.c b/src/dialogs/menu.c index 172965ca..744a4b78 100644 --- a/src/dialogs/menu.c +++ b/src/dialogs/menu.c @@ -812,7 +812,7 @@ enum frame_event_status pass_uri_to_command(struct session *ses, struct document_view *doc_view, int which_type) { - struct list_head *tree = get_opt_tree("document.uri_passing"); + LIST_OF(struct option) *tree = get_opt_tree("document.uri_passing"); enum pass_uri_type type = which_type; struct menu_item *items; struct option *option; @@ -887,7 +887,7 @@ void add_uri_command_to_menu(struct menu_item **mi, enum pass_uri_type type, unsigned char *text) { - struct list_head *tree = get_opt_tree("document.uri_passing"); + LIST_OF(struct option) *tree = get_opt_tree("document.uri_passing"); struct option *option; int commands = 0; enum menu_item_flags flags = NO_FLAG; diff --git a/src/document/css/apply.c b/src/document/css/apply.c index 05072d12..703eea8f 100644 --- a/src/document/css/apply.c +++ b/src/document/css/apply.c @@ -1,4 +1,10 @@ -/* CSS style applier */ +/** CSS style applier + * @file + * + * @todo TODO: A way to disable CSS completely, PLUS a way to stop + * various property groups from taking effect. (Ie. way to turn out + * effect of 'display: none' or aligning or colors but keeping all the + * others.) --pasky */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -28,11 +34,6 @@ #include "document/html/internal.h" -/* TODO: A way to disable CSS completely, PLUS a way to stop various property - * groups from taking effect. (Ie. way to turn out effect of 'display: none' - * or aligning or colors but keeping all the others.) --pasky */ - - typedef void (*css_applier_T)(struct html_context *html_context, struct html_element *element, struct css_property *prop); @@ -89,8 +90,9 @@ css_apply_font_attribute(struct html_context *html_context, element->attr.style.attr &= ~prop->value.font_attribute.rem; } -/* FIXME: Because the current CSS doesn't provide reasonable defaults for each - * HTML element this applier will cause bad rendering of
 tags. */
+/** @bug FIXME: Because the current CSS doesn't provide reasonable
+ * defaults for each HTML element this applier will cause bad
+ * rendering of @
 tags. */
 static void
 css_apply_text_align(struct html_context *html_context,
 		     struct html_element *element, struct css_property *prop)
@@ -99,8 +101,8 @@ css_apply_text_align(struct html_context *html_context,
 	element->parattr.align = prop->value.text_align;
 }
 
-/* XXX: Sort like the css_property_type */
-static css_applier_T css_appliers[CSS_PT_LAST] = {
+/*! XXX: Sort like the css_property_type */
+static const css_applier_T css_appliers[CSS_PT_LAST] = {
 	/* CSS_PT_NONE */		NULL,
 	/* CSS_PT_BACKGROUND */		css_apply_background_color,
 	/* CSS_PT_BACKGROUND_COLOR */	css_apply_background_color,
@@ -113,11 +115,12 @@ static css_applier_T css_appliers[CSS_PT_LAST] = {
 	/* CSS_PT_WHITE_SPACE */	css_apply_font_attribute,
 };
 
-/* This looks for a match in list of selectors. */
+/** This looks for a match in list of selectors. */
 static void
 examine_element(struct html_context *html_context, struct css_selector *base,
 		enum css_selector_type seltype, enum css_selector_relation rel,
-		struct css_selector_set *selectors, struct html_element *element)
+		struct css_selector_set *selectors,
+		struct html_element *element)
 {
 	struct css_selector *selector;
 
@@ -142,7 +145,7 @@ examine_element(struct html_context *html_context, struct css_selector *base,
 		merge_css_selectors(base, sel); \
 		/* Ancestor matches? */ \
 		if (sel->leaves.may_contain_rel_ancestor_or_parent \
-		    && (struct list_head *) element->next \
+		    && (LIST_OF(struct html_element) *) element->next \
 		     != &html_context->stack) { \
 			struct html_element *ancestor; \
 			/* This is less effective than doing reverse iterations,
@@ -152,7 +155,7 @@ examine_element(struct html_context *html_context, struct css_selector *base,
 			 * have to duplicate the whole examine_element(), so if
 			 * profiles won't show it really costs... */ \
 			for (ancestor = element->next; \
-			     (struct list_head *) ancestor \
+			     (LIST_OF(struct html_element) *) ancestor	\
 			      != &html_context->stack;\
 			     ancestor = ancestor->next) \
 				examine_element(html_context, base, \
@@ -221,7 +224,7 @@ struct css_selector *
 get_css_selector_for_element(struct html_context *html_context,
 			     struct html_element *element,
 			     struct css_stylesheet *css,
-			     struct list_head *html_stack)
+			     LIST_OF(struct html_element) *html_stack)
 {
 	unsigned char *code;
 	struct css_selector *selector;
@@ -281,7 +284,7 @@ apply_css_selector_style(struct html_context *html_context,
 
 void
 css_apply(struct html_context *html_context, struct html_element *element,
-	  struct css_stylesheet *css, struct list_head *html_stack)
+	  struct css_stylesheet *css, LIST_OF(struct html_element) *html_stack)
 {
 	struct css_selector *selector;
 
diff --git a/src/document/css/apply.h b/src/document/css/apply.h
index 61423152..c5e2fa7f 100644
--- a/src/document/css/apply.h
+++ b/src/document/css/apply.h
@@ -1,3 +1,6 @@
+/*! @file
+ * This is the main entry point for the CSS micro-engine. It throws
+ * all the power of the stylesheets at a given element. */
 
 #ifndef EL__DOCUMENT_CSS_APPLY_H
 #define EL__DOCUMENT_CSS_APPLY_H
@@ -8,28 +11,26 @@ struct css_stylesheet;
 struct html_context;
 struct html_element;
 
-/* This is the main entry point for the CSS micro-engine. It throws all the
- * power of the stylesheets at a given element. */
-
-/* Gather all style information for the given @element, so it can later be
- * applied. Returned value should be freed using done_css_selector(). */
+/** Gather all style information for the given @a element, so it can later be
+ * applied. Returned value should be freed using done_css_selector().  */
 struct css_selector *
 get_css_selector_for_element(struct html_context *html_context,
 			     struct html_element *element,
 			     struct css_stylesheet *css,
-			     struct list_head *html_stack);
+			     LIST_OF(struct html_element) *html_stack);
 
 
-/* Apply properties from an existing selector. */
+/** Apply properties from an existing selector. */
 void
 apply_css_selector_style(struct html_context *html_context,
 			 struct html_element *element,
 			 struct css_selector *selector);
 
-/* This function takes @element and applies its 'style' attribute onto its
+/** This function takes @a element and applies its 'style' attribute onto its
  * attributes (if it contains such an attribute). */
 void
 css_apply(struct html_context *html_context, struct html_element *element,
-	  struct css_stylesheet *css, struct list_head *html_stack);
+	  struct css_stylesheet *css,
+	  LIST_OF(struct html_element) *html_stack);
 
 #endif
diff --git a/src/document/css/css.c b/src/document/css/css.c
index 46d4dcdd..28b717f4 100644
--- a/src/document/css/css.c
+++ b/src/document/css/css.c
@@ -1,4 +1,5 @@
-/* CSS module management */
+/** CSS module management
+ * @file */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -124,7 +125,8 @@ static int
 change_hook_css(struct session *ses, struct option *current, struct option *changed)
 {
 	if (!strcmp(changed->name, "stylesheet")) {
-		/* TODO: We need to update all entries in format cache. --jonas */
+		/** @todo TODO: We need to update all entries in
+		 * format cache. --jonas */
 		import_default_css();
 	}
 
diff --git a/src/document/css/css.h b/src/document/css/css.h
index 5bd1e193..458300ef 100644
--- a/src/document/css/css.h
+++ b/src/document/css/css.h
@@ -6,20 +6,21 @@ struct css_stylesheet;
 struct module;
 struct uri;
 
-/* TODO: Basicly we need two default stylesheets. One that ELinks controls
- * (which is defined by the defaults of every property, they could however also
- * be loadable at startup time, e.g. when/if we will have a very generalised
- * renderer it would be possible to bypass the HTML renderer but would simply
- * use a HTML stylesheet like the one in CSS2 Appendix A. "A sample style sheet
- * for HTML 4.0") and one that the user controls. They should be remerged when
- * ever the user reloads the user stylesheet but else they should be pretty
- * static. Together they defines the basic layouting should be done when
- * rendering the document. */
+/** @todo TODO: Basicly we need two default stylesheets. One that
+ * ELinks controls (which is defined by the defaults of every
+ * property, they could however also be loadable at startup time,
+ * e.g. when/if we will have a very generalised renderer it would be
+ * possible to bypass the HTML renderer but would simply use a HTML
+ * stylesheet like the one in CSS2 Appendix A. "A sample style sheet
+ * for HTML 4.0") and one that the user controls. They should be
+ * remerged when ever the user reloads the user stylesheet but else
+ * they should be pretty static. Together they defines the basic
+ * layouting should be done when rendering the document. */
 extern struct css_stylesheet default_stylesheet;
 
 extern struct module css_module;
 
-/* This function will try to import the given @url from the cache. */
+/** This function will try to import the given @a url from the cache. */
 void import_css(struct css_stylesheet *css, struct uri *uri);
 
 #endif
diff --git a/src/document/css/parser.c b/src/document/css/parser.c
index 7ef1a9b0..d51b3e51 100644
--- a/src/document/css/parser.c
+++ b/src/document/css/parser.c
@@ -1,4 +1,5 @@
-/* CSS main parser */
+/** CSS main parser
+ * @file */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -23,7 +24,8 @@
 
 
 void
-css_parse_properties(struct list_head *props, struct scanner *scanner)
+css_parse_properties(LIST_OF(struct css_property) *props,
+		     struct scanner *scanner)
 {
 	assert(props && scanner);
 
@@ -108,8 +110,11 @@ skip_css_block(struct scanner *scanner)
 	}
 }
 
-/* Atrules grammer:
+/** Parse an atrule from @a scanner and update @a css accordingly.
  *
+ * Atrules grammar:
+ *
+ * @verbatim
  * media_types:
  *	  
  *	| 
@@ -122,6 +127,7 @@ skip_css_block(struct scanner *scanner)
  *	| '@media' media_types '{' ruleset* '}'
  *	| '@page' ? [':' ]? '{' properties '}'
  *	| '@font-face' '{' properties '}'
+ * @endverbatim
  */
 static void
 css_parse_atrule(struct css_stylesheet *css, struct scanner *scanner,
@@ -184,18 +190,19 @@ struct selector_pkg {
 /** Move a CSS selector and its leaves into a new set.  If a similar
  * selector already exists in the set, merge them.
  *
- * \param sels
- *   The set to which \a selector should be moved.  Must not be NULL.
- * \param selector
+ * @param sels
+ *   The set to which @a selector should be moved.  Must not be NULL.
+ * @param selector
  *   The selector that should be moved.  Must not be NULL.  If it is
  *   already in some set, this function removes it from there.
- * \param watch
- *   This function updates \a *watch if it merges that selector into
- *   another one.  \a watch must not be NULL but \a *watch may be.
+ * @param watch
+ *   This function updates @a *watch if it merges that selector into
+ *   another one.  @a watch must not be NULL but @a *watch may be.
  *
- * \return \a selector or the one into which it was merged.  */
+ * @returns @a selector or the one into which it was merged.  */
 static struct css_selector *
-reparent_selector(struct css_selector_set *sels, struct css_selector *selector,
+reparent_selector(struct css_selector_set *sels,
+                  struct css_selector *selector,
                   struct css_selector **watch)
 {
 	struct css_selector *twin = find_css_selector(sels, selector->type,
@@ -222,16 +229,22 @@ reparent_selector(struct css_selector_set *sels, struct css_selector *selector,
 	return twin ? twin : selector;
 }
 
-/* Our selector grammar:
+/** Parse a comma-separated list of CSS selectors from @a scanner.
+ * Register the selectors in @a css so that get_css_selector_for_element()
+ * will find them, and add them to @a selectors so that the caller can
+ * attach properties to them.
  *
+ * Our selector grammar:
+ *
+ * @verbatim
  * selector:
  *	  element_name? ('#' id)? ('.' class)? (':' pseudo_class)? \
  *		  ((' ' | '>') selector)?
- *
+ * @endverbatim
  */
 static void
 css_parse_selector(struct css_stylesheet *css, struct scanner *scanner,
-		   struct list_head *selectors)
+		   LIST_OF(struct selector_pkg) *selectors)
 {
 	/* Shell for the last selector (the whole selector chain, that is). */
 	struct selector_pkg *pkg = NULL;
@@ -464,16 +477,20 @@ css_parse_selector(struct css_stylesheet *css, struct scanner *scanner,
 }
 
 
-/* Ruleset grammar:
+/** Parse a ruleset from @a scanner to @a css.
  *
+ * Ruleset grammar:
+ *
+ * @verbatim
  * ruleset:
  *	  selector [ ',' selector ]* '{' properties '}'
+ * @endverbatim
  */
 static void
 css_parse_ruleset(struct css_stylesheet *css, struct scanner *scanner)
 {
-	INIT_LIST_HEAD(selectors);
-	INIT_LIST_HEAD(properties);
+	INIT_LIST_OF(struct selector_pkg, selectors);
+	INIT_LIST_OF(struct css_property, properties);
 	struct selector_pkg *pkg;
 
 	css_parse_selector(css, scanner, &selectors);
diff --git a/src/document/css/parser.h b/src/document/css/parser.h
index e9003f42..645d0525 100644
--- a/src/document/css/parser.h
+++ b/src/document/css/parser.h
@@ -1,3 +1,6 @@
+/*! @file
+ * This is interface for the value parser. It is intended to be used
+ * only internally inside of the CSS engine. */
 
 #ifndef EL__DOCUMENT_CSS_PARSER_H
 #define EL__DOCUMENT_CSS_PARSER_H
@@ -7,19 +10,17 @@ struct scanner;
 struct css_stylesheet;
 struct uri;
 
-/* This is interface for the value parser. It is intended to be used only
- * internally inside of the CSS engine. */
-
-/* This function takes a semicolon separated list of declarations from the
- * given string, parses them to atoms, and chains the newly created {struct
- * css_property}es to the specified list. The function returns positive value
- * in case it recognized a property in the given string, or zero in case of an
- * error. */
-void css_parse_properties(struct list_head *props, struct scanner *scanner);
+/** This function takes a semicolon separated list of declarations
+ * from the given string, parses them to atoms, and chains the newly
+ * created struct css_property objects to the specified list.
+ * @returns positive value in case it recognized a property in the
+ * given string, or zero in case of an error. */
+void css_parse_properties(LIST_OF(struct css_property) *props,
+			  struct scanner *scanner);
 
 
-/* Parses the @string and adds any recognized selectors + properties to the
- * given stylesheet @css. If the selector is already in the stylesheet it
+/** Parses the @a string and adds any recognized selectors + properties to the
+ * 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,
 			  unsigned char *string, unsigned char *end);
diff --git a/src/document/css/property.c b/src/document/css/property.c
index e379f328..553bbcfd 100644
--- a/src/document/css/property.c
+++ b/src/document/css/property.c
@@ -1,4 +1,5 @@
-/* CSS property info */
+/** CSS property info
+ * @file */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -12,8 +13,8 @@
 #include "document/css/value.h"
 
 
-/* TODO: Use fastfind when we get a lot of properties. */
-/* XXX: But only _WHEN_ we get _A LOT_ of properties, zas! ;-) --pasky */
+/** @todo TODO: Use fastfind when we get a lot of properties.
+ * XXX: But only _WHEN_ we get _A LOT_ of properties, zas! ;-) --pasky */
 struct css_property_info css_property_info[CSS_PT_LAST] = {
 	{ "background",		CSS_PT_BACKGROUND,	 CSS_VT_COLOR,		css_parse_background_value },
 	{ "background-color",	CSS_PT_BACKGROUND_COLOR, CSS_VT_COLOR,		css_parse_color_value },
diff --git a/src/document/css/property.h b/src/document/css/property.h
index 0801026e..c362801b 100644
--- a/src/document/css/property.h
+++ b/src/document/css/property.h
@@ -6,16 +6,14 @@
 #include "util/color.h"
 #include "util/lists.h"
 
-/* The {struct css_property} describes one CSS declaration in a rule, therefore
- * being basically a parsed instance of {struct css_property_info}. One list of
+/** The struct css_property describes one CSS declaration in a rule, therefore
+ * being basically a parsed instance of struct css_property_info. One list of
  * these contains all the declarations contained in one rule. */
-
 struct css_property {
 	LIST_HEAD(struct css_property);
 
-	/* Declared property. The enum item name is derived from the property
-	 * name, just uppercase it and tr/-/_/. */
-
+	/** Declared property. The enum item name is derived from the
+	 * property name, just uppercase it and tr/-/_/. */
 	enum css_property_type {
 		CSS_PT_NONE,
 		CSS_PT_BACKGROUND,
@@ -30,9 +28,7 @@ struct css_property {
 		CSS_PT_LAST,
 	} type;
 
-	/* Property value. If it is a pointer, it points always to a memory
-	 * to be free()d together with this structure. */
-
+	/** Type of the property value.  Discriminates the #value union.  */
 	enum css_property_value_type {
 		CSS_VT_NONE,
 		CSS_VT_COLOR,
@@ -41,6 +37,9 @@ struct css_property {
 		CSS_VT_TEXT_ALIGN,
 		CSS_VT_LAST,
 	} value_type;
+
+	/** Property value. If it is a pointer, it points always to a
+	 * memory to be free()d together with this structure. */
 	union css_property_value {
 		void *none;
 		color_T color;
@@ -61,40 +60,40 @@ struct css_property {
 	} value;
 };
 
-/* The {struct css_property_info} describes what values the properties can
- * have and what internal type they have. */
-
 struct css_property_info;
 struct scanner;
 typedef int (*css_property_value_parser_T)(struct css_property_info *propinfo,
 					 union css_property_value *value,
 					 struct scanner *scanner);
 
+/** 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;
 	enum css_property_type type;
 
-	/* This is the storage type, basically describing what to save to
+	/** This is the storage type, basically describing what to save to
 	 * css_property.value. Many properties can share the same valtype.
 	 * The value is basically output of the value parser. */
 	enum css_property_value_type value_type;
 
-	/* This is the property value parser, processing the written form of a
-	 * property value. Its job is to take the value string (or scanner's
-	 * token list in the future) and transform it to a @value form
-	 * according to the property's @value_type. Although some properties
-	 * can share a parser, it is expected that most properties will either
-	 * use a custom one or use a generic parser with property-specific
-	 * backend specified in @parser_data. */
+	/** This is the property value parser, processing the written
+	 * form of a property value. Its job is to take the value
+	 * string (or scanner's token list in the future) and
+	 * transform it to a union css_property_value according to the
+	 * property's #value_type. Although some properties can share
+	 * a parser, it is expected that most properties will either
+	 * use a custom one or use a generic parser with
+	 * property-specific backend specified in #parser_data. */
 	css_property_value_parser_T parser;
 
-	/* In case you use a generic @parser, it can be useful to still give
-	 * it some specific data. You can do so through @parser_data. The
-	 * content is @parser-specific. */
+	/** In case you use a generic #parser, it can be useful to still give
+	 * it some specific data. You can do so through @c parser_data. The
+	 * content is #parser-specific. */
 	void *parser_data;
 };
 
-/* This table contains info about all the known CSS properties. */
+/** This table contains info about all the known CSS properties. */
 extern struct css_property_info css_property_info[];
 
 #endif
diff --git a/src/document/css/scanner.c b/src/document/css/scanner.c
index 0781968c..cb927a2f 100644
--- a/src/document/css/scanner.c
+++ b/src/document/css/scanner.c
@@ -1,4 +1,5 @@
-/* CSS token scanner utilities */
+/** CSS token scanner utilities
+ * @file */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -15,8 +16,7 @@
 #include "util/string.h"
 
 
-/* Bitmap entries for the CSS character groups used in the scanner table */
-
+/** Bitmap entries for the CSS character groups used in the scanner table */
 enum css_char_group {
 	CSS_CHAR_ALPHA		= (1 << 0),
 	CSS_CHAR_DIGIT		= (1 << 1),
diff --git a/src/document/css/scanner.h b/src/document/css/scanner.h
index 4820a0a6..5db7d853 100644
--- a/src/document/css/scanner.h
+++ b/src/document/css/scanner.h
@@ -4,88 +4,94 @@
 
 #include "util/scanner.h"
 
-/* The various token types and what they contain. Patterns taken from
- * the flex scanner declarations in the CSS 2 Specification. */
+/** The various token types and what they contain. Patterns taken from
+ * the flex scanner declarations in the CSS 2 Specification.
+ *
+ * Char tokens range from 1 to 255 and have their char value as type
+ * meaning non char tokens have values from 256 and up.
+ *
+ * @verbatim
+ * {...} means char group, <...> means token
+ * {identstart}	[a-z_]|{nonascii}
+ * {ident}	[a-z0-9_-]|{nonascii}
+ * 	{identstart}{ident}*
+ * 	{ident}+
+ * 	[0-9]+|[0-9]*"."[0-9]+
+ * @endverbatim */
 enum css_token_type {
-	/* Char tokens: */
-
-	/* Char tokens range from 1 to 255 and have their char value as type */
-	/* meaning non char tokens have values from 256 and up. */
+	/* Doxygen 1.5.2 does not support member groups inside enum.  */
 
 	/* Low level string tokens: */
 
-	/* {...} means char group, <...> means token */
-	/* {identstart}	[a-z_]|{nonascii} */
-	/* {ident}	[a-z0-9_-]|{nonascii} */
-	/* 	{identstart}{ident}* */
-	/* 	{ident}+ */
-	/* 	[0-9]+|[0-9]*"."[0-9]+ */
-
-	/* Percentage is put because although it looks like being composed of
-	 *  and '%' floating point numbers are really not allowed but
-	 * strtol() will round it down for us ;) */
-	CSS_TOKEN_IDENT = 256,	/*  */
-	CSS_TOKEN_NUMBER,	/*  */
-	CSS_TOKEN_PERCENTAGE,	/* % */
-	CSS_TOKEN_STRING,	/* Char sequence delimted by matching ' or " */
+	CSS_TOKEN_IDENT = 256,	/**< @ */
+	CSS_TOKEN_NUMBER,	/**< @ */
+	/*! Percentage is put because although it looks like being composed
+	 * of @ and '@%' floating point numbers are really not
+	 * allowed but strtol() will round it down for us ;) */
+	CSS_TOKEN_PERCENTAGE,	/**< @% */
+	CSS_TOKEN_STRING,	/**< Char sequence delimited by matching ' or " */
 
 	/* High level string tokens: */
 
 	/* The various number values; dimension being the most generic */
-	CSS_TOKEN_ANGLE,	/* rad, grad or deg */
-	CSS_TOKEN_DIMENSION,	/*  */
-	CSS_TOKEN_EM,		/* em */
-	CSS_TOKEN_EX,		/* ex */
-	CSS_TOKEN_FREQUENCY,	/* Hz or kHz */
-	CSS_TOKEN_LENGTH,	/* {px,cm,mm,in,pt,pc} */
-	CSS_TOKEN_TIME,		/* ms or s */
+	CSS_TOKEN_ANGLE,	/**< @rad, @grad or @deg */
+	CSS_TOKEN_DIMENSION,	/**< @@ */
+	CSS_TOKEN_EM,		/**< @em */
+	CSS_TOKEN_EX,		/**< @ex */
+	CSS_TOKEN_FREQUENCY,	/**< @Hz or @kHz */
+	CSS_TOKEN_LENGTH,	/**< @{px,cm,mm,in,pt,pc} */
+	CSS_TOKEN_TIME,		/**< @ms or @s */
 
-	/* XXX: CSS_TOKEN_HASH conflicts with CSS_TOKEN_HEX_COLOR. Generating
-	 * hex color tokens has precedence and the hash token user have to
-	 * treat CSS_TOKEN_HASH and CSS_TOKEN_HEX_COLOR alike. */
-	CSS_TOKEN_HASH,		/* # */
-	CSS_TOKEN_HEX_COLOR,	/* #[0-9a-f]\{3,6} */
+	/*! XXX: @c CSS_TOKEN_HASH conflicts with #CSS_TOKEN_HEX_COLOR.
+	 * Generating hex color tokens has precedence and the hash token
+	 * user have to treat @c CSS_TOKEN_HASH and #CSS_TOKEN_HEX_COLOR
+	 * alike. */
+	CSS_TOKEN_HASH,		/**< #@ */
+	CSS_TOKEN_HEX_COLOR,	/**< #[0-9a-f]@\{3,6} */
 
-	/* For all unknown functions we generate on token contain both function name
-	 * and args so scanning/parsing is easier. Besides we already check for
-	 * ending ')'. */
-	/* For known functions where we need several args [like rgb()] we want
-	 * to generate tokens for every arg and arg delimiter ( ',' or ')' ).
-	 * Because url() is a bit triggy: it can contain both  and some
-	 * chars that would other wise make the scanner probably choke we also
-	 * include the arg in that token. Besides it will make things like
-	 * 'background' property parsing easier. */
-	CSS_TOKEN_FUNCTION,	/* () */
-	CSS_TOKEN_RGB,		/* rgb( */
-	CSS_TOKEN_URL,		/* url() */
+	/*! For all unknown functions we generate on token contain both
+	 * function name and args so scanning/parsing is easier. Besides
+	 * we already check for ending ')'.  */
+	CSS_TOKEN_FUNCTION,	/**< @(@) */
+	/*! For known functions where we need several args [like rgb()]
+	 * we want to generate tokens for every arg and arg delimiter
+	 * ( ',' or ')' ). */
+	CSS_TOKEN_RGB,		/**< rgb( */
+	/*! Because url() is a bit triggy: it can contain both @
+	 * and some chars that would other wise make the scanner probably
+	 * choke we also include the arg in that token. Besides it will
+	 * make things like 'background' property parsing easier. */
+	CSS_TOKEN_URL,		/**< url(@) */
 
 	/* @-rule symbols */
-	CSS_TOKEN_AT_KEYWORD,	/* @ */
-	CSS_TOKEN_AT_CHARSET,	/* @charset */
-	CSS_TOKEN_AT_FONT_FACE,	/* @font-face */
-	CSS_TOKEN_AT_IMPORT,	/* @import */
-	CSS_TOKEN_AT_MEDIA,	/* @media */
-	CSS_TOKEN_AT_PAGE,	/* @page */
 
-	CSS_TOKEN_IMPORTANT,	/* !important */
+	CSS_TOKEN_AT_KEYWORD,	/**< @@@ */
+	CSS_TOKEN_AT_CHARSET,	/**< @@charset */
+	CSS_TOKEN_AT_FONT_FACE,	/**< @@font-face */
+	CSS_TOKEN_AT_IMPORT,	/**< @@import */
+	CSS_TOKEN_AT_MEDIA,	/**< @@media */
+	CSS_TOKEN_AT_PAGE,	/**< @@page */
+
+	CSS_TOKEN_IMPORTANT,	/**< !@important */
 
 	/* TODO: Selector stuff: */
-	CSS_TOKEN_SELECT_SPACE_LIST,	/* ~= */
-	CSS_TOKEN_SELECT_HYPHEN_LIST,	/* |= */
-	CSS_TOKEN_SELECT_BEGIN,		/* ^= */
-	CSS_TOKEN_SELECT_END,		/* $= */
-	CSS_TOKEN_SELECT_CONTAINS,	/* *= */
+
+	CSS_TOKEN_SELECT_SPACE_LIST,	/**< ~= */
+	CSS_TOKEN_SELECT_HYPHEN_LIST,	/**< |= */
+	CSS_TOKEN_SELECT_BEGIN,		/**< ^= */
+	CSS_TOKEN_SELECT_END,		/**< $= */
+	CSS_TOKEN_SELECT_CONTAINS,	/**< *= */
 
 	/* Special tokens: */
 
-	/* A special token for unrecognized strings */
+	/** A special token for unrecognized strings */
 	CSS_TOKEN_GARBAGE,
 
-	/* Token type used internally when scanning to signal that the token
+	/** Token type used internally when scanning to signal that the token
 	 * should not be recorded in the scanners token table. */
 	CSS_TOKEN_SKIP,
 
-	/* Another internal token type used both to mark unused tokens in the
+	/** Another internal token type used both to mark unused tokens in the
 	 * scanner table as invalid or when scanning to signal that the
 	 * scanning should end. */
 	CSS_TOKEN_NONE = 0,
@@ -102,7 +108,7 @@ extern struct scanner_info css_scanner_info;
 	 (token_type) == ';' ? (1 <<  8) : \
 	 (token_type) == ')' ? (1 <<  7) : 0)
 
-/* Check whether it is safe to skip the @token when looking for @skipto. */
+/** Check whether it is safe to skip the @a type when looking for @a skipto. */
 static inline int
 check_css_precedence(int type, int skipto)
 {
diff --git a/src/document/css/stylesheet.c b/src/document/css/stylesheet.c
index 6f36ba60..815ad71e 100644
--- a/src/document/css/stylesheet.c
+++ b/src/document/css/stylesheet.c
@@ -1,4 +1,5 @@
-/* CSS stylesheet handling */
+/** CSS stylesheet handling
+ * @file */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -25,7 +26,8 @@
 
 
 struct css_selector *
-find_css_selector(struct css_selector_set *sels, enum css_selector_type type,
+find_css_selector(struct css_selector_set *sels,
+                  enum css_selector_type type,
                   enum css_selector_relation rel,
                   const unsigned char *name, int namelen)
 {
@@ -46,8 +48,8 @@ find_css_selector(struct css_selector_set *sels, enum css_selector_type type,
 
 struct css_selector *
 init_css_selector(struct css_selector_set *sels,
-		  enum css_selector_type type,
-		  enum css_selector_relation relation,
+                  enum css_selector_type type,
+                  enum css_selector_relation relation,
                   unsigned char *name, int namelen)
 {
 	struct css_selector *selector;
@@ -92,7 +94,8 @@ set_css_selector_relation(struct css_selector *selector,
 }
 
 struct css_selector *
-get_css_selector(struct css_selector_set *sels, enum css_selector_type type,
+get_css_selector(struct css_selector_set *sels,
+                 enum css_selector_type type,
                  enum css_selector_relation rel,
                  unsigned char *name, int namelen)
 {
@@ -136,7 +139,7 @@ add_selector_property(struct css_selector *selector, struct css_property *prop)
 
 void
 add_selector_properties(struct css_selector *selector,
-                        struct list_head *properties)
+                        LIST_OF(struct css_property) *properties)
 {
 	struct css_property *prop;
 
diff --git a/src/document/css/stylesheet.h b/src/document/css/stylesheet.h
index 54857881..28b41298 100644
--- a/src/document/css/stylesheet.h
+++ b/src/document/css/stylesheet.h
@@ -6,10 +6,12 @@
 
 /* #define DEBUG_CSS */
 
-/* TODO: We need a memory efficient and fast way to define how properties
- * cascade. What we are interested in is making it fast and easy to find
- * all properties we need.
+/** @file
+ * @todo TODO: We need a memory efficient and fast way to define how
+ * properties cascade. What we are interested in is making it fast and
+ * easy to find all properties we need.
  *
+ * @code
  *	struct css_cascade {
  *		struct css_cascade *parent;
  *		struct list_head properties;
@@ -17,6 +19,7 @@
  *			- Can later be turned into a table to not waste memory:
  *			  struct css_property properties[1];
  *	};
+ * @endcode
  *
  * And the selector should then only map a document element into this
  * data structure.
@@ -26,12 +29,13 @@
  * Question is in what direction to apply. It should be possible for the user
  * to overwrite any document provided stylesheet using "!important" so we need
  * to keep track in some table what properties was already applied so we only
- * overwrite when we have to. --jonas */
-/* XXX: This is one of the TODOs where I have no clue what is it talking about
+ * overwrite when we have to. --jonas
+ *
+ * XXX: This is one of the TODOs where I have no clue what is it talking about
  * in particular. Is it obsolete now when we grok 'td.foo p#x>a:hover' without
  * hesitation? --pasky */
 
-/* A set of struct css_selector.  This is currently represented as a
+/** A set of struct css_selector.  This is currently represented as a
  * list but that may be changed later.  Therefore please try not to
  * access the contents directly; instead define new wrapper macros.
  *
@@ -43,30 +47,36 @@
 struct css_selector_set {
 	unsigned char may_contain_rel_ancestor_or_parent;
 
-	/* Keep this away from the beginning of the structure,
+	/** The list of selectors in this set.
+	 *
+	 * Sets are currently represented as lists that
+	 * find_css_selector() then has to search linearly.
+	 * Hashing was also tested but did not help in practice:
+	 * each find_css_selector() call runs approximately one
+	 * strcasecmp(), and a hash function is unlikely to be
+	 * faster than that.  See ELinks bug 789 for details.
+	 *
+	 * Keep this away from the beginning of the structure,
 	 * so that nobody can cast the struct css_selector_set *
-	 * to struct list_head * and get away with it.  */
-	struct list_head list;	/* -> struct css_selector */
+	 * to LIST_OF(struct css_selector) * and get away with it.  */
+	LIST_OF(struct css_selector) list;
 };
 #define INIT_CSS_SELECTOR_SET(set) { 0, { D_LIST_HEAD(set.list) } }
 
-/* The {struct css_selector} is used for mapping elements (or nodes) in the
+/** The struct css_selector is used for mapping elements (or nodes) in the
  * document structure to properties. See README for some hints about how the
  * trees of these span. */
-/* TODO: Hash the selectors at least at the top levels? Binary trees could
- * still give an excellent gain while not giving a constant memory usage hit.
- * --pasky */
 struct css_selector {
 	LIST_HEAD(struct css_selector);
 
-	/* This defines relation between this selector fragment and its
+	/** This defines relation between this selector fragment and its
 	 * parent in the selector tree.
 	 * Update with set_css_selector_relation().  */
 	enum css_selector_relation {
-		CSR_ROOT, /* First class stylesheet member. */
-		CSR_SPECIFITY, /* Narrowing-down, i.e. the "x" in "foo#x". */
-		CSR_ANCESTOR, /* Ancestor, i.e. the "p" in "p a". */
-		CSR_PARENT, /* Direct parent, i.e. the "div" in "div>img". */
+		CSR_ROOT, /**< First class stylesheet member. */
+		CSR_SPECIFITY, /**< Narrowing-down, i.e. the "x" in "foo#x". */
+		CSR_ANCESTOR, /**< Ancestor, i.e. the "p" in "p a". */
+		CSR_PARENT, /**< Direct parent, i.e. the "div" in "div>img". */
 	} relation;
 	struct css_selector_set leaves;
 
@@ -75,11 +85,11 @@ struct css_selector {
 		CST_ID,
 		CST_CLASS,
 		CST_PSEUDO,
-		CST_INVALID, /* Auxiliary for the parser */
+		CST_INVALID, /**< Auxiliary for the parser */
 	} type;
 	unsigned char *name;
 
-	struct list_head properties; /* -> struct css_property */
+	LIST_OF(struct css_property) properties;
 };
 
 
@@ -87,43 +97,43 @@ struct css_stylesheet;
 typedef void (*css_stylesheet_importer_T)(struct css_stylesheet *, struct uri *,
 					unsigned char *url, int urllen);
 
-/* The {struct css_stylesheet} describes all the useful data that was extracted
+/** 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
- * stylesheet so it can contain stuff from both