Fix build-error (pointy hat; didn't merge full up-to-date code)

MFC after:	21 days
X-MFC-to:	stable/10 stable/9
X-MFC-with:	274116
This commit is contained in:
Devin Teske 2014-11-05 01:47:25 +00:00
parent e8f6aafb54
commit 964b46aaea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274120
3 changed files with 61 additions and 61 deletions

View file

@ -49,58 +49,58 @@ char gauge_color[STR_BUFSIZE] = "47b"; /* (BLUE,WHITE,ON) */
char separator[STR_BUFSIZE] = "";
/* Function prototypes */
static int setattr(struct config *, uint32_t, char *, char *);
static int setbool(struct config *, uint32_t, char *, char *);
static int setnum(struct config *, uint32_t, char *, char *);
static int setstr(struct config *, uint32_t, char *, char *);
static int setattr(struct fp_config *, uint32_t, char *, char *);
static int setbool(struct fp_config *, uint32_t, char *, char *);
static int setnum(struct fp_config *, uint32_t, char *, char *);
static int setstr(struct fp_config *, uint32_t, char *, char *);
/*
* Anatomy of DIALOGRC (~/.dialogrc by default)
* NOTE: Must appear after private function prototypes (above)
* NB: Brace-initialization of union requires cast to *first* member of union
*/
static struct config dialogrc_config[] = {
/* TYPE Directive DEFAULT HANDLER */
{TYPE_INT, "aspect", {(void *)0}, &setnum},
{TYPE_STR, "separate_widget", {separator}, &setstr},
{TYPE_INT, "tab_len", {(void *)0}, &setnum},
{TYPE_BOOL, "visit_items", {(void *)0}, &setbool},
{TYPE_BOOL, "use_shadow", {(void *)1}, &setbool},
{TYPE_BOOL, "use_colors", {(void *)1}, &setbool},
{TYPE_STR, "screen_color", {NULL}, &setattr},
{TYPE_STR, "shadow_color", {NULL}, &setattr},
{TYPE_STR, "dialog_color", {NULL}, &setattr},
{TYPE_STR, "title_color", {NULL}, &setattr},
{TYPE_STR, "border_color", {NULL}, &setattr},
{TYPE_STR, "button_active_color", {NULL}, &setattr},
{TYPE_STR, "button_inactive_color", {NULL}, &setattr},
{TYPE_STR, "button_key_active_color", {NULL}, &setattr},
{TYPE_STR, "button_key_inactive_color", {NULL}, &setattr},
{TYPE_STR, "button_label_active_color", {NULL}, &setattr},
{TYPE_STR, "button_label_inactive_color", {NULL}, &setattr},
{TYPE_STR, "inputbox_color", {NULL}, &setattr},
{TYPE_STR, "inputbox_border_color", {NULL}, &setattr},
{TYPE_STR, "searchbox_color", {NULL}, &setattr},
{TYPE_STR, "searchbox_title_color", {NULL}, &setattr},
{TYPE_STR, "searchbox_border_color", {NULL}, &setattr},
{TYPE_STR, "position_indicator_color", {NULL}, &setattr},
{TYPE_STR, "menubox_color", {NULL}, &setattr},
{TYPE_STR, "menubox_border_color", {NULL}, &setattr},
{TYPE_STR, "item_color", {NULL}, &setattr},
{TYPE_STR, "item_selected_color", {NULL}, &setattr},
{TYPE_STR, "tag_color", {NULL}, &setattr},
{TYPE_STR, "tag_selected_color", {NULL}, &setattr},
{TYPE_STR, "tag_key_color", {NULL}, &setattr},
{TYPE_STR, "tag_key_selected_color", {NULL}, &setattr},
{TYPE_STR, "check_color", {NULL}, &setattr},
{TYPE_STR, "check_selected_color", {NULL}, &setattr},
{TYPE_STR, "uarrow_color", {NULL}, &setattr},
{TYPE_STR, "darrow_color", {NULL}, &setattr},
{TYPE_STR, "itemhelp_color", {NULL}, &setattr},
{TYPE_STR, "form_active_text_color", {NULL}, &setattr},
{TYPE_STR, "form_text_color", {NULL}, &setattr},
{TYPE_STR, "form_item_readonly_color", {NULL}, &setattr},
{TYPE_STR, "gauge_color", {gauge_color}, &setattr},
static struct fp_config dialogrc_config[] = {
/* TYPE Directive DEFAULT HANDLER */
{FP_TYPE_INT, "aspect", {(void *)0}, &setnum},
{FP_TYPE_STR, "separate_widget", {separator}, &setstr},
{FP_TYPE_INT, "tab_len", {(void *)0}, &setnum},
{FP_TYPE_BOOL, "visit_items", {(void *)0}, &setbool},
{FP_TYPE_BOOL, "use_shadow", {(void *)1}, &setbool},
{FP_TYPE_BOOL, "use_colors", {(void *)1}, &setbool},
{FP_TYPE_STR, "screen_color", {NULL}, &setattr},
{FP_TYPE_STR, "shadow_color", {NULL}, &setattr},
{FP_TYPE_STR, "dialog_color", {NULL}, &setattr},
{FP_TYPE_STR, "title_color", {NULL}, &setattr},
{FP_TYPE_STR, "border_color", {NULL}, &setattr},
{FP_TYPE_STR, "button_active_color", {NULL}, &setattr},
{FP_TYPE_STR, "button_inactive_color", {NULL}, &setattr},
{FP_TYPE_STR, "button_key_active_color", {NULL}, &setattr},
{FP_TYPE_STR, "button_key_inactive_color", {NULL}, &setattr},
{FP_TYPE_STR, "button_label_active_color", {NULL}, &setattr},
{FP_TYPE_STR, "button_label_inactive_color",{NULL}, &setattr},
{FP_TYPE_STR, "inputbox_color", {NULL}, &setattr},
{FP_TYPE_STR, "inputbox_border_color", {NULL}, &setattr},
{FP_TYPE_STR, "searchbox_color", {NULL}, &setattr},
{FP_TYPE_STR, "searchbox_title_color", {NULL}, &setattr},
{FP_TYPE_STR, "searchbox_border_color", {NULL}, &setattr},
{FP_TYPE_STR, "position_indicator_color", {NULL}, &setattr},
{FP_TYPE_STR, "menubox_color", {NULL}, &setattr},
{FP_TYPE_STR, "menubox_border_color", {NULL}, &setattr},
{FP_TYPE_STR, "item_color", {NULL}, &setattr},
{FP_TYPE_STR, "item_selected_color", {NULL}, &setattr},
{FP_TYPE_STR, "tag_color", {NULL}, &setattr},
{FP_TYPE_STR, "tag_selected_color", {NULL}, &setattr},
{FP_TYPE_STR, "tag_key_color", {NULL}, &setattr},
{FP_TYPE_STR, "tag_key_selected_color", {NULL}, &setattr},
{FP_TYPE_STR, "check_color", {NULL}, &setattr},
{FP_TYPE_STR, "check_selected_color", {NULL}, &setattr},
{FP_TYPE_STR, "uarrow_color", {NULL}, &setattr},
{FP_TYPE_STR, "darrow_color", {NULL}, &setattr},
{FP_TYPE_STR, "itemhelp_color", {NULL}, &setattr},
{FP_TYPE_STR, "form_active_text_color", {NULL}, &setattr},
{FP_TYPE_STR, "form_text_color", {NULL}, &setattr},
{FP_TYPE_STR, "form_item_readonly_color", {NULL}, &setattr},
{FP_TYPE_STR, "gauge_color", {gauge_color}, &setattr},
{0, NULL, {0}, NULL}
};
@ -108,7 +108,7 @@ static struct config dialogrc_config[] = {
* figpar call-back for interpreting value as .dialogrc `Attribute'
*/
static int
setattr(struct config *option, uint32_t line __unused,
setattr(struct fp_config *option, uint32_t line __unused,
char *directive __unused, char *value)
{
char *cp = value;
@ -204,7 +204,7 @@ setattr(struct config *option, uint32_t line __unused,
* figpar call-back for interpreting value as .dialogrc `Boolean'
*/
static int
setbool(struct config *option, uint32_t line __unused,
setbool(struct fp_config *option, uint32_t line __unused,
char *directive __unused, char *value)
{
@ -227,8 +227,8 @@ setbool(struct config *option, uint32_t line __unused,
* figpar call-back for interpreting value as .dialogrc `Number'
*/
static int
setnum(struct config *option, uint32_t line __unused, char *directive __unused,
char *value)
setnum(struct fp_config *option, uint32_t line __unused,
char *directive __unused, char *value)
{
if (option == NULL) {
@ -247,8 +247,8 @@ setnum(struct config *option, uint32_t line __unused, char *directive __unused,
* figpar call-back for interpreting value as .dialogrc `String'
*/
static int
setstr(struct config *option, uint32_t line __unused, char *directive __unused,
char *value)
setstr(struct fp_config *option, uint32_t line __unused,
char *directive __unused, char *value)
{
size_t len;
@ -315,7 +315,7 @@ parse_dialogrc(void)
}
/* Process file (either $DIALOGRC if set, or `$HOME/.dialogrc') */
res = parse_config(dialogrc_config, path, NULL, BREAK_ON_EQUALS);
res = parse_config(dialogrc_config, path, NULL, FP_BREAK_ON_EQUALS);
/* Set some globals based on what we parsed */
use_shadow = dialogrc_config_option("use_shadow")->value.boolean;
@ -328,10 +328,10 @@ parse_dialogrc(void)
/*
* Return a pointer to the `.dialogrc' config option specific to `directive' or
* static dummy_config (full of NULLs) if none found (see get_config_option(3);
* part of figpar(3)).
* static fp_dummy_config (full of NULLs) if none found (see
* get_config_option(3); part of figpar(3)).
*/
struct config *
struct fp_config *
dialogrc_config_option(const char *directive)
{
return (get_config_option(dialogrc_config, directive));

View file

@ -48,9 +48,9 @@ extern char gauge_color[];
extern char separator[];
__BEGIN_DECLS
void dialogrc_free(void);
int parse_dialogrc(void);
struct config *dialogrc_config_option(const char *_directive);
void dialogrc_free(void);
int parse_dialogrc(void);
struct fp_config *dialogrc_config_option(const char *_directive);
__END_DECLS
#endif /* !_DIALOGRC_H_ */

View file

@ -177,7 +177,7 @@ operate_on_bytes(struct dpv_file_node *file, int out)
fsync(out);
}
overall_read += r;
dpv_overall_read += r;
file->read += r;
/* Calculate percentage of completion (if possible) */
@ -226,7 +226,7 @@ operate_on_lines(struct dpv_file_node *file, int out)
/* Process the buffer for number of lines */
for (p = buf; p != NULL && *p != '\0';)
if ((p = strchr(p, '\n')) != NULL)
overall_read++, p++, file->read++;
dpv_overall_read++, p++, file->read++;
/* Calculate percentage of completion (if possible) */
if (file->length >= 0) {