]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'kbuild/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Sun, 7 Oct 2012 23:42:23 +0000 (10:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sun, 7 Oct 2012 23:42:23 +0000 (10:42 +1100)
19 files changed:
MAINTAINERS
Makefile
scripts/Makefile.modinst
scripts/Makefile.modpost
scripts/coccinelle/api/ptr_ret.cocci
scripts/kconfig/Makefile
scripts/kconfig/conf.c
scripts/kconfig/expr.h
scripts/kconfig/lkc_proto.h
scripts/kconfig/lxdialog/dialog.h
scripts/kconfig/lxdialog/textbox.c
scripts/kconfig/lxdialog/util.c
scripts/kconfig/mconf.c
scripts/kconfig/menu.c
scripts/kconfig/nconf.c
scripts/kernel-doc
scripts/package/buildtar
scripts/tags.sh
tools/testing/ktest/ktest.pl

index 84ee86719bd9100174e2fcd0f4ffc6d475dcdce6..29b56c039178e4f96e77d03e164b38867487c7cd 100644 (file)
@@ -2423,11 +2423,6 @@ S:       Maintained
 F:     Documentation/hwmon/dme1737
 F:     drivers/hwmon/dme1737.c
 
-DOCBOOK FOR DOCUMENTATION
-M:     Randy Dunlap <rdunlap@xenotime.net>
-S:     Maintained
-F:     scripts/kernel-doc
-
 DOCKING STATION DRIVER
 M:     Shaohua Li <shaohua.li@intel.com>
 L:     linux-acpi@vger.kernel.org
index 86eb6acb3978c81121746356290ca1d7e82d0c4e..5d8e7f2583881bcbc8b549dc9e2d3d246498865a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -664,22 +664,9 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
 endif
 
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
-# But warn user when we do so
-warn-assign = \
-$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)")
-
-ifneq ($(KCPPFLAGS),)
-        $(call warn-assign,CPPFLAGS)
-        KBUILD_CPPFLAGS += $(KCPPFLAGS)
-endif
-ifneq ($(KAFLAGS),)
-        $(call warn-assign,AFLAGS)
-        KBUILD_AFLAGS += $(KAFLAGS)
-endif
-ifneq ($(KCFLAGS),)
-        $(call warn-assign,CFLAGS)
-        KBUILD_CFLAGS += $(KCFLAGS)
-endif
+KBUILD_CPPFLAGS += $(KCPPFLAGS)
+KBUILD_AFLAGS += $(KAFLAGS)
+KBUILD_CFLAGS += $(KCFLAGS)
 
 # Use --build-id when available.
 LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
index efa5d940e6324caa0aa120343043b89475502e74..3d13d3a3edfe821c9663de081d78045c96e69809 100644 (file)
@@ -9,7 +9,7 @@ include scripts/Kbuild.include
 
 #
 
-__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
+__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
 
 PHONY += $(modules)
index 08dce14f2dc862d78d30744e0e7cd7b4e915cc64..a1cb0222ebe642b6fd91093f2a01bd301b026e6e 100644 (file)
@@ -60,7 +60,7 @@ kernelsymfile := $(objtree)/Module.symvers
 modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
 
 # Step 1), find all modules listed in $(MODVERDIR)/
-__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
+__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 modules   := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
 
 # Stop after building .o files if NOFINAL is set. Makes compile tests quicker
index cbfd08c7d8c734152f5bcadfff38298bc9ceb828..15f076fdecbe073474e3eeeaf9e813a3fa77667e 100644 (file)
@@ -30,6 +30,13 @@ expression ptr;
 - if (IS_ERR(ptr)) return PTR_ERR(ptr); return 0;
 + return PTR_RET(ptr);
 
+@depends on patch@
+expression ptr;
+@@
+
+- (IS_ERR(ptr) ? PTR_ERR(ptr) : 0)
++ PTR_RET(ptr)
+
 @r1 depends on !patch@
 expression ptr;
 position p1;
@@ -44,6 +51,13 @@ position p2;
 
 * if@p2 (IS_ERR(ptr)) return PTR_ERR(ptr); return 0;
 
+@r3 depends on !patch@
+expression ptr;
+position p3;
+@@
+
+* IS_ERR@p3(ptr) ? PTR_ERR(ptr) : 0
+
 @script:python depends on org@
 p << r1.p1;
 @@
@@ -57,6 +71,12 @@ p << r2.p2;
 
 coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used")
 
+@script:python depends on org@
+p << r3.p3;
+@@
+
+coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used")
+
 @script:python depends on report@
 p << r1.p1;
 @@
@@ -68,3 +88,9 @@ p << r2.p2;
 @@
 
 coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used")
+
+@script:python depends on report@
+p << r3.p3;
+@@
+
+coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used")
index 77d53999ffb90f51bea3f0395be08e495e3b75b8..3091794e935488c797e73207e6d0b82a7dbf99b4 100644 (file)
@@ -76,11 +76,17 @@ PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
 allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
        $< --$@ $(Kconfig)
 
-PHONY += listnewconfig oldnoconfig savedefconfig defconfig
+PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig
 
-listnewconfig oldnoconfig: $(obj)/conf
+listnewconfig olddefconfig: $(obj)/conf
        $< --$@ $(Kconfig)
 
+# oldnoconfig is an alias of olddefconfig, because people already are dependent
+# on its behavior(sets new symbols to their default value but not 'n') with the
+# counter-intuitive name.
+oldnoconfig: $(obj)/conf
+       $< --olddefconfig $(Kconfig)
+
 savedefconfig: $(obj)/conf
        $< --$@=defconfig $(Kconfig)
 
@@ -114,7 +120,7 @@ help:
        @echo  '  alldefconfig    - New config with all symbols set to default'
        @echo  '  randconfig      - New config with random answer to all options'
        @echo  '  listnewconfig   - List new options'
-       @echo  '  oldnoconfig     - Same as silentoldconfig but sets new symbols to their default value'
+       @echo  '  olddefconfig    - Same as silentoldconfig but sets new symbols to their default value'
 
 # lxdialog stuff
 check-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
index 0dc4a2c779b119ec51e2eb5b3f17c5a4d02645fb..4da3b4adfad233cb97728b0e0278f8143919cee3 100644 (file)
@@ -32,7 +32,7 @@ enum input_mode {
        defconfig,
        savedefconfig,
        listnewconfig,
-       oldnoconfig,
+       olddefconfig,
 } input_mode = oldaskconfig;
 
 static int indent = 1;
@@ -365,7 +365,7 @@ static void conf(struct menu *menu)
                case P_MENU:
                        if ((input_mode == silentoldconfig ||
                             input_mode == listnewconfig ||
-                            input_mode == oldnoconfig) &&
+                            input_mode == olddefconfig) &&
                            rootEntry != menu) {
                                check_conf(menu);
                                return;
@@ -429,7 +429,7 @@ static void check_conf(struct menu *menu)
                                if (sym->name && !sym_is_choice_value(sym)) {
                                        printf("%s%s\n", CONFIG_, sym->name);
                                }
-                       } else if (input_mode != oldnoconfig) {
+                       } else if (input_mode != olddefconfig) {
                                if (!conf_cnt++)
                                        printf(_("*\n* Restart config...\n*\n"));
                                rootEntry = menu_get_parent_menu(menu);
@@ -454,7 +454,13 @@ static struct option long_opts[] = {
        {"alldefconfig",    no_argument,       NULL, alldefconfig},
        {"randconfig",      no_argument,       NULL, randconfig},
        {"listnewconfig",   no_argument,       NULL, listnewconfig},
-       {"oldnoconfig",     no_argument,       NULL, oldnoconfig},
+       {"olddefconfig",    no_argument,       NULL, olddefconfig},
+       /*
+        * oldnoconfig is an alias of olddefconfig, because people already
+        * are dependent on its behavior(sets new symbols to their default
+        * value but not 'n') with the counter-intuitive name.
+        */
+       {"oldnoconfig",     no_argument,       NULL, olddefconfig},
        {NULL, 0, NULL, 0}
 };
 
@@ -467,7 +473,8 @@ static void conf_usage(const char *progname)
        printf("  --oldaskconfig          Start a new configuration using a line-oriented program\n");
        printf("  --oldconfig             Update a configuration using a provided .config as base\n");
        printf("  --silentoldconfig       Same as oldconfig, but quietly, additionally update deps\n");
-       printf("  --oldnoconfig           Same as silentoldconfig but set new symbols to no\n");
+       printf("  --olddefconfig          Same as silentoldconfig but sets new symbols to their default value\n");
+       printf("  --oldnoconfig           An alias of olddefconfig\n");
        printf("  --defconfig <file>      New config with default defined in <file>\n");
        printf("  --savedefconfig <file>  Save the minimal current configuration to <file>\n");
        printf("  --allnoconfig           New config where all options are answered with no\n");
@@ -520,7 +527,7 @@ int main(int ac, char **av)
                case allmodconfig:
                case alldefconfig:
                case listnewconfig:
-               case oldnoconfig:
+               case olddefconfig:
                        break;
                case '?':
                        conf_usage(progname);
@@ -565,7 +572,7 @@ int main(int ac, char **av)
        case oldaskconfig:
        case oldconfig:
        case listnewconfig:
-       case oldnoconfig:
+       case olddefconfig:
                conf_read(NULL);
                break;
        case allnoconfig:
@@ -645,7 +652,7 @@ int main(int ac, char **av)
                /* fall through */
        case oldconfig:
        case listnewconfig:
-       case oldnoconfig:
+       case olddefconfig:
        case silentoldconfig:
                /* Update until a loop caused no more changes */
                do {
@@ -653,7 +660,7 @@ int main(int ac, char **av)
                        check_conf(&rootmenu);
                } while (conf_cnt &&
                         (input_mode != listnewconfig &&
-                         input_mode != oldnoconfig));
+                         input_mode != olddefconfig));
                break;
        }
 
index d4ecce8bc3a689daa2157e4f47e65e7c62192bd4..bd2e098955532a26a3935e44ad58283598cbf673 100644 (file)
@@ -12,6 +12,7 @@ extern "C" {
 
 #include <assert.h>
 #include <stdio.h>
+#include <sys/queue.h>
 #ifndef __cplusplus
 #include <stdbool.h>
 #endif
@@ -173,6 +174,16 @@ struct menu {
 #define MENU_CHANGED           0x0001
 #define MENU_ROOT              0x0002
 
+struct jump_key {
+       CIRCLEQ_ENTRY(jump_key) entries;
+       size_t offset;
+       struct menu *target;
+       int index;
+};
+CIRCLEQ_HEAD(jk_head, jump_key);
+
+#define JUMP_NB                        9
+
 extern struct file *file_list;
 extern struct file *current_file;
 struct file *lookup_file(const char *name);
index 47fe9c340f9a20b9b6bd9871d18d79ea9ddc7d1d..1d1c08537f1e59b2cab76bd88437489fcbea393b 100644 (file)
@@ -21,8 +21,10 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu));
 P(menu_get_parent_menu,struct menu *,(struct menu *menu));
 P(menu_has_help,bool,(struct menu *menu));
 P(menu_get_help,const char *,(struct menu *menu));
-P(get_symbol_str, void, (struct gstr *r, struct symbol *sym));
-P(get_relations_str, struct gstr, (struct symbol **sym_arr));
+P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct jk_head
+                        *head));
+P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct jk_head
+                                  *head));
 P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));
 
 /* symbol.c */
index b5211fce0d946ab90eaf1ba239f3b20b40039b11..ee17a5264d5b456c0672a77b06964bfc1ccd29d7 100644 (file)
@@ -144,6 +144,7 @@ struct dialog_info {
  */
 extern struct dialog_info dlg;
 extern char dialog_input_result[];
+extern int saved_x, saved_y;           /* Needed in signal handler in mconf.c */
 
 /*
  * Function prototypes
@@ -209,7 +210,13 @@ int first_alpha(const char *string, const char *exempt);
 int dialog_yesno(const char *title, const char *prompt, int height, int width);
 int dialog_msgbox(const char *title, const char *prompt, int height,
                  int width, int pause);
-int dialog_textbox(const char *title, const char *file, int height, int width);
+
+
+typedef void (*update_text_fn)(char *buf, size_t start, size_t end, void
+                              *_data);
+int dialog_textbox(const char *title, char *tbuf, int initial_height,
+                  int initial_width, int *keys, int *_vscroll, int *_hscroll,
+                  update_text_fn update_text, void *data);
 int dialog_menu(const char *title, const char *prompt,
                const void *selected, int *s_scroll);
 int dialog_checklist(const char *title, const char *prompt, int height,
index 4e5de60a0c0d35765d1cfb8f67a06c852c892e8a..a48bb93e09073f05ea14786fea9370202f5039f9 100644 (file)
 #include "dialog.h"
 
 static void back_lines(int n);
-static void print_page(WINDOW * win, int height, int width);
-static void print_line(WINDOW * win, int row, int width);
+static void print_page(WINDOW *win, int height, int width, update_text_fn
+                      update_text, void *data);
+static void print_line(WINDOW *win, int row, int width);
 static char *get_line(void);
 static void print_position(WINDOW * win);
 
 static int hscroll;
 static int begin_reached, end_reached, page_length;
-static const char *buf;
-static const char *page;
+static char *buf;
+static char *page;
 
 /*
  * refresh window content
  */
 static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw,
-                                                         int cur_y, int cur_x)
+                            int cur_y, int cur_x, update_text_fn update_text,
+                            void *data)
 {
-       print_page(box, boxh, boxw);
+       print_page(box, boxh, boxw, update_text, data);
        print_position(dialog);
        wmove(dialog, cur_y, cur_x);    /* Restore cursor position */
        wrefresh(dialog);
@@ -47,14 +49,18 @@ static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw,
 
 /*
  * Display text from a file in a dialog box.
+ *
+ * keys is a null-terminated array
+ * update_text() may not add or remove any '\n' or '\0' in tbuf
  */
-int dialog_textbox(const char *title, const char *tbuf,
-                  int initial_height, int initial_width)
+int dialog_textbox(const char *title, char *tbuf, int initial_height,
+                  int initial_width, int *keys, int *_vscroll, int *_hscroll,
+                  update_text_fn update_text, void *data)
 {
        int i, x, y, cur_x, cur_y, key = 0;
        int height, width, boxh, boxw;
-       int passed_end;
        WINDOW *dialog, *box;
+       bool done = false;
 
        begin_reached = 1;
        end_reached = 0;
@@ -63,6 +69,15 @@ int dialog_textbox(const char *title, const char *tbuf,
        buf = tbuf;
        page = buf;     /* page is pointer to start of page to be displayed */
 
+       if (_vscroll && *_vscroll) {
+               begin_reached = 0;
+
+               for (i = 0; i < *_vscroll; i++)
+                       get_line();
+       }
+       if (_hscroll)
+               hscroll = *_hscroll;
+
 do_resize:
        getmaxyx(stdscr, height, width);
        if (height < 8 || width < 8)
@@ -120,9 +135,10 @@ do_resize:
 
        /* Print first page of text */
        attr_clear(box, boxh, boxw, dlg.dialog.atr);
-       refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x);
+       refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x, update_text,
+                        data);
 
-       while ((key != KEY_ESC) && (key != '\n')) {
+       while (!done) {
                key = wgetch(dialog);
                switch (key) {
                case 'E':       /* Exit */
@@ -130,16 +146,17 @@ do_resize:
                case 'X':
                case 'x':
                case 'q':
-                       delwin(box);
-                       delwin(dialog);
-                       return 0;
+               case '\n':
+                       done = true;
+                       break;
                case 'g':       /* First page */
                case KEY_HOME:
                        if (!begin_reached) {
                                begin_reached = 1;
                                page = buf;
                                refresh_text_box(dialog, box, boxh, boxw,
-                                                cur_y, cur_x);
+                                                cur_y, cur_x, update_text,
+                                                data);
                        }
                        break;
                case 'G':       /* Last page */
@@ -149,45 +166,18 @@ do_resize:
                        /* point to last char in buf */
                        page = buf + strlen(buf);
                        back_lines(boxh);
-                       refresh_text_box(dialog, box, boxh, boxw,
-                                        cur_y, cur_x);
+                       refresh_text_box(dialog, box, boxh, boxw, cur_y,
+                                        cur_x, update_text, data);
                        break;
                case 'K':       /* Previous line */
                case 'k':
                case KEY_UP:
-                       if (!begin_reached) {
-                               back_lines(page_length + 1);
-
-                               /* We don't call print_page() here but use
-                                * scrolling to ensure faster screen update.
-                                * However, 'end_reached' and 'page_length'
-                                * should still be updated, and 'page' should
-                                * point to start of next page. This is done
-                                * by calling get_line() in the following
-                                * 'for' loop. */
-                               scrollok(box, TRUE);
-                               wscrl(box, -1); /* Scroll box region down one line */
-                               scrollok(box, FALSE);
-                               page_length = 0;
-                               passed_end = 0;
-                               for (i = 0; i < boxh; i++) {
-                                       if (!i) {
-                                               /* print first line of page */
-                                               print_line(box, 0, boxw);
-                                               wnoutrefresh(box);
-                                       } else
-                                               /* Called to update 'end_reached' and 'page' */
-                                               get_line();
-                                       if (!passed_end)
-                                               page_length++;
-                                       if (end_reached && !passed_end)
-                                               passed_end = 1;
-                               }
+                       if (begin_reached)
+                               break;
 
-                               print_position(dialog);
-                               wmove(dialog, cur_y, cur_x);    /* Restore cursor position */
-                               wrefresh(dialog);
-                       }
+                       back_lines(page_length + 1);
+                       refresh_text_box(dialog, box, boxh, boxw, cur_y,
+                                        cur_x, update_text, data);
                        break;
                case 'B':       /* Previous page */
                case 'b':
@@ -196,23 +186,18 @@ do_resize:
                        if (begin_reached)
                                break;
                        back_lines(page_length + boxh);
-                       refresh_text_box(dialog, box, boxh, boxw,
-                                        cur_y, cur_x);
+                       refresh_text_box(dialog, box, boxh, boxw, cur_y,
+                                        cur_x, update_text, data);
                        break;
                case 'J':       /* Next line */
                case 'j':
                case KEY_DOWN:
-                       if (!end_reached) {
-                               begin_reached = 0;
-                               scrollok(box, TRUE);
-                               scroll(box);    /* Scroll box region up one line */
-                               scrollok(box, FALSE);
-                               print_line(box, boxh - 1, boxw);
-                               wnoutrefresh(box);
-                               print_position(dialog);
-                               wmove(dialog, cur_y, cur_x);    /* Restore cursor position */
-                               wrefresh(dialog);
-                       }
+                       if (end_reached)
+                               break;
+
+                       back_lines(page_length - 1);
+                       refresh_text_box(dialog, box, boxh, boxw, cur_y,
+                                        cur_x, update_text, data);
                        break;
                case KEY_NPAGE: /* Next page */
                case ' ':
@@ -221,8 +206,8 @@ do_resize:
                                break;
 
                        begin_reached = 0;
-                       refresh_text_box(dialog, box, boxh, boxw,
-                                        cur_y, cur_x);
+                       refresh_text_box(dialog, box, boxh, boxw, cur_y,
+                                        cur_x, update_text, data);
                        break;
                case '0':       /* Beginning of line */
                case 'H':       /* Scroll left */
@@ -237,8 +222,8 @@ do_resize:
                                hscroll--;
                        /* Reprint current page to scroll horizontally */
                        back_lines(page_length);
-                       refresh_text_box(dialog, box, boxh, boxw,
-                                        cur_y, cur_x);
+                       refresh_text_box(dialog, box, boxh, boxw, cur_y,
+                                        cur_x, update_text, data);
                        break;
                case 'L':       /* Scroll right */
                case 'l':
@@ -248,11 +233,12 @@ do_resize:
                        hscroll++;
                        /* Reprint current page to scroll horizontally */
                        back_lines(page_length);
-                       refresh_text_box(dialog, box, boxh, boxw,
-                                        cur_y, cur_x);
+                       refresh_text_box(dialog, box, boxh, boxw, cur_y,
+                                        cur_x, update_text, data);
                        break;
                case KEY_ESC:
-                       key = on_key_esc(dialog);
+                       if (on_key_esc(dialog) == KEY_ESC)
+                               done = true;
                        break;
                case KEY_RESIZE:
                        back_lines(height);
@@ -260,11 +246,31 @@ do_resize:
                        delwin(dialog);
                        on_key_resize();
                        goto do_resize;
+               default:
+                       for (i = 0; keys[i]; i++) {
+                               if (key == keys[i]) {
+                                       done = true;
+                                       break;
+                               }
+                       }
                }
        }
        delwin(box);
        delwin(dialog);
-       return key;             /* ESC pressed */
+       if (_vscroll) {
+               const char *s;
+
+               s = buf;
+               *_vscroll = 0;
+               back_lines(page_length);
+               while (s < page && (s = strchr(s, '\n'))) {
+                       (*_vscroll)++;
+                       s++;
+               }
+       }
+       if (_hscroll)
+               *_hscroll = hscroll;
+       return key;
 }
 
 /*
@@ -301,12 +307,23 @@ static void back_lines(int n)
 }
 
 /*
- * Print a new page of text. Called by dialog_textbox().
+ * Print a new page of text.
  */
-static void print_page(WINDOW * win, int height, int width)
+static void print_page(WINDOW *win, int height, int width, update_text_fn
+                      update_text, void *data)
 {
        int i, passed_end = 0;
 
+       if (update_text) {
+               char *end;
+
+               for (i = 0; i < height; i++)
+                       get_line();
+               end = page;
+               back_lines(height);
+               update_text(buf, page - buf, end - buf, data);
+       }
+
        page_length = 0;
        for (i = 0; i < height; i++) {
                print_line(win, i, width);
@@ -319,7 +336,7 @@ static void print_page(WINDOW * win, int height, int width)
 }
 
 /*
- * Print a new line of text. Called by dialog_textbox() and print_page().
+ * Print a new line of text.
  */
 static void print_line(WINDOW * win, int row, int width)
 {
@@ -357,10 +374,8 @@ static char *get_line(void)
        end_reached = 0;
        while (*page != '\n') {
                if (*page == '\0') {
-                       if (!end_reached) {
-                               end_reached = 1;
-                               break;
-                       }
+                       end_reached = 1;
+                       break;
                } else if (i < MAX_LEN)
                        line[i++] = *(page++);
                else {
@@ -373,7 +388,7 @@ static char *get_line(void)
        if (i <= MAX_LEN)
                line[i] = '\0';
        if (!end_reached)
-               page++;         /* move pass '\n' */
+               page++;         /* move past '\n' */
 
        return line;
 }
index f2375ad7ebc9bf07d306fc8de611f631b36cd7bf..109d53117d223682254502b51b6414d7404852e2 100644 (file)
@@ -23,6 +23,9 @@
 
 #include "dialog.h"
 
+/* Needed in signal handler in mconf.c */
+int saved_x, saved_y;
+
 struct dialog_info dlg;
 
 static void set_mono_theme(void)
@@ -273,6 +276,10 @@ int init_dialog(const char *backtitle)
        int height, width;
 
        initscr();              /* Init curses */
+
+       /* Get current cursor position for signal handler in mconf.c */
+       getyx(stdscr, saved_y, saved_x);
+
        getmaxyx(stdscr, height, width);
        if (height < 19 || width < 80) {
                endwin();
index f584a281bb4c94d240b135ba6943fe75a433b3ec..48f67448af7b67cf6c8df7394702a65767891992 100644 (file)
@@ -236,16 +236,19 @@ search_help[] = N_(
        "Result:\n"
        "-----------------------------------------------------------------\n"
        "Symbol: FOO [=m]\n"
+       "Type  : tristate\n"
        "Prompt: Foo bus is used to drive the bar HW\n"
-       "Defined at drivers/pci/Kconfig:47\n"
-       "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n"
-       "Location:\n"
-       "  -> Bus options (PCI, PCMCIA, EISA, ISA)\n"
-       "    -> PCI support (PCI [=y])\n"
-       "      -> PCI access mode (<choice> [=y])\n"
-       "Selects: LIBCRC32\n"
-       "Selected by: BAR\n"
+       "  Defined at drivers/pci/Kconfig:47\n"
+       "  Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n"
+       "  Location:\n"
+       "    -> Bus options (PCI, PCMCIA, EISA, ISA)\n"
+       "      -> PCI support (PCI [=y])\n"
+       "(1)     -> PCI access mode (<choice> [=y])\n"
+       "  Selects: LIBCRC32\n"
+       "  Selected by: BAR\n"
        "-----------------------------------------------------------------\n"
+       "o The line 'Type:' shows the type of the configuration option for\n"
+       "  this symbol (boolean, tristate, string, ...)\n"
        "o The line 'Prompt:' shows the text used in the menu structure for\n"
        "  this symbol\n"
        "o The 'Defined at' line tell at what file / line number the symbol\n"
@@ -254,8 +257,12 @@ search_help[] = N_(
        "  this symbol to be visible in the menu (selectable)\n"
        "o The 'Location:' lines tell where in the menu structure this symbol\n"
        "  is located\n"
-       "    A location followed by a [=y] indicate that this is a selectable\n"
-       "    menu item - and current value is displayed inside brackets.\n"
+       "    A location followed by a [=y] indicates that this is a\n"
+       "    selectable menu item - and the current value is displayed inside\n"
+       "    brackets.\n"
+       "    Press the key in the (#) prefix to jump directly to that\n"
+       "    location. You will be returned to the current search results\n"
+       "    after exiting this new menu.\n"
        "o The 'Selects:' line tell what symbol will be automatically\n"
        "  selected if this symbol is selected (y or m)\n"
        "o The 'Selected by' line tell what symbol has selected this symbol\n"
@@ -273,13 +280,15 @@ static struct menu *current_menu;
 static int child_count;
 static int single_menu_mode;
 static int show_all_options;
-static int saved_x, saved_y;
 
-static void conf(struct menu *menu);
+static void conf(struct menu *menu, struct menu *active_menu);
 static void conf_choice(struct menu *menu);
 static void conf_string(struct menu *menu);
 static void conf_load(void);
 static void conf_save(void);
+static int show_textbox_ext(const char *title, char *text, int r, int c,
+                           int *keys, int *vscroll, int *hscroll,
+                           update_text_fn update_text, void *data);
 static void show_textbox(const char *title, const char *text, int r, int c);
 static void show_helptext(const char *title, const char *text);
 static void show_help(struct menu *menu);
@@ -302,12 +311,47 @@ static void set_config_filename(const char *config_filename)
 }
 
 
+struct search_data {
+       struct jk_head *head;
+       struct menu **targets;
+       int *keys;
+};
+
+static void update_text(char *buf, size_t start, size_t end, void *_data)
+{
+       struct search_data *data = _data;
+       struct jump_key *pos;
+       int k = 0;
+
+       CIRCLEQ_FOREACH(pos, data->head, entries) {
+               if (pos->offset >= start && pos->offset < end) {
+                       char header[4];
+
+                       if (k < JUMP_NB) {
+                               int key = '0' + (pos->index % JUMP_NB) + 1;
+
+                               sprintf(header, "(%c)", key);
+                               data->keys[k] = key;
+                               data->targets[k] = pos->target;
+                               k++;
+                       } else {
+                               sprintf(header, "   ");
+                       }
+
+                       memcpy(buf + pos->offset, header, sizeof(header) - 1);
+               }
+       }
+       data->keys[k] = 0;
+}
+
 static void search_conf(void)
 {
        struct symbol **sym_arr;
        struct gstr res;
        char *dialog_input;
-       int dres;
+       int dres, vscroll = 0, hscroll = 0;
+       bool again;
+
 again:
        dialog_clear();
        dres = dialog_inputbox(_("Search Configuration Parameter"),
@@ -330,10 +374,30 @@ again:
                dialog_input += strlen(CONFIG_);
 
        sym_arr = sym_re_search(dialog_input);
-       res = get_relations_str(sym_arr);
+       do {
+               struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head);
+               struct menu *targets[JUMP_NB];
+               int keys[JUMP_NB + 1], i;
+               struct search_data data = {
+                       .head = &head,
+                       .targets = targets,
+                       .keys = keys,
+               };
+
+               res = get_relations_str(sym_arr, &head);
+               dres = show_textbox_ext(_("Search Results"), (char *)
+                                       str_get(&res), 0, 0, keys, &vscroll,
+                                       &hscroll, &update_text, (void *)
+                                       &data);
+               again = false;
+               for (i = 0; i < JUMP_NB && keys[i]; i++)
+                       if (dres == keys[i]) {
+                               conf(targets[i]->parent, targets[i]);
+                               again = true;
+                       }
+               str_free(&res);
+       } while (again);
        free(sym_arr);
-       show_textbox(_("Search Results"), str_get(&res), 0, 0);
-       str_free(&res);
 }
 
 static void build_conf(struct menu *menu)
@@ -514,12 +578,11 @@ conf_childs:
        indent -= doint;
 }
 
-static void conf(struct menu *menu)
+static void conf(struct menu *menu, struct menu *active_menu)
 {
        struct menu *submenu;
        const char *prompt = menu_get_prompt(menu);
        struct symbol *sym;
-       struct menu *active_menu = NULL;
        int res;
        int s_scroll = 0;
 
@@ -562,13 +625,13 @@ static void conf(struct menu *menu)
                                if (single_menu_mode)
                                        submenu->data = (void *) (long) !submenu->data;
                                else
-                                       conf(submenu);
+                                       conf(submenu, NULL);
                                break;
                        case 't':
                                if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)
                                        conf_choice(submenu);
                                else if (submenu->prompt->type == P_MENU)
-                                       conf(submenu);
+                                       conf(submenu, NULL);
                                break;
                        case 's':
                                conf_string(submenu);
@@ -607,7 +670,7 @@ static void conf(struct menu *menu)
                        if (item_is_tag('t'))
                                sym_toggle_tristate_value(sym);
                        else if (item_is_tag('m'))
-                               conf(submenu);
+                               conf(submenu, NULL);
                        break;
                case 7:
                        search_conf();
@@ -619,10 +682,19 @@ static void conf(struct menu *menu)
        }
 }
 
-static void show_textbox(const char *title, const char *text, int r, int c)
+static int show_textbox_ext(const char *title, char *text, int r, int c, int
+                           *keys, int *vscroll, int *hscroll, update_text_fn
+                           update_text, void *data)
 {
        dialog_clear();
-       dialog_textbox(title, text, r, c);
+       return dialog_textbox(title, text, r, c, keys, vscroll, hscroll,
+                             update_text, data);
+}
+
+static void show_textbox(const char *title, const char *text, int r, int c)
+{
+       show_textbox_ext(title, (char *) text, r, c, (int []) {0}, NULL, NULL,
+                        NULL, NULL);
 }
 
 static void show_helptext(const char *title, const char *text)
@@ -862,9 +934,6 @@ int main(int ac, char **av)
                        single_menu_mode = 1;
        }
 
-       initscr();
-
-       getyx(stdscr, saved_y, saved_x);
        if (init_dialog(NULL)) {
                fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
                fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
@@ -873,7 +942,7 @@ int main(int ac, char **av)
 
        set_config_filename(conf_get_configname());
        do {
-               conf(&rootmenu);
+               conf(&rootmenu, NULL);
                res = handle_exit();
        } while (res == KEY_ESC);
 
index 8c2a97e60fafa701331949152261d162541482a1..a3cade659f89cb5f67828b797ae49b9311bf1d98 100644 (file)
@@ -507,10 +507,12 @@ const char *menu_get_help(struct menu *menu)
                return "";
 }
 
-static void get_prompt_str(struct gstr *r, struct property *prop)
+static void get_prompt_str(struct gstr *r, struct property *prop,
+                          struct jk_head *head)
 {
        int i, j;
-       struct menu *submenu[8], *menu;
+       struct menu *submenu[8], *menu, *location = NULL;
+       struct jump_key *jump;
 
        str_printf(r, _("Prompt: %s\n"), _(prop->text));
        str_printf(r, _("  Defined at %s:%d\n"), prop->menu->file->name,
@@ -521,13 +523,43 @@ static void get_prompt_str(struct gstr *r, struct property *prop)
                str_append(r, "\n");
        }
        menu = prop->menu->parent;
-       for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent)
+       for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
+               bool accessible = menu_is_visible(menu);
+
                submenu[i++] = menu;
+               if (location == NULL && accessible)
+                       location = menu;
+       }
+       if (head && location) {
+               jump = malloc(sizeof(struct jump_key));
+
+               if (menu_is_visible(prop->menu)) {
+                       /*
+                        * There is not enough room to put the hint at the
+                        * beginning of the "Prompt" line. Put the hint on the
+                        * last "Location" line even when it would belong on
+                        * the former.
+                        */
+                       jump->target = prop->menu;
+               } else
+                       jump->target = location;
+
+               if (CIRCLEQ_EMPTY(head))
+                       jump->index = 0;
+               else
+                       jump->index = CIRCLEQ_LAST(head)->index + 1;
+
+               CIRCLEQ_INSERT_TAIL(head, jump, entries);
+       }
+
        if (i > 0) {
                str_printf(r, _("  Location:\n"));
                for (j = 4; --i >= 0; j += 2) {
                        menu = submenu[i];
-                       str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu)));
+                       if (head && location && menu == location)
+                               jump->offset = r->len - 1;
+                       str_printf(r, "%*c-> %s", j, ' ',
+                                  _(menu_get_prompt(menu)));
                        if (menu->sym) {
                                str_printf(r, " (%s [=%s])", menu->sym->name ?
                                        menu->sym->name : _("<choice>"),
@@ -538,7 +570,10 @@ static void get_prompt_str(struct gstr *r, struct property *prop)
        }
 }
 
-void get_symbol_str(struct gstr *r, struct symbol *sym)
+/*
+ * head is optional and may be NULL
+ */
+void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head)
 {
        bool hit;
        struct property *prop;
@@ -557,7 +592,7 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
                }
        }
        for_all_prompts(sym, prop)
-               get_prompt_str(r, prop);
+               get_prompt_str(r, prop, head);
        hit = false;
        for_all_properties(sym, prop, P_SELECT) {
                if (!hit) {
@@ -577,14 +612,14 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
        str_append(r, "\n\n");
 }
 
-struct gstr get_relations_str(struct symbol **sym_arr)
+struct gstr get_relations_str(struct symbol **sym_arr, struct jk_head *head)
 {
        struct symbol *sym;
        struct gstr res = str_new();
        int i;
 
        for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
-               get_symbol_str(&res, sym);
+               get_symbol_str(&res, sym, head);
        if (!i)
                str_append(&res, _("No matches found.\n"));
        return res;
@@ -603,5 +638,5 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help)
        }
        str_printf(help, "%s\n", _(help_text));
        if (sym)
-               get_symbol_str(help, sym);
+               get_symbol_str(help, sym, NULL);
 }
index 1704a8562a5dc40ae09c23cd355958814b6976a8..87d4b15da951031896868789df7a992d21fcc73b 100644 (file)
@@ -721,7 +721,7 @@ again:
                dialog_input += strlen(CONFIG_);
 
        sym_arr = sym_re_search(dialog_input);
-       res = get_relations_str(sym_arr);
+       res = get_relations_str(sym_arr, NULL);
        free(sym_arr);
        show_scroll_win(main_window,
                        _("Search Results"), str_get(&res));
index 01e8a8e2260283d4551432406cb91d9b6e8e97cf..46e7aff80d1a8d1b2ea054d1febc0e8ce0404c35 100755 (executable)
@@ -6,6 +6,7 @@ use strict;
 ## Copyright (C) 2000, 1  Tim Waugh <twaugh@redhat.com>          ##
 ## Copyright (C) 2001  Simon Huggins                             ##
 ## Copyright (C) 2005-2012  Randy Dunlap                         ##
+## Copyright (C) 2012  Dan Luedtke                               ##
 ##                                                              ##
 ## #define enhancements by Armin Kuster <akuster@mvista.com>    ##
 ## Copyright (c) 2000 MontaVista Software, Inc.                         ##
@@ -35,6 +36,8 @@ use strict;
 #              Small fixes (like spaces vs. \s in regex)
 # -- Tim Jansen <tim@tjansen.de>
 
+# 25/07/2012 - Added support for HTML5
+# -- Dan Luedtke <mail@danrl.de>
 
 #
 # This will read a 'c' file and scan for embedded comments in the
@@ -44,12 +47,16 @@ use strict;
 # Note: This only supports 'c'.
 
 # usage:
-# kernel-doc [ -docbook | -html | -text | -man | -list ] [ -no-doc-sections ]
-#           [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile
+# kernel-doc [ -docbook | -html | -html5 | -text | -man | -list ]
+#            [ -no-doc-sections ]
+#            [ -function funcname [ -function funcname ...] ]
+#            c file(s)s > outputfile
 # or
-#           [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile
+#            [ -nofunction funcname [ -function funcname ...] ]
+#            c file(s)s > outputfile
 #
-#  Set output format using one of -docbook -html -text or -man.  Default is man.
+#  Set output format using one of -docbook -html -html5 -text or -man.
+#  Default is man.
 #  The -list format is for internal use by docproc.
 #
 #  -no-doc-sections
@@ -182,6 +189,14 @@ my $local_lt = "\\\\\\\\lt:";
 my $local_gt = "\\\\\\\\gt:";
 my $blankline_html = $local_lt . "p" . $local_gt;      # was "<p>"
 
+# html version 5
+my %highlights_html5 = ( $type_constant, "<span class=\"const\">\$1</span>",
+                       $type_func, "<span class=\"func\">\$1</span>",
+                       $type_struct_xml, "<span class=\"struct\">\$1</span>",
+                       $type_env, "<span class=\"env\">\$1</span>",
+                       $type_param, "<span class=\"param\">\$1</span>" );
+my $blankline_html5 = $local_lt . "br /" . $local_gt;
+
 # XML, docbook format
 my %highlights_xml = ( "([^=])\\\"([^\\\"<]+)\\\"", "\$1<quote>\$2</quote>",
                        $type_constant, "<constant>\$1</constant>",
@@ -311,6 +326,10 @@ while ($ARGV[0] =~ m/^-(.*)/) {
        $output_mode = "html";
        %highlights = %highlights_html;
        $blankline = $blankline_html;
+    } elsif ($cmd eq "-html5") {
+       $output_mode = "html5";
+       %highlights = %highlights_html5;
+       $blankline = $blankline_html5;
     } elsif ($cmd eq "-man") {
        $output_mode = "man";
        %highlights = %highlights_man;
@@ -353,10 +372,11 @@ while ($ARGV[0] =~ m/^-(.*)/) {
 # continue execution near EOF;
 
 sub usage {
-    print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -list ]\n";
+    print "Usage: $0 [ -docbook | -html | -html5 | -text | -man | -list ]\n";
     print "         [ -no-doc-sections ]\n";
     print "         [ -function funcname [ -function funcname ...] ]\n";
     print "         [ -nofunction funcname [ -nofunction funcname ...] ]\n";
+    print "         [ -v ]\n";
     print "         c source file(s) > outputfile\n";
     print "         -v : verbose output, more warnings & other info listed\n";
     exit 1;
@@ -450,7 +470,8 @@ sub output_highlight {
 #      confess "output_highlight got called with no args?\n";
 #   }
 
-    if ($output_mode eq "html" || $output_mode eq "xml") {
+    if ($output_mode eq "html" || $output_mode eq "html5" ||
+       $output_mode eq "xml") {
        $contents = local_unescape($contents);
        # convert data read & converted thru xml_escape() into &xyz; format:
        $contents =~ s/\\\\\\/\&/g;
@@ -460,6 +481,11 @@ sub output_highlight {
     die $@ if $@;
 #   print STDERR "contents af:$contents\n";
 
+#   strip whitespaces when generating html5
+    if ($output_mode eq "html5") {
+       $contents =~ s/^\s+//;
+       $contents =~ s/\s+$//;
+    }
     foreach $line (split "\n", $contents) {
        if (! $output_preformatted) {
            $line =~ s/^\s*//;
@@ -480,7 +506,7 @@ sub output_highlight {
     }
 }
 
-#output sections in html
+# output sections in html
 sub output_section_html(%) {
     my %args = %{$_[0]};
     my $section;
@@ -640,6 +666,239 @@ sub output_blockhead_html(%) {
     print "<hr>\n";
 }
 
+# output sections in html5
+sub output_section_html5(%) {
+    my %args = %{$_[0]};
+    my $section;
+
+    foreach $section (@{$args{'sectionlist'}}) {
+       print "<section>\n";
+       print "<h1>$section</h1>\n";
+       print "<p>\n";
+       output_highlight($args{'sections'}{$section});
+       print "</p>\n";
+       print "</section>\n";
+    }
+}
+
+# output enum in html5
+sub output_enum_html5(%) {
+    my %args = %{$_[0]};
+    my ($parameter);
+    my $count;
+    my $html5id;
+
+    $html5id = $args{'enum'};
+    $html5id =~ s/[^a-zA-Z0-9\-]+/_/g;
+    print "<article class=\"enum\" id=\"enum:". $html5id . "\">";
+    print "<h1>enum " . $args{'enum'} . "</h1>\n";
+    print "<ol class=\"code\">\n";
+    print "<li>";
+    print "<span class=\"keyword\">enum</span> ";
+    print "<span class=\"identifier\">" . $args{'enum'} . "</span> {";
+    print "</li>\n";
+    $count = 0;
+    foreach $parameter (@{$args{'parameterlist'}}) {
+       print "<li class=\"indent\">";
+       print "<span class=\"param\">" . $parameter . "</span>";
+       if ($count != $#{$args{'parameterlist'}}) {
+           $count++;
+           print ",";
+       }
+       print "</li>\n";
+    }
+    print "<li>};</li>\n";
+    print "</ol>\n";
+
+    print "<section>\n";
+    print "<h1>Constants</h1>\n";
+    print "<dl>\n";
+    foreach $parameter (@{$args{'parameterlist'}}) {
+       print "<dt>" . $parameter . "</dt>\n";
+       print "<dd>";
+       output_highlight($args{'parameterdescs'}{$parameter});
+       print "</dd>\n";
+    }
+    print "</dl>\n";
+    print "</section>\n";
+    output_section_html5(@_);
+    print "</article>\n";
+}
+
+# output typedef in html5
+sub output_typedef_html5(%) {
+    my %args = %{$_[0]};
+    my ($parameter);
+    my $count;
+    my $html5id;
+
+    $html5id = $args{'typedef'};
+    $html5id =~ s/[^a-zA-Z0-9\-]+/_/g;
+    print "<article class=\"typedef\" id=\"typedef:" . $html5id . "\">\n";
+    print "<h1>typedef " . $args{'typedef'} . "</h1>\n";
+
+    print "<ol class=\"code\">\n";
+    print "<li>";
+    print "<span class=\"keyword\">typedef</span> ";
+    print "<span class=\"identifier\">" . $args{'typedef'} . "</span>";
+    print "</li>\n";
+    print "</ol>\n";
+    output_section_html5(@_);
+    print "</article>\n";
+}
+
+# output struct in html5
+sub output_struct_html5(%) {
+    my %args = %{$_[0]};
+    my ($parameter);
+    my $html5id;
+
+    $html5id = $args{'struct'};
+    $html5id =~ s/[^a-zA-Z0-9\-]+/_/g;
+    print "<article class=\"struct\" id=\"struct:" . $html5id . "\">\n";
+    print "<hgroup>\n";
+    print "<h1>" . $args{'type'} . " " . $args{'struct'} . "</h1>";
+    print "<h2>". $args{'purpose'} . "</h2>\n";
+    print "</hgroup>\n";
+    print "<ol class=\"code\">\n";
+    print "<li>";
+    print "<span class=\"type\">" . $args{'type'} . "</span> ";
+    print "<span class=\"identifier\">" . $args{'struct'} . "</span> {";
+    print "</li>\n";
+    foreach $parameter (@{$args{'parameterlist'}}) {
+       print "<li class=\"indent\">";
+       if ($parameter =~ /^#/) {
+               print "<span class=\"param\">" . $parameter ."</span>\n";
+               print "</li>\n";
+               next;
+       }
+       my $parameter_name = $parameter;
+       $parameter_name =~ s/\[.*//;
+
+       ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
+       $type = $args{'parametertypes'}{$parameter};
+       if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
+           # pointer-to-function
+           print "<span class=\"type\">$1</span> ";
+           print "<span class=\"param\">$parameter</span>";
+           print "<span class=\"type\">)</span> ";
+           print "(<span class=\"args\">$2</span>);";
+       } elsif ($type =~ m/^(.*?)\s*(:.*)/) {
+           # bitfield
+           print "<span class=\"type\">$1</span> ";
+           print "<span class=\"param\">$parameter</span>";
+           print "<span class=\"bits\">$2</span>;";
+       } else {
+           print "<span class=\"type\">$type</span> ";
+           print "<span class=\"param\">$parameter</span>;";
+       }
+       print "</li>\n";
+    }
+    print "<li>};</li>\n";
+    print "</ol>\n";
+
+    print "<section>\n";
+    print "<h1>Members</h1>\n";
+    print "<dl>\n";
+    foreach $parameter (@{$args{'parameterlist'}}) {
+       ($parameter =~ /^#/) && next;
+
+       my $parameter_name = $parameter;
+       $parameter_name =~ s/\[.*//;
+
+       ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
+       print "<dt>" . $parameter . "</dt>\n";
+       print "<dd>";
+       output_highlight($args{'parameterdescs'}{$parameter_name});
+       print "</dd>\n";
+    }
+    print "</dl>\n";
+    print "</section>\n";
+    output_section_html5(@_);
+    print "</article>\n";
+}
+
+# output function in html5
+sub output_function_html5(%) {
+    my %args = %{$_[0]};
+    my ($parameter, $section);
+    my $count;
+    my $html5id;
+
+    $html5id = $args{'function'};
+    $html5id =~ s/[^a-zA-Z0-9\-]+/_/g;
+    print "<article class=\"function\" id=\"func:". $html5id . "\">\n";
+    print "<hgroup>\n";
+    print "<h1>" . $args{'function'} . "</h1>";
+    print "<h2>" . $args{'purpose'} . "</h2>\n";
+    print "</hgroup>\n";
+    print "<ol class=\"code\">\n";
+    print "<li>";
+    print "<span class=\"type\">" . $args{'functiontype'} . "</span> ";
+    print "<span class=\"identifier\">" . $args{'function'} . "</span> (";
+    print "</li>";
+    $count = 0;
+    foreach $parameter (@{$args{'parameterlist'}}) {
+       print "<li class=\"indent\">";
+       $type = $args{'parametertypes'}{$parameter};
+       if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
+           # pointer-to-function
+           print "<span class=\"type\">$1</span> ";
+           print "<span class=\"param\">$parameter</span>";
+           print "<span class=\"type\">)</span> ";
+           print "(<span class=\"args\">$2</span>)";
+       } else {
+           print "<span class=\"type\">$type</span> ";
+           print "<span class=\"param\">$parameter</span>";
+       }
+       if ($count != $#{$args{'parameterlist'}}) {
+           $count++;
+           print ",";
+       }
+       print "</li>\n";
+    }
+    print "<li>)</li>\n";
+    print "</ol>\n";
+
+    print "<section>\n";
+    print "<h1>Arguments</h1>\n";
+    print "<p>\n";
+    print "<dl>\n";
+    foreach $parameter (@{$args{'parameterlist'}}) {
+       my $parameter_name = $parameter;
+       $parameter_name =~ s/\[.*//;
+
+       ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
+       print "<dt>" . $parameter . "</dt>\n";
+       print "<dd>";
+       output_highlight($args{'parameterdescs'}{$parameter_name});
+       print "</dd>\n";
+    }
+    print "</dl>\n";
+    print "</section>\n";
+    output_section_html5(@_);
+    print "</article>\n";
+}
+
+# output DOC: block header in html5
+sub output_blockhead_html5(%) {
+    my %args = %{$_[0]};
+    my ($parameter, $section);
+    my $count;
+    my $html5id;
+
+    foreach $section (@{$args{'sectionlist'}}) {
+       $html5id = $section;
+       $html5id =~ s/[^a-zA-Z0-9\-]+/_/g;
+       print "<article class=\"doc\" id=\"doc:". $html5id . "\">\n";
+       print "<h1>$section</h1>\n";
+       print "<p>\n";
+       output_highlight($args{'sections'}{$section});
+       print "</p>\n";
+    }
+    print "</article>\n";
+}
+
 sub output_section_xml(%) {
     my %args = %{$_[0]};
     my $section;
index d0d748e72915b2e3217d493c08359739fb6fbf64..62d8234f87876c30f3c78138db7edbeb0685f8c5 100644 (file)
@@ -28,15 +28,15 @@ case "${1}" in
                file_ext=""
                ;;
        targz-pkg)
-               compress="gzip -c9"
+               compress="gzip"
                file_ext=".gz"
                ;;
        tarbz2-pkg)
-               compress="bzip2 -c9"
+               compress="bzip2"
                file_ext=".bz2"
                ;;
        tarxz-pkg)
-               compress="xz -c9"
+               compress="xz"
                file_ext=".xz"
                ;;
        *)
index cff8faad73d15dab529f71943e5c5544b2ad9217..79fdafb0d26325acb65d8e2b31f814770b826a07 100755 (executable)
@@ -154,7 +154,9 @@ exuberant()
        --regex-c++='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/'  \
        --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
        --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
-       --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'
+       --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'                \
+       --regex-c='/PCI_OP_READ\(([a-z]*[a-z]).*[1-4]\)/pci_bus_read_config_\1/' \
+       --regex-c='/PCI_OP_WRITE\(([a-z]*[a-z]).*[1-4]\)/pci_bus_write_config_\1/'
 
        all_kconfigs | xargs $1 -a                              \
        --langdef=kconfig --language-force=kconfig              \
@@ -197,7 +199,9 @@ emacs()
        --regex='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/' \
        --regex='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
        --regex='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
-       --regex='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'
+       --regex='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'            \
+       --regex='/PCI_OP_READ\(([a-z]*[a-z]).*[1-4]\)/pci_bus_read_config_\1/' \
+       --regex='/PCI_OP_WRITE\(([a-z]*[a-z]).*[1-4]\)/pci_bus_write_config_\1/'
 
        all_kconfigs | xargs $1 -a                              \
        --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
index c05bcd293d8c636798b21207027c925a335d7cea..b51d787176d323bb3a2d6f0016b2d2cf4db16d3d 100755 (executable)
@@ -1873,10 +1873,10 @@ sub make_oldconfig {
        apply_min_config;
     }
 
-    if (!run_command "$make oldnoconfig") {
-       # Perhaps oldnoconfig doesn't exist in this version of the kernel
+    if (!run_command "$make olddefconfig") {
+       # Perhaps olddefconfig doesn't exist in this version of the kernel
        # try a yes '' | oldconfig
-       doprint "oldnoconfig failed, trying yes '' | make oldconfig\n";
+       doprint "olddefconfig failed, trying yes '' | make oldconfig\n";
        run_command "yes '' | $make oldconfig" or
            dodie "failed make config oldconfig";
     }
@@ -1929,7 +1929,7 @@ sub build {
 
     # old config can ask questions
     if ($type eq "oldconfig") {
-       $type = "oldnoconfig";
+       $type = "olddefconfig";
 
        # allow for empty configs
        run_command "touch $output_config";
@@ -1959,7 +1959,7 @@ sub build {
        load_force_config($minconfig);
     }
 
-    if ($type ne "oldnoconfig") {
+    if ($type ne "olddefconfig") {
        run_command "$make $type" or
            dodie "failed make config";
     }
@@ -2458,8 +2458,7 @@ my %config_set;
 
 # config_off holds the set of configs that the bad config had disabled.
 # We need to record them and set them in the .config when running
-# oldnoconfig, because oldnoconfig does not turn off new symbols, but
-# instead just keeps the defaults.
+# olddefconfig, because olddefconfig keeps the defaults.
 my %config_off;
 
 # config_off_tmp holds a set of configs to turn off for now
@@ -3250,7 +3249,7 @@ sub test_this_config {
     }
 
     # Remove this config from the list of configs
-    # do a make oldnoconfig and then read the resulting
+    # do a make olddefconfig and then read the resulting
     # .config to make sure it is missing the config that
     # we had before
     my %configs = %min_configs;