From owner-svn-src-head@FreeBSD.ORG Wed Nov 23 19:06:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02012106566B; Wed, 23 Nov 2011 19:06:31 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E506A8FC15; Wed, 23 Nov 2011 19:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANJ6UG8059102; Wed, 23 Nov 2011 19:06:30 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANJ6Uq5059099; Wed, 23 Nov 2011 19:06:30 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111231906.pANJ6Uq5059099@svn.freebsd.org> From: Max Khon Date: Wed, 23 Nov 2011 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227902 - head/usr.sbin/sade X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 19:06:31 -0000 Author: fjoe Date: Wed Nov 23 19:06:30 2011 New Revision: 227902 URL: http://svn.freebsd.org/changeset/base/227902 Log: - Remove unused old libdialog includes - Remove unused functions Modified: head/usr.sbin/sade/misc.c head/usr.sbin/sade/sade.h Modified: head/usr.sbin/sade/misc.c ============================================================================== --- head/usr.sbin/sade/misc.c Wed Nov 23 18:38:08 2011 (r227901) +++ head/usr.sbin/sade/misc.c Wed Nov 23 19:06:30 2011 (r227902) @@ -226,51 +226,6 @@ root_bias(char *path) return tmp; } -/* - * These next routines are kind of specialized just for building item lists - * for dialog_menu(). - */ - -/* Add an item to an item list */ -dialogMenuItem * -item_add(dialogMenuItem *list, char *prompt, char *title, - int (*checked)(dialogMenuItem *self), - int (*fire)(dialogMenuItem *self), - void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int *aux, int *curr, int *max) -{ - dialogMenuItem *d; - - if (*curr == *max) { - *max += 20; - list = (dialogMenuItem *)safe_realloc(list, sizeof(dialogMenuItem) * *max); - } - d = &list[(*curr)++]; - bzero(d, sizeof(*d)); - d->prompt = prompt ? strdup(prompt) : NULL; - d->title = title ? strdup(title) : NULL; - d->checked = checked; - d->fire = fire; - d->selected = selected; - d->data = data; - d->aux = (long)aux; - return list; -} - -/* Toss the items out */ -void -items_free(dialogMenuItem *list, int *curr, int *max) -{ - int i; - - for (i = 0; list[i].prompt; i++) { - safe_free(list[i].prompt); - safe_free(list[i].title); - } - safe_free(list); - *curr = *max = 0; -} - int Mkdir(char *ipath) { @@ -311,12 +266,6 @@ Mkdir(char *ipath) } int -Mkdir_command(char *key, void *dir) -{ - return (Mkdir((char*)dir)); -} - -int Mount(char *mountp, void *dev) { struct ufs_args ufsargs; @@ -353,126 +302,6 @@ Mount(char *mountp, void *dev) } WINDOW * -openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height) -{ - WINDOW *win; - static char help[FILENAME_MAX]; - - /* We need a curses window */ - win = newwin(LINES, COLS, 0, 0); - if (win) { - /* Say where our help comes from */ - if (helpfile) { - use_helpline("Press F1 for more information on this screen."); - use_helpfile(systemHelpFile(helpfile, help)); - } - /* Setup a nice screen for us to splat stuff onto */ - draw_box(win, y, x, height, width, dialog_attr, border_attr); - wattrset(win, dialog_attr); - mvwaddstr(win, y, x + (COLS - strlen(title)) / 2, title); - } - return win; -} - -ComposeObj * -initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max) -{ - ComposeObj *obj = NULL, *first; - int n; - - /* Loop over the layout list, create the objects, and add them - onto the chain of objects that dialog uses for traversal*/ - - n = 0; - while (layout[n].help != NULL) { - int t = TYPE_OF_OBJ(layout[n].type); - - switch (t) { - case STRINGOBJ: - layout[n].obj = NewStringObj(win, layout[n].prompt, layout[n].var, - layout[n].y + y, layout[n].x + x, layout[n].len, layout[n].maxlen); - ((StringObj *)layout[n].obj)->attr_mask = ATTR_OF_OBJ(layout[n].type); - break; - - case BUTTONOBJ: - layout[n].obj = NewButtonObj(win, layout[n].prompt, layout[n].var, layout[n].y + y, layout[n].x + x); - break; - - default: - msgFatal("Don't support this object yet!"); - } - AddObj(&obj, t, (void *) layout[n].obj); - n++; - } - *max = n - 1; - /* Find the first object in the list */ - for (first = obj; first->prev; first = first->prev); - return first; -} - -int -layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, int *n, int max, int *cbutton, int *cancel) -{ - char help_line[80]; - int ret, i, len = strlen(layout[*n].help); - - /* Display the help line at the bottom of the screen */ - for (i = 0; i < 79; i++) - help_line[i] = (i < len) ? layout[*n].help[i] : ' '; - help_line[i] = '\0'; - use_helpline(help_line); - display_helpline(win, LINES - 1, COLS - 1); - wrefresh(win); - - /* Ask for libdialog to do its stuff */ - ret = PollObj(obj); - /* Handle special case stuff that libdialog misses. Sigh */ - switch (ret) { - case SEL_ESC: /* Bail out */ - *cancel = TRUE; - return FALSE; - - /* This doesn't work for list dialogs. Oh well. Perhaps - should special case the move from the OK button ``up'' - to make it go to the interface list, but then it gets - awkward for the user to go back and correct screw up's - in the per-interface section */ - case KEY_DOWN: - case SEL_CR: - case SEL_TAB: - if (*n < max) - ++*n; - else - *n = 0; - break; - - /* The user has pressed enter over a button object */ - case SEL_BUTTON: - if (cbutton && *cbutton) - *cancel = TRUE; - else - *cancel = FALSE; - return FALSE; - - case KEY_UP: - case SEL_BACKTAB: - if (*n) - --*n; - else - *n = max; - break; - - case KEY_F(1): - display_helpfile(); - - /* They tried some key combination we don't support - tootle them forcefully! */ - default: - beep(); - } - return TRUE; -} - -WINDOW * savescr(void) { WINDOW *w; Modified: head/usr.sbin/sade/sade.h ============================================================================== --- head/usr.sbin/sade/sade.h Wed Nov 23 18:38:08 2011 (r227901) +++ head/usr.sbin/sade/sade.h Wed Nov 23 19:06:30 2011 (r227902) @@ -40,9 +40,6 @@ #include #include #include -#include "ui_objects.h" -#include "dir.h" -#include "colors.h" /*** Defines ***/ @@ -403,19 +400,8 @@ extern char *pathBaseName(const char *pa extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); extern void *safe_realloc(void *orig, size_t size); -extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, - int (*checked)(dialogMenuItem *self), - int (*fire)(dialogMenuItem *self), - void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int *aux, int *curr, int *max); -extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); -extern int Mkdir_command(char *key, void *data); extern int Mount(char *, void *data); -extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height); -extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max); -extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, - int *n, int max, int *cbutton, int *cancel); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w);