From b7ada7f2444f41b672faef4f93e446bdf8584cf9 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 17 May 2001 08:21:06 +0000 Subject: Import ncurses-5.2-20010512 onto the vendor branch Obtained from: ftp://dickey.his.com/ncurses/ --- contrib/ncurses/form/Makefile.in | 13 ++- contrib/ncurses/form/fld_arg.c | 17 +-- contrib/ncurses/form/fld_attr.c | 8 +- contrib/ncurses/form/fld_current.c | 13 ++- contrib/ncurses/form/fld_def.c | 39 ++++--- contrib/ncurses/form/fld_dup.c | 7 +- contrib/ncurses/form/fld_ftchoice.c | 12 ++- contrib/ncurses/form/fld_ftlink.c | 8 +- contrib/ncurses/form/fld_info.c | 19 ++-- contrib/ncurses/form/fld_just.c | 10 +- contrib/ncurses/form/fld_link.c | 7 +- contrib/ncurses/form/fld_max.c | 7 +- contrib/ncurses/form/fld_move.c | 7 +- contrib/ncurses/form/fld_newftyp.c | 12 ++- contrib/ncurses/form/fld_opts.c | 16 +-- contrib/ncurses/form/fld_pad.c | 10 +- contrib/ncurses/form/fld_page.c | 10 +- contrib/ncurses/form/fld_stat.c | 10 +- contrib/ncurses/form/fld_type.c | 10 +- contrib/ncurses/form/fld_user.c | 10 +- contrib/ncurses/form/form.h | 205 ++++++++++++++++++------------------ contrib/ncurses/form/form.priv.h | 34 +++--- contrib/ncurses/form/frm_cursor.c | 7 +- contrib/ncurses/form/frm_data.c | 10 +- contrib/ncurses/form/frm_def.c | 21 ++-- contrib/ncurses/form/frm_driver.c | 58 ++++++---- contrib/ncurses/form/frm_hook.c | 8 +- contrib/ncurses/form/frm_opts.c | 16 +-- contrib/ncurses/form/frm_page.c | 10 +- contrib/ncurses/form/frm_post.c | 10 +- contrib/ncurses/form/frm_req_name.c | 10 +- contrib/ncurses/form/frm_scale.c | 7 +- contrib/ncurses/form/frm_sub.c | 10 +- contrib/ncurses/form/frm_user.c | 10 +- contrib/ncurses/form/frm_win.c | 10 +- contrib/ncurses/form/fty_alnum.c | 4 +- contrib/ncurses/form/fty_alpha.c | 4 +- contrib/ncurses/form/fty_enum.c | 6 +- contrib/ncurses/form/fty_int.c | 4 +- contrib/ncurses/form/fty_ipv4.c | 8 +- contrib/ncurses/form/fty_num.c | 4 +- contrib/ncurses/form/fty_regex.c | 4 +- 42 files changed, 393 insertions(+), 312 deletions(-) (limited to 'contrib/ncurses/form') diff --git a/contrib/ncurses/form/Makefile.in b/contrib/ncurses/form/Makefile.in index 9c40f8a..8f3f297 100644 --- a/contrib/ncurses/form/Makefile.in +++ b/contrib/ncurses/form/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.30 2000/08/26 21:51:44 tom Exp $ +# $Id: Makefile.in,v 1.32 2001/03/24 19:53:31 tom Exp $ ############################################################################## -# Copyright (c) 1998-2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -53,6 +53,8 @@ exec_prefix = @exec_prefix@ libdir = @libdir@ includedir = @includedir@ +LIBTOOL = @LIBTOOL@ + INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ INSTALL_DATA = @INSTALL_DATA@ @@ -72,6 +74,7 @@ CPPFLAGS = @CPPFLAGS@ \ CCFLAGS = $(CPPFLAGS) $(CFLAGS) +CFLAGS_LIBTOOL = $(CCFLAGS) CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg @@ -79,7 +82,7 @@ CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) -LINK = $(CC) +LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ SHLIB_DIRS = -L../lib -L$(libdir) @@ -87,6 +90,8 @@ SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ MK_SHARED_LIB = @MK_SHARED_LIB@ +NCURSES_MAJOR = @NCURSES_MAJOR@ +NCURSES_MINOR = @NCURSES_MINOR@ REL_VERSION = @cf_cv_rel_version@ ABI_VERSION = @cf_cv_abi_version@ @@ -131,7 +136,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/contrib/ncurses/form/fld_arg.c b/contrib/ncurses/form/fld_arg.c index bc816e9..dcbae59 100644 --- a/contrib/ncurses/form/fld_arg.c +++ b/contrib/ncurses/form/fld_arg.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_arg.c,v 1.4 1999/05/16 17:16:04 juergen Exp $") +MODULE_ID("$Id: fld_arg.c,v 1.5 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -60,10 +60,12 @@ MODULE_ID("$Id: fld_arg.c,v 1.4 1999/05/16 17:16:04 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid argument +--------------------------------------------------------------------------*/ -int set_fieldtype_arg(FIELDTYPE * typ, - void * (* const make_arg)(va_list *), - void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)) +NCURSES_EXPORT(int) +set_fieldtype_arg + (FIELDTYPE * typ, + void * (* const make_arg)(va_list *), + void * (* const copy_arg)(const void *), + void (* const free_arg)(void *)) { if ( !typ || !make_arg ) RETURN(E_BAD_ARGUMENT); @@ -83,7 +85,8 @@ int set_fieldtype_arg(FIELDTYPE * typ, | | Return Values : Pointer to structure or NULL if none is defined. +--------------------------------------------------------------------------*/ -void *field_arg(const FIELD * field) +NCURSES_EXPORT(void *) +field_arg (const FIELD * field) { return Normalize_Field(field)->arg; } diff --git a/contrib/ncurses/form/fld_attr.c b/contrib/ncurses/form/fld_attr.c index 3c7d8e3..cd584d0 100644 --- a/contrib/ncurses/form/fld_attr.c +++ b/contrib/ncurses/form/fld_attr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,14 +31,14 @@ ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_attr.c,v 1.4 1999/05/16 17:16:30 juergen Exp $") +MODULE_ID("$Id: fld_attr.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*---------------------------------------------------------------------------- Field-Attribute manipulation routines --------------------------------------------------------------------------*/ /* "Template" macro to generate a function to set a fields attribute */ #define GEN_FIELD_ATTR_SET_FCT( name ) \ -int set_field_ ## name (FIELD * field, chtype attr)\ +NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ {\ int res = E_BAD_ARGUMENT;\ if ( attr==A_NORMAL || ((attr & A_ATTRIBUTES)==attr) )\ @@ -57,7 +57,7 @@ int set_field_ ## name (FIELD * field, chtype attr)\ /* "Template" macro to generate a function to get a fields attribute */ #define GEN_FIELD_ATTR_GET_FCT( name ) \ -chtype field_ ## name (const FIELD * field)\ +NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ {\ return ( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\ } diff --git a/contrib/ncurses/form/fld_current.c b/contrib/ncurses/form/fld_current.c index 2bf8163..b23d21c 100644 --- a/contrib/ncurses/form/fld_current.c +++ b/contrib/ncurses/form/fld_current.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_current.c,v 1.4 1999/05/16 17:16:46 juergen Exp $") +MODULE_ID("$Id: fld_current.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,7 +46,8 @@ MODULE_ID("$Id: fld_current.c,v 1.4 1999/05/16 17:16:46 juergen Exp $") | E_INVALID_FIELD - current field can't be left | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_current_field(FORM * form, FIELD * field) +NCURSES_EXPORT(int) +set_current_field (FORM * form, FIELD * field) { int err = E_OK; @@ -101,7 +102,8 @@ int set_current_field(FORM * form, FIELD * field) | | Return Values : Pointer to the current field. +--------------------------------------------------------------------------*/ -FIELD *current_field(const FORM * form) +NCURSES_EXPORT(FIELD *) +current_field (const FORM * form) { return Normalize_Form(form)->current; } @@ -116,7 +118,8 @@ FIELD *current_field(const FORM * form) | Return Values : >= 0 : field index | -1 : fieldpointer invalid or field not connected +--------------------------------------------------------------------------*/ -int field_index(const FIELD * field) +NCURSES_EXPORT(int) +field_index (const FIELD * field) { return ( (field && field->form) ? field->index : -1 ); } diff --git a/contrib/ncurses/form/fld_def.c b/contrib/ncurses/form/fld_def.c index dd3de80..e12179e 100644 --- a/contrib/ncurses/form/fld_def.c +++ b/contrib/ncurses/form/fld_def.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_def.c,v 1.12 1999/05/16 17:37:48 juergen Exp $") +MODULE_ID("$Id: fld_def.c,v 1.13 2000/12/10 02:09:38 tom Exp $") /* this can't be readonly */ static FIELD default_field = { @@ -63,7 +63,7 @@ static FIELD default_field = { (char *)0 /* usrptr */ }; -FIELD *_nc_Default_Field = &default_field; +NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; /*--------------------------------------------------------------------------- | Facility : libnform @@ -79,8 +79,9 @@ FIELD *_nc_Default_Field = &default_field; | Return Values : Pointer to argument structure. Maybe NULL. | In case of an error in *err an errorcounter is increased. +--------------------------------------------------------------------------*/ -TypeArgument* -_nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) +NCURSES_EXPORT(TypeArgument*) +_nc_Make_Argument +(const FIELDTYPE *typ, va_list *ap, int *err) { TypeArgument *res = (TypeArgument *)0; TypeArgument *p; @@ -121,9 +122,10 @@ _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) | Return Values : Pointer to argument structure. Maybe NULL. | In case of an error in *err an errorcounter is increased. +--------------------------------------------------------------------------*/ -TypeArgument* -_nc_Copy_Argument(const FIELDTYPE *typ, - const TypeArgument *argp, int *err) +NCURSES_EXPORT(TypeArgument*) +_nc_Copy_Argument + (const FIELDTYPE *typ, + const TypeArgument *argp, int *err) { TypeArgument *res = (TypeArgument *)0; TypeArgument *p; @@ -166,8 +168,9 @@ _nc_Copy_Argument(const FIELDTYPE *typ, | | Return Values : - +--------------------------------------------------------------------------*/ -void -_nc_Free_Argument(const FIELDTYPE * typ, TypeArgument * argp) +NCURSES_EXPORT(void) +_nc_Free_Argument +(const FIELDTYPE * typ, TypeArgument * argp) { if (!typ || !(typ->status & _HAS_ARGS)) return; @@ -195,8 +198,9 @@ _nc_Free_Argument(const FIELDTYPE * typ, TypeArgument * argp) | Return Values : TRUE - copy worked | FALSE - error occured +--------------------------------------------------------------------------*/ -bool -_nc_Copy_Type(FIELD *dst, FIELD const *src) +NCURSES_EXPORT(bool) +_nc_Copy_Type +(FIELD *dst, FIELD const *src) { int err = 0; @@ -228,8 +232,8 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src) | | Return Values : - +--------------------------------------------------------------------------*/ -void -_nc_Free_Type(FIELD *field) +NCURSES_EXPORT(void) +_nc_Free_Type (FIELD *field) { assert(field); if (field->type) @@ -253,7 +257,9 @@ _nc_Free_Type(FIELD *field) | | Return Values : Pointer to the new field or NULL if failure. +--------------------------------------------------------------------------*/ -FIELD *new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) +NCURSES_EXPORT(FIELD *) +new_field +(int rows, int cols, int frow, int fcol, int nrow, int nbuf) { FIELD *New_Field = (FIELD *)0; int err = E_BAD_ARGUMENT; @@ -317,7 +323,8 @@ FIELD *new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) | E_BAD_ARGUMENT - invalid field pointer | E_CONNECTED - field is connected +--------------------------------------------------------------------------*/ -int free_field(FIELD * field) +NCURSES_EXPORT(int) +free_field (FIELD * field) { if (!field) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/fld_dup.c b/contrib/ncurses/form/fld_dup.c index d265f95..4aed772 100644 --- a/contrib/ncurses/form/fld_dup.c +++ b/contrib/ncurses/form/fld_dup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_dup.c,v 1.4 1999/05/16 17:17:08 juergen Exp $") +MODULE_ID("$Id: fld_dup.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -47,7 +47,8 @@ MODULE_ID("$Id: fld_dup.c,v 1.4 1999/05/16 17:17:08 juergen Exp $") | | Return Values : Pointer to the new field or NULL if failure +--------------------------------------------------------------------------*/ -FIELD *dup_field(FIELD * field, int frow, int fcol) +NCURSES_EXPORT(FIELD *) +dup_field (FIELD * field, int frow, int fcol) { FIELD *New_Field = (FIELD *)0; int err = E_BAD_ARGUMENT; diff --git a/contrib/ncurses/form/fld_ftchoice.c b/contrib/ncurses/form/fld_ftchoice.c index 8e7d2a9..377f9ab 100644 --- a/contrib/ncurses/form/fld_ftchoice.c +++ b/contrib/ncurses/form/fld_ftchoice.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_ftchoice.c,v 1.4 1999/05/16 17:17:21 juergen Exp $") +MODULE_ID("$Id: fld_ftchoice.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,9 +46,11 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.4 1999/05/16 17:17:21 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid arguments +--------------------------------------------------------------------------*/ -int set_fieldtype_choice(FIELDTYPE * typ, - bool (* const next_choice) (FIELD *,const void *), - bool (* const prev_choice) (FIELD *,const void *)) +NCURSES_EXPORT(int) +set_fieldtype_choice + (FIELDTYPE * typ, + bool (* const next_choice) (FIELD *,const void *), + bool (* const prev_choice) (FIELD *,const void *)) { if ( !typ || !next_choice || !prev_choice ) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/fld_ftlink.c b/contrib/ncurses/form/fld_ftlink.c index 1c30cab..87aa661 100644 --- a/contrib/ncurses/form/fld_ftlink.c +++ b/contrib/ncurses/form/fld_ftlink.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_ftlink.c,v 1.4 1999/05/16 17:17:33 juergen Exp $") +MODULE_ID("$Id: fld_ftlink.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -48,7 +48,9 @@ MODULE_ID("$Id: fld_ftlink.c,v 1.4 1999/05/16 17:17:33 juergen Exp $") | | Return Values : Fieldtype pointer or NULL if error occured. +--------------------------------------------------------------------------*/ -FIELDTYPE *link_fieldtype(FIELDTYPE * type1, FIELDTYPE * type2) +NCURSES_EXPORT(FIELDTYPE *) +link_fieldtype +(FIELDTYPE * type1, FIELDTYPE * type2) { FIELDTYPE *nftyp = (FIELDTYPE *)0; diff --git a/contrib/ncurses/form/fld_info.c b/contrib/ncurses/form/fld_info.c index 98100a4..be4fd06 100644 --- a/contrib/ncurses/form/fld_info.c +++ b/contrib/ncurses/form/fld_info.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_info.c,v 1.4 1999/05/16 17:17:52 juergen Exp $") +MODULE_ID("$Id: fld_info.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,10 +46,12 @@ MODULE_ID("$Id: fld_info.c,v 1.4 1999/05/16 17:17:52 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid field pointer +--------------------------------------------------------------------------*/ -int field_info(const FIELD *field, - int *rows, int *cols, - int *frow, int *fcol, - int *nrow, int *nbuf) +NCURSES_EXPORT(int) +field_info + (const FIELD *field, + int *rows, int *cols, + int *frow, int *fcol, + int *nrow, int *nbuf) { if (!field) RETURN(E_BAD_ARGUMENT); @@ -75,8 +77,9 @@ int field_info(const FIELD *field, | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid argument +--------------------------------------------------------------------------*/ -int dynamic_field_info(const FIELD *field, - int *drows, int *dcols, int *maxgrow) +NCURSES_EXPORT(int) +dynamic_field_info +(const FIELD *field, int *drows, int *dcols, int *maxgrow) { if (!field) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/fld_just.c b/contrib/ncurses/form/fld_just.c index 2a6dd38..a30f2f9 100644 --- a/contrib/ncurses/form/fld_just.c +++ b/contrib/ncurses/form/fld_just.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_just.c,v 1.5 1999/05/16 17:18:06 juergen Exp $") +MODULE_ID("$Id: fld_just.c,v 1.6 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +44,8 @@ MODULE_ID("$Id: fld_just.c,v 1.5 1999/05/16 17:18:06 juergen Exp $") | E_BAD_ARGUMENT - one of the arguments was incorrect | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_just(FIELD * field, int just) +NCURSES_EXPORT(int) +set_field_just (FIELD * field, int just) { int res = E_BAD_ARGUMENT; @@ -73,7 +74,8 @@ int set_field_just(FIELD * field, int just) | | Return Values : The justification type. +--------------------------------------------------------------------------*/ -int field_just(const FIELD * field) +NCURSES_EXPORT(int) +field_just (const FIELD * field) { return Normalize_Field( field )->just; } diff --git a/contrib/ncurses/form/fld_link.c b/contrib/ncurses/form/fld_link.c index 4352d6a..0b0a033 100644 --- a/contrib/ncurses/form/fld_link.c +++ b/contrib/ncurses/form/fld_link.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_link.c,v 1.4 1999/05/16 17:18:18 juergen Exp $") +MODULE_ID("$Id: fld_link.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -48,7 +48,8 @@ MODULE_ID("$Id: fld_link.c,v 1.4 1999/05/16 17:18:18 juergen Exp $") | | Return Values : Pointer to the new field or NULL if failure +--------------------------------------------------------------------------*/ -FIELD *link_field(FIELD * field, int frow, int fcol) +NCURSES_EXPORT(FIELD *) +link_field (FIELD * field, int frow, int fcol) { FIELD *New_Field = (FIELD *)0; int err = E_BAD_ARGUMENT; diff --git a/contrib/ncurses/form/fld_max.c b/contrib/ncurses/form/fld_max.c index f17bcec..2e5e238 100644 --- a/contrib/ncurses/form/fld_max.c +++ b/contrib/ncurses/form/fld_max.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_max.c,v 1.4 1999/05/16 17:18:34 juergen Exp $") +MODULE_ID("$Id: fld_max.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +44,8 @@ MODULE_ID("$Id: fld_max.c,v 1.4 1999/05/16 17:18:34 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid argument +--------------------------------------------------------------------------*/ -int set_max_field(FIELD *field, int maxgrow) +NCURSES_EXPORT(int) +set_max_field (FIELD *field, int maxgrow) { if (!field || (maxgrow<0)) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/fld_move.c b/contrib/ncurses/form/fld_move.c index 7965d5a..fc37156 100644 --- a/contrib/ncurses/form/fld_move.c +++ b/contrib/ncurses/form/fld_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_move.c,v 1.4 1999/05/16 17:38:51 juergen Exp $") +MODULE_ID("$Id: fld_move.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -45,7 +45,8 @@ MODULE_ID("$Id: fld_move.c,v 1.4 1999/05/16 17:38:51 juergen Exp $") | E_BAD_ARGUMENT - invalid argument passed | E_CONNECTED - field is connected +--------------------------------------------------------------------------*/ -int move_field(FIELD *field, int frow, int fcol) +NCURSES_EXPORT(int) +move_field (FIELD *field, int frow, int fcol) { if ( !field || (frow<0) || (fcol<0) ) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/fld_newftyp.c b/contrib/ncurses/form/fld_newftyp.c index 68b1692..e0c8b33 100644 --- a/contrib/ncurses/form/fld_newftyp.c +++ b/contrib/ncurses/form/fld_newftyp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_newftyp.c,v 1.5 1999/05/16 17:18:54 juergen Exp $") +MODULE_ID("$Id: fld_newftyp.c,v 1.6 2000/12/10 02:09:38 tom Exp $") static FIELDTYPE const default_fieldtype = { 0, /* status */ @@ -48,7 +48,7 @@ static FIELDTYPE const default_fieldtype = { NULL /* enumerate previous function */ }; -const FIELDTYPE* _nc_Default_FieldType = &default_fieldtype; +NCURSES_EXPORT_VAR(const FIELDTYPE*) _nc_Default_FieldType = &default_fieldtype; /*--------------------------------------------------------------------------- | Facility : libnform @@ -65,7 +65,8 @@ const FIELDTYPE* _nc_Default_FieldType = &default_fieldtype; | | Return Values : Fieldtype pointer or NULL if error occured +--------------------------------------------------------------------------*/ -FIELDTYPE *new_fieldtype( +NCURSES_EXPORT(FIELDTYPE *) +new_fieldtype ( bool (* const field_check)(FIELD *,const void *), bool (* const char_check) (int,const void *) ) { @@ -102,7 +103,8 @@ FIELDTYPE *new_fieldtype( | E_CONNECTED - there are fields referencing the type | E_BAD_ARGUMENT - invalid fieldtype pointer +--------------------------------------------------------------------------*/ -int free_fieldtype(FIELDTYPE *typ) +NCURSES_EXPORT(int) +free_fieldtype (FIELDTYPE *typ) { if (!typ) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/fld_opts.c b/contrib/ncurses/form/fld_opts.c index e5cd996..19b3642 100644 --- a/contrib/ncurses/form/fld_opts.c +++ b/contrib/ncurses/form/fld_opts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_opts.c,v 1.6 1999/05/16 17:19:06 juergen Exp $") +MODULE_ID("$Id: fld_opts.c,v 1.7 2000/12/10 02:09:38 tom Exp $") /*---------------------------------------------------------------------------- Field-Options manipulation routines @@ -49,7 +49,8 @@ MODULE_ID("$Id: fld_opts.c,v 1.6 1999/05/16 17:19:06 juergen Exp $") | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_opts(FIELD * field, Field_Options opts) +NCURSES_EXPORT(int) +set_field_opts (FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; opts &= ALL_FIELD_OPTS; @@ -66,7 +67,8 @@ int set_field_opts(FIELD * field, Field_Options opts) | | Return Values : The options. +--------------------------------------------------------------------------*/ -Field_Options field_opts(const FIELD * field) +NCURSES_EXPORT(Field_Options) +field_opts (const FIELD * field) { return ALL_FIELD_OPTS & Normalize_Field( field )->opts; } @@ -83,7 +85,8 @@ Field_Options field_opts(const FIELD * field) | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int field_opts_on(FIELD * field, Field_Options opts) +NCURSES_EXPORT(int) +field_opts_on (FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; @@ -108,7 +111,8 @@ int field_opts_on(FIELD * field, Field_Options opts) | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int field_opts_off(FIELD * field, Field_Options opts) +NCURSES_EXPORT(int) +field_opts_off (FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; diff --git a/contrib/ncurses/form/fld_pad.c b/contrib/ncurses/form/fld_pad.c index 527e151..f4556b2 100644 --- a/contrib/ncurses/form/fld_pad.c +++ b/contrib/ncurses/form/fld_pad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_pad.c,v 1.4 1999/05/16 17:38:58 juergen Exp $") +MODULE_ID("$Id: fld_pad.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +44,8 @@ MODULE_ID("$Id: fld_pad.c,v 1.4 1999/05/16 17:38:58 juergen Exp $") | E_BAD_ARGUMENT - invalid field pointer or pad character | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_pad(FIELD * field, int ch) +NCURSES_EXPORT(int) +set_field_pad (FIELD * field, int ch) { int res = E_BAD_ARGUMENT; @@ -70,7 +71,8 @@ int set_field_pad(FIELD * field, int ch) | | Return Values : The pad character. +--------------------------------------------------------------------------*/ -int field_pad(const FIELD * field) +NCURSES_EXPORT(int) +field_pad (const FIELD * field) { return Normalize_Field( field )->pad; } diff --git a/contrib/ncurses/form/fld_page.c b/contrib/ncurses/form/fld_page.c index 452a507..b6ddbc7 100644 --- a/contrib/ncurses/form/fld_page.c +++ b/contrib/ncurses/form/fld_page.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_page.c,v 1.4 1999/05/16 17:19:37 juergen Exp $") +MODULE_ID("$Id: fld_page.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +44,8 @@ MODULE_ID("$Id: fld_page.c,v 1.4 1999/05/16 17:19:37 juergen Exp $") | Return Values : E_OK - success | E_CONNECTED - field is connected +--------------------------------------------------------------------------*/ -int set_new_page(FIELD * field, bool new_page_flag) +NCURSES_EXPORT(int) +set_new_page (FIELD * field, bool new_page_flag) { Normalize_Field(field); if (field->form) @@ -68,7 +69,8 @@ int set_new_page(FIELD * field, bool new_page_flag) | Return Values : TRUE - field starts a new page | FALSE - field doesn't start a new page +--------------------------------------------------------------------------*/ -bool new_page(const FIELD * field) +NCURSES_EXPORT(bool) +new_page (const FIELD * field) { return (Normalize_Field(field)->status & _NEWPAGE) ? TRUE : FALSE; } diff --git a/contrib/ncurses/form/fld_stat.c b/contrib/ncurses/form/fld_stat.c index 98144bf..df5181b 100644 --- a/contrib/ncurses/form/fld_stat.c +++ b/contrib/ncurses/form/fld_stat.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_stat.c,v 1.6 1999/05/16 17:19:48 juergen Exp $") +MODULE_ID("$Id: fld_stat.c,v 1.7 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +43,8 @@ MODULE_ID("$Id: fld_stat.c,v 1.6 1999/05/16 17:19:48 juergen Exp $") | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ -int set_field_status(FIELD * field, bool status) +NCURSES_EXPORT(int) +set_field_status (FIELD * field, bool status) { Normalize_Field( field ); @@ -65,7 +66,8 @@ int set_field_status(FIELD * field, bool status) | Return Values : TRUE - buffer has been changed | FALSE - buffer has not been changed +--------------------------------------------------------------------------*/ -bool field_status(const FIELD * field) +NCURSES_EXPORT(bool) +field_status (const FIELD * field) { return ((Normalize_Field(field)->status & _CHANGED) ? TRUE : FALSE); } diff --git a/contrib/ncurses/form/fld_type.c b/contrib/ncurses/form/fld_type.c index 238b547..831c785 100644 --- a/contrib/ncurses/form/fld_type.c +++ b/contrib/ncurses/form/fld_type.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_type.c,v 1.9 1999/05/16 17:19:59 juergen Exp $") +MODULE_ID("$Id: fld_type.c,v 1.10 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -45,7 +45,8 @@ MODULE_ID("$Id: fld_type.c,v 1.9 1999/05/16 17:19:59 juergen Exp $") | Return Values : E_OK - success | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_type(FIELD *field,FIELDTYPE *type, ...) +NCURSES_EXPORT(int) +set_field_type (FIELD *field,FIELDTYPE *type, ...) { va_list ap; int res = E_SYSTEM_ERROR; @@ -84,7 +85,8 @@ int set_field_type(FIELD *field,FIELDTYPE *type, ...) | | Return Values : Pointer to fieldtype of NULL if none is defined. +--------------------------------------------------------------------------*/ -FIELDTYPE *field_type(const FIELD * field) +NCURSES_EXPORT(FIELDTYPE *) +field_type (const FIELD * field) { return Normalize_Field(field)->type; } diff --git a/contrib/ncurses/form/fld_user.c b/contrib/ncurses/form/fld_user.c index cf5b4c2..5e668b4 100644 --- a/contrib/ncurses/form/fld_user.c +++ b/contrib/ncurses/form/fld_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_user.c,v 1.8 1999/05/16 17:20:09 juergen Exp $") +MODULE_ID("$Id: fld_user.c,v 1.9 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +43,8 @@ MODULE_ID("$Id: fld_user.c,v 1.8 1999/05/16 17:20:09 juergen Exp $") | | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ -int set_field_userptr(FIELD * field, void *usrptr) +NCURSES_EXPORT(int) +set_field_userptr (FIELD * field, void *usrptr) { Normalize_Field( field )->usrptr = usrptr; RETURN(E_OK); @@ -59,7 +60,8 @@ int set_field_userptr(FIELD * field, void *usrptr) | Return Values : Value of pointer. If no such pointer has been set, | NULL is returned +--------------------------------------------------------------------------*/ -void *field_userptr(const FIELD *field) +NCURSES_EXPORT(void *) +field_userptr (const FIELD *field) { return Normalize_Field( field )->usrptr; } diff --git a/contrib/ncurses/form/form.h b/contrib/ncurses/form/form.h index 40ae0a3..70b7a3b 100644 --- a/contrib/ncurses/form/form.h +++ b/contrib/ncurses/form/form.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -246,140 +246,135 @@ typedef void (*Form_Hook)(FORM *); /************************* * standard field types * *************************/ -extern FIELDTYPE *TYPE_ALPHA, - *TYPE_ALNUM, - *TYPE_ENUM, - *TYPE_INTEGER, - *TYPE_NUMERIC, - *TYPE_REGEXP; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; /************************************ * built-in additional field types * * They are not defined in SVr4 * ************************************/ -extern FIELDTYPE *TYPE_IPV4; /* Internet IP Version 4 address */ +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ /*********************** * Default objects * ***********************/ -extern FORM *_nc_Default_Form; -extern FIELD *_nc_Default_Field; +extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form; +extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field; /*********************** * FIELDTYPE routines * ***********************/ -extern FIELDTYPE - *new_fieldtype( +extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype ( bool (* const field_check)(FIELD *,const void *), bool (* const char_check)(int,const void *)), *link_fieldtype(FIELDTYPE *,FIELDTYPE *); -extern int free_fieldtype(FIELDTYPE *), - set_fieldtype_arg(FIELDTYPE *, +extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *); +extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, void * (* const make_arg)(va_list *), void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)), - set_fieldtype_choice (FIELDTYPE *, + void (* const free_arg)(void *)); +extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, bool (* const next_choice)(FIELD *,const void *), bool (* const prev_choice)(FIELD *,const void *)); /******************* * FIELD routines * *******************/ -extern FIELD *new_field(int,int,int,int,int,int), - *dup_field(FIELD *,int,int), - *link_field(FIELD *,int,int); - -extern int free_field(FIELD *), - field_info(const FIELD *,int *,int *,int *,int *,int *,int *), - dynamic_field_info(const FIELD *,int *,int *,int *), - set_max_field( FIELD *,int), - move_field(FIELD *,int,int), - set_field_type(FIELD *,FIELDTYPE *,...), - set_new_page(FIELD *,bool), - set_field_just(FIELD *,int), - field_just(const FIELD *), - set_field_fore(FIELD *,chtype), - set_field_back(FIELD *,chtype), - set_field_pad(FIELD *,int), - field_pad(const FIELD *), - set_field_buffer(FIELD *,int,const char *), - set_field_status(FIELD *,bool), - set_field_userptr(FIELD *, void *), - set_field_opts(FIELD *,Field_Options), - field_opts_on(FIELD *,Field_Options), - field_opts_off(FIELD *,Field_Options); - -extern chtype field_fore(const FIELD *), - field_back(const FIELD *); - -extern bool new_page(const FIELD *), - field_status(const FIELD *); - -extern void *field_arg(const FIELD *); - -extern void *field_userptr(const FIELD *); - -extern FIELDTYPE - *field_type(const FIELD *); - -extern char* field_buffer(const FIELD *,int); - -extern Field_Options - field_opts(const FIELD *); +extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int); +extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int); +extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int); + +extern NCURSES_EXPORT(int) free_field (FIELD *); +extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); +extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); +extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int); +extern NCURSES_EXPORT(int) move_field (FIELD *,int,int); +extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); +extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool); +extern NCURSES_EXPORT(int) set_field_just (FIELD *,int); +extern NCURSES_EXPORT(int) field_just (const FIELD *); +extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype); +extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype); +extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int); +extern NCURSES_EXPORT(int) field_pad (const FIELD *); +extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *); +extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool); +extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *); +extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options); +extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options); +extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options); + +extern NCURSES_EXPORT(chtype) field_fore (const FIELD *); +extern NCURSES_EXPORT(chtype) field_back (const FIELD *); + +extern NCURSES_EXPORT(bool) new_page (const FIELD *); +extern NCURSES_EXPORT(bool) field_status (const FIELD *); + +extern NCURSES_EXPORT(void *) field_arg (const FIELD *); + +extern NCURSES_EXPORT(void *) field_userptr (const FIELD *); + +extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *); + +extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int); + +extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); /****************** * FORM routines * ******************/ -extern FORM *new_form(FIELD **); - -extern FIELD **form_fields(const FORM *), - *current_field(const FORM *); - -extern WINDOW *form_win(const FORM *), - *form_sub(const FORM *); - -extern Form_Hook - form_init(const FORM *), - form_term(const FORM *), - field_init(const FORM *), - field_term(const FORM *); - -extern int free_form(FORM *), - set_form_fields(FORM *,FIELD **), - field_count(const FORM *), - set_form_win(FORM *,WINDOW *), - set_form_sub(FORM *,WINDOW *), - set_current_field(FORM *,FIELD *), - field_index(const FIELD *), - set_form_page(FORM *,int), - form_page(const FORM *), - scale_form(const FORM *,int *,int *), - set_form_init(FORM *,Form_Hook), - set_form_term(FORM *,Form_Hook), - set_field_init(FORM *,Form_Hook), - set_field_term(FORM *,Form_Hook), - post_form(FORM *), - unpost_form(FORM *), - pos_form_cursor(FORM *), - form_driver(FORM *,int), - set_form_userptr(FORM *,void *), - set_form_opts(FORM *,Form_Options), - form_opts_on(FORM *,Form_Options), - form_opts_off(FORM *,Form_Options), - form_request_by_name(const char *); - -extern const char - *form_request_name(int); - -extern void *form_userptr(const FORM *); - -extern Form_Options - form_opts(const FORM *); - -extern bool data_ahead(const FORM *), - data_behind(const FORM *); + +extern NCURSES_EXPORT(FORM *) new_form (FIELD **); + +extern NCURSES_EXPORT(FIELD **)form_fields (const FORM *); +extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); + +extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); +extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *); + +extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *); +extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *); +extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *); +extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *); + +extern NCURSES_EXPORT(int) free_form (FORM *); +extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **); +extern NCURSES_EXPORT(int) field_count (const FORM *); +extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *); +extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *); +extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *); +extern NCURSES_EXPORT(int) field_index (const FIELD *); +extern NCURSES_EXPORT(int) set_form_page (FORM *,int); +extern NCURSES_EXPORT(int) form_page (const FORM *); +extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *); +extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) post_form (FORM *); +extern NCURSES_EXPORT(int) unpost_form (FORM *); +extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); +extern NCURSES_EXPORT(int) form_driver (FORM *,int); +extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); +extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); +extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); +extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options); +extern NCURSES_EXPORT(int) form_request_by_name (const char *); + +extern NCURSES_EXPORT(const char *) form_request_name (int); + +extern NCURSES_EXPORT(void *) form_userptr (const FORM *); + +extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); + +extern NCURSES_EXPORT(bool) data_ahead (const FORM *); +extern NCURSES_EXPORT(bool) data_behind (const FORM *); #ifdef __cplusplus } diff --git a/contrib/ncurses/form/form.priv.h b/contrib/ncurses/form/form.priv.h index 886121c..73c5e9a 100644 --- a/contrib/ncurses/form/form.priv.h +++ b/contrib/ncurses/form/form.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -110,19 +110,19 @@ typedef struct typearg { #define C_BLANK ' ' #define is_blank(c) ((c)==C_BLANK) -extern const FIELDTYPE* _nc_Default_FieldType; - -extern TypeArgument* _nc_Make_Argument(const FIELDTYPE*,va_list*,int*); -extern TypeArgument *_nc_Copy_Argument(const FIELDTYPE*,const TypeArgument*, int*); -extern void _nc_Free_Argument(const FIELDTYPE*,TypeArgument*); -extern bool _nc_Copy_Type(FIELD*, FIELD const *); -extern void _nc_Free_Type(FIELD *); - -extern int _nc_Synchronize_Attributes(FIELD*); -extern int _nc_Synchronize_Options(FIELD*,Field_Options); -extern int _nc_Set_Form_Page(FORM*,int,FIELD*); -extern int _nc_Refresh_Current_Field(FORM*); -extern FIELD* _nc_First_Active_Field(FORM*); -extern bool _nc_Internal_Validation(FORM*); -extern int _nc_Set_Current_Field(FORM*,FIELD*); -extern int _nc_Position_Form_Cursor(FORM*); +extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType; + +extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*,va_list*,int*); +extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*,const TypeArgument*, int*); +extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*,TypeArgument*); +extern NCURSES_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); +extern NCURSES_EXPORT(void) _nc_Free_Type (FIELD *); + +extern NCURSES_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); +extern NCURSES_EXPORT(int) _nc_Synchronize_Options (FIELD*,Field_Options); +extern NCURSES_EXPORT(int) _nc_Set_Form_Page (FORM*,int,FIELD*); +extern NCURSES_EXPORT(int) _nc_Refresh_Current_Field (FORM*); +extern NCURSES_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); +extern NCURSES_EXPORT(bool) _nc_Internal_Validation (FORM*); +extern NCURSES_EXPORT(int) _nc_Set_Current_Field (FORM*,FIELD*); +extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*); diff --git a/contrib/ncurses/form/frm_cursor.c b/contrib/ncurses/form/frm_cursor.c index 96ad2d6..930908f 100644 --- a/contrib/ncurses/form/frm_cursor.c +++ b/contrib/ncurses/form/frm_cursor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_cursor.c,v 1.4 1999/05/16 17:20:19 juergen Exp $") +MODULE_ID("$Id: frm_cursor.c,v 1.5 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -47,7 +47,8 @@ MODULE_ID("$Id: frm_cursor.c,v 1.4 1999/05/16 17:20:19 juergen Exp $") | E_BAD_ARGUMENT - Invalid form pointer | E_NOT_POSTED - Form is not posted +--------------------------------------------------------------------------*/ -int pos_form_cursor(FORM * form) +NCURSES_EXPORT(int) +pos_form_cursor (FORM * form) { int res; diff --git a/contrib/ncurses/form/frm_data.c b/contrib/ncurses/form/frm_data.c index e90f5a1..8d87353 100644 --- a/contrib/ncurses/form/frm_data.c +++ b/contrib/ncurses/form/frm_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_data.c,v 1.6 1999/05/16 17:20:29 juergen Exp $") +MODULE_ID("$Id: frm_data.c,v 1.7 2000/12/10 02:09:38 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +44,8 @@ MODULE_ID("$Id: frm_data.c,v 1.6 1999/05/16 17:20:29 juergen Exp $") | Return Values : TRUE - there are off-screen data behind | FALSE - there are no off-screen data behind +--------------------------------------------------------------------------*/ -bool data_behind(const FORM *form) +NCURSES_EXPORT(bool) +data_behind (const FORM *form) { bool result = FALSE; @@ -101,7 +102,8 @@ static char * After_Last_Non_Pad_Position(char *buffer, int len, int pad) | Return Values : TRUE - there are off-screen data ahead | FALSE - there are no off-screen data ahead +--------------------------------------------------------------------------*/ -bool data_ahead(const FORM *form) +NCURSES_EXPORT(bool) +data_ahead (const FORM *form) { bool result = FALSE; diff --git a/contrib/ncurses/form/frm_def.c b/contrib/ncurses/form/frm_def.c index 34be5fe..0802e49 100644 --- a/contrib/ncurses/form/frm_def.c +++ b/contrib/ncurses/form/frm_def.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_def.c,v 1.9 1999/05/16 17:20:43 juergen Exp $") +MODULE_ID("$Id: frm_def.c,v 1.10 2000/12/10 02:09:38 tom Exp $") /* this can't be readonly */ static FORM default_form = { @@ -60,7 +60,7 @@ static FORM default_form = { NULL /* fieldterm */ }; -FORM *_nc_Default_Form = &default_form; +NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; /*--------------------------------------------------------------------------- | Facility : libnform @@ -269,7 +269,8 @@ INLINE static int Associate_Fields(FORM *form, FIELD **fields) | | Return Values : Pointer to form. NULL if error occured. +--------------------------------------------------------------------------*/ -FORM *new_form(FIELD ** fields) +NCURSES_EXPORT(FORM *) +new_form (FIELD ** fields) { int err = E_SYSTEM_ERROR; @@ -301,7 +302,8 @@ FORM *new_form(FIELD ** fields) | E_BAD_ARGUMENT - invalid form pointer | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int free_form(FORM * form) +NCURSES_EXPORT(int) +free_form (FORM * form) { if ( !form ) RETURN(E_BAD_ARGUMENT); @@ -327,7 +329,8 @@ int free_form(FORM * form) | E_BAD_ARGUMENT - invalid form pointer | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int set_form_fields(FORM * form, FIELD ** fields) +NCURSES_EXPORT(int) +set_form_fields (FORM * form, FIELD ** fields) { FIELD **old; int res; @@ -355,7 +358,8 @@ int set_form_fields(FORM * form, FIELD ** fields) | | Return Values : Pointer to field array +--------------------------------------------------------------------------*/ -FIELD **form_fields(const FORM * form) +NCURSES_EXPORT(FIELD **) +form_fields (const FORM * form) { return (Normalize_Form( form )->field); } @@ -368,7 +372,8 @@ FIELD **form_fields(const FORM * form) | | Return Values : Number of fields, -1 if none are defined +--------------------------------------------------------------------------*/ -int field_count(const FORM * form) +NCURSES_EXPORT(int) +field_count (const FORM * form) { return (Normalize_Form( form )->maxfield); } diff --git a/contrib/ncurses/form/frm_driver.c b/contrib/ncurses/form/frm_driver.c index e609e19..3a02a5d 100644 --- a/contrib/ncurses/form/frm_driver.c +++ b/contrib/ncurses/form/frm_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.35 1999/05/16 17:20:52 juergen Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.38 2001/03/25 02:07:50 juergen Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -516,7 +516,8 @@ static bool Field_Grown(FIELD * field, int amount) return FALSE; } assert(form!=(FORM *)0); - delwin(form->w); + if (form->w) + delwin(form->w); form->w = new_window; Set_Field_Window_Attributes(field,form->w); werase(form->w); @@ -558,8 +559,8 @@ static bool Field_Grown(FIELD * field, int amount) | E_SYSTEM_ERROR - form has no current field or | field-window +--------------------------------------------------------------------------*/ -int -_nc_Position_Form_Cursor(FORM * form) +NCURSES_EXPORT(int) +_nc_Position_Form_Cursor (FORM * form) { FIELD *field; WINDOW *formwin; @@ -599,8 +600,8 @@ _nc_Position_Form_Cursor(FORM * form) | E_BAD_ARGUMENT - invalid form pointer | E_SYSTEM_ERROR - general error +--------------------------------------------------------------------------*/ -int -_nc_Refresh_Current_Field(FORM * form) +NCURSES_EXPORT(int) +_nc_Refresh_Current_Field (FORM * form) { WINDOW *formwin; FIELD *field; @@ -957,7 +958,8 @@ static int Synchronize_Linked_Fields(FIELD * field) | E_BAD_ARGUMENT - invalid field pointer | E_SYSTEM_ERROR - some severe basic error +--------------------------------------------------------------------------*/ -int _nc_Synchronize_Attributes(FIELD * field) +NCURSES_EXPORT(int) +_nc_Synchronize_Attributes (FIELD * field) { FORM *form; int res = E_OK; @@ -1015,8 +1017,9 @@ int _nc_Synchronize_Attributes(FIELD * field) | E_BAD_ARGUMENT - invalid field pointer | E_SYSTEM_ERROR - some severe basic error +--------------------------------------------------------------------------*/ -int -_nc_Synchronize_Options(FIELD *field, Field_Options newopts) +NCURSES_EXPORT(int) +_nc_Synchronize_Options +(FIELD *field, Field_Options newopts) { Field_Options oldopts; Field_Options changed_opts; @@ -1113,8 +1116,9 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts) | E_BAD_ARGUMENT - invalid form or field pointer | E_SYSTEM_ERROR - some severe basic error +--------------------------------------------------------------------------*/ -int -_nc_Set_Current_Field(FORM *form, FIELD *newfield) +NCURSES_EXPORT(int) +_nc_Set_Current_Field +(FORM *form, FIELD *newfield) { FIELD *field; WINDOW *new_window; @@ -1159,6 +1163,7 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield) } } delwin(form->w); + form->w = (WINDOW *)0; } field = newfield; @@ -1173,7 +1178,11 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield) return(E_SYSTEM_ERROR); form->current = field; + + if (form->w) + delwin(form->w); form->w = new_window; + form->status &= ~_WINDOW_MODIFIED; Set_Field_Window_Attributes(field,form->w); @@ -2686,8 +2695,8 @@ static bool Check_Field(FIELDTYPE *typ, FIELD *field, TypeArgument *argp) | Return Values : TRUE - field is valid | FALSE - field is invalid +--------------------------------------------------------------------------*/ -bool -_nc_Internal_Validation(FORM *form) +NCURSES_EXPORT(bool) +_nc_Internal_Validation (FORM *form) { FIELD *field; @@ -2776,8 +2785,8 @@ INLINE static FIELD *Next_Field_On_Page(FIELD * field) | | Return Values : Pointer to calculated field. +--------------------------------------------------------------------------*/ -FIELD* -_nc_First_Active_Field(FORM * form) +NCURSES_EXPORT(FIELD*) +_nc_First_Active_Field (FORM * form) { FIELD **last_on_page = &form->field[form->page[form->curpage].pmax]; FIELD *proposed = Next_Field_On_Page(*last_on_page); @@ -3283,8 +3292,9 @@ static int FN_Down_Field(FORM * form) | Return Values : E_OK - success | != E_OK - error from subordinate call +--------------------------------------------------------------------------*/ -int -_nc_Set_Form_Page(FORM * form, int page, FIELD * field) +NCURSES_EXPORT(int) +_nc_Set_Form_Page +(FORM * form, int page, FIELD * field) { int res = E_OK; @@ -3637,7 +3647,8 @@ static const Binding_Info bindings[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] = | E_REQUEST_DENIED - request failed | E_UNKNOWN_COMMAND - command not known +--------------------------------------------------------------------------*/ -int form_driver(FORM * form, int c) +NCURSES_EXPORT(int) +form_driver (FORM * form, int c) { const Binding_Info* BI = (Binding_Info *)0; int res = E_UNKNOWN_COMMAND; @@ -3736,7 +3747,9 @@ int form_driver(FORM * form, int c) | E_BAD_ARGUMENT - invalid argument | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_buffer(FIELD * field, int buffer, const char * value) +NCURSES_EXPORT(int) +set_field_buffer +(FIELD * field, int buffer, const char * value) { char *s, *p; int res = E_OK; @@ -3778,7 +3791,7 @@ int set_field_buffer(FIELD * field, int buffer, const char * value) unsigned int i; for(i=len; i= 0) && (buffer <= field->nbuf)) return Address_Of_Nth_Buffer(field,buffer); diff --git a/contrib/ncurses/form/frm_hook.c b/contrib/ncurses/form/frm_hook.c index 5a5ec29..8296712 100644 --- a/contrib/ncurses/form/frm_hook.c +++ b/contrib/ncurses/form/frm_hook.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,11 +32,11 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_hook.c,v 1.8 1999/05/16 17:21:04 juergen Exp $") +MODULE_ID("$Id: frm_hook.c,v 1.9 2000/12/10 02:09:37 tom Exp $") /* "Template" macro to generate function to set application specific hook */ #define GEN_HOOK_SET_FUNCTION( typ, name ) \ -int set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ +NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ {\ (Normalize_Form( form ) -> typ ## name) = func ;\ RETURN(E_OK);\ @@ -44,7 +44,7 @@ int set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ /* "Template" macro to generate function to get application specific hook */ #define GEN_HOOK_GET_FUNCTION( typ, name ) \ -Form_Hook typ ## _ ## name ( const FORM *form )\ +NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ {\ return ( Normalize_Form( form ) -> typ ## name );\ } diff --git a/contrib/ncurses/form/frm_opts.c b/contrib/ncurses/form/frm_opts.c index 009c189..fe23541 100644 --- a/contrib/ncurses/form/frm_opts.c +++ b/contrib/ncurses/form/frm_opts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_opts.c,v 1.8 1999/05/16 17:38:05 juergen Exp $") +MODULE_ID("$Id: frm_opts.c,v 1.9 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +44,8 @@ MODULE_ID("$Id: frm_opts.c,v 1.8 1999/05/16 17:38:05 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int set_form_opts(FORM * form, Form_Options opts) +NCURSES_EXPORT(int) +set_form_opts (FORM * form, Form_Options opts) { opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) @@ -64,7 +65,8 @@ int set_form_opts(FORM * form, Form_Options opts) | | Return Values : The option flags. +--------------------------------------------------------------------------*/ -Form_Options form_opts(const FORM * form) +NCURSES_EXPORT(Form_Options) +form_opts (const FORM * form) { return (Normalize_Form(form)->opts & ALL_FORM_OPTS); } @@ -79,7 +81,8 @@ Form_Options form_opts(const FORM * form) | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int form_opts_on(FORM * form, Form_Options opts) +NCURSES_EXPORT(int) +form_opts_on (FORM * form, Form_Options opts) { opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) @@ -101,7 +104,8 @@ int form_opts_on(FORM * form, Form_Options opts) | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int form_opts_off(FORM * form, Form_Options opts) +NCURSES_EXPORT(int) +form_opts_off (FORM * form, Form_Options opts) { opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) diff --git a/contrib/ncurses/form/frm_page.c b/contrib/ncurses/form/frm_page.c index 5136542..84467f8 100644 --- a/contrib/ncurses/form/frm_page.c +++ b/contrib/ncurses/form/frm_page.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_page.c,v 1.5 1999/05/16 17:21:26 juergen Exp $") +MODULE_ID("$Id: frm_page.c,v 1.6 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,7 +46,8 @@ MODULE_ID("$Id: frm_page.c,v 1.5 1999/05/16 17:21:26 juergen Exp $") | E_INVALID_FIELD - current field can't be left | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_form_page(FORM * form, int page) +NCURSES_EXPORT(int) +set_form_page (FORM * form, int page) { int err = E_OK; @@ -92,7 +93,8 @@ int set_form_page(FORM * form, int page) | Return Values : >= 0 : current page number | -1 : invalid form pointer +--------------------------------------------------------------------------*/ -int form_page(const FORM * form) +NCURSES_EXPORT(int) +form_page (const FORM * form) { return Normalize_Form(form)->curpage; } diff --git a/contrib/ncurses/form/frm_post.c b/contrib/ncurses/form/frm_post.c index 3fdb57a..96df4c4 100644 --- a/contrib/ncurses/form/frm_post.c +++ b/contrib/ncurses/form/frm_post.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_post.c,v 1.4 1999/05/16 17:21:39 juergen Exp $") +MODULE_ID("$Id: frm_post.c,v 1.5 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,7 +46,8 @@ MODULE_ID("$Id: frm_post.c,v 1.4 1999/05/16 17:21:39 juergen Exp $") | E_NO_ROOM - form doesn't fit into subwindow | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int post_form(FORM * form) +NCURSES_EXPORT(int) +post_form (FORM * form) { WINDOW *formwin; int err; @@ -93,7 +94,8 @@ int post_form(FORM * form) | E_NOT_POSTED - form isn't posted | E_BAD_STATE - called from a hook routine +--------------------------------------------------------------------------*/ -int unpost_form(FORM * form) +NCURSES_EXPORT(int) +unpost_form (FORM * form) { if (!form) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/frm_req_name.c b/contrib/ncurses/form/frm_req_name.c index 6300651..e5ff914 100644 --- a/contrib/ncurses/form/frm_req_name.c +++ b/contrib/ncurses/form/frm_req_name.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_req_name.c,v 1.7 1999/05/16 17:21:53 juergen Exp $") +MODULE_ID("$Id: frm_req_name.c,v 1.8 2000/12/10 02:09:37 tom Exp $") static const char *request_names[ MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1 ] = { "NEXT_PAGE" , @@ -113,7 +113,8 @@ static const char *request_names[ MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1 ] = { | Return Values : Pointer to name - on success | NULL - on invalid request code +--------------------------------------------------------------------------*/ -const char *form_request_name( int request ) +NCURSES_EXPORT(const char *) +form_request_name ( int request ) { if ( (request < MIN_FORM_COMMAND) || (request > MAX_FORM_COMMAND) ) { @@ -134,7 +135,8 @@ const char *form_request_name( int request ) | Return Values : Request Id - on success | E_NO_MATCH - request not found +--------------------------------------------------------------------------*/ -int form_request_by_name( const char *str ) +NCURSES_EXPORT(int) +form_request_by_name ( const char *str ) { /* because the table is so small, it doesn't really hurt to run sequentially through it. diff --git a/contrib/ncurses/form/frm_scale.c b/contrib/ncurses/form/frm_scale.c index bb19717..77bd00a 100644 --- a/contrib/ncurses/form/frm_scale.c +++ b/contrib/ncurses/form/frm_scale.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_scale.c,v 1.4 1999/05/16 17:22:02 juergen Exp $") +MODULE_ID("$Id: frm_scale.c,v 1.5 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +44,8 @@ MODULE_ID("$Id: frm_scale.c,v 1.4 1999/05/16 17:22:02 juergen Exp $") | E_BAD_ARGUMENT - invalid form pointer | E_NOT_CONNECTED - no fields connected to form +--------------------------------------------------------------------------*/ -int scale_form(const FORM * form, int * rows, int * cols) +NCURSES_EXPORT(int) +scale_form (const FORM * form, int * rows, int * cols) { if ( !form ) RETURN(E_BAD_ARGUMENT); diff --git a/contrib/ncurses/form/frm_sub.c b/contrib/ncurses/form/frm_sub.c index 849f9cb..a413153 100644 --- a/contrib/ncurses/form/frm_sub.c +++ b/contrib/ncurses/form/frm_sub.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_sub.c,v 1.4 1999/05/16 17:22:11 juergen Exp $") +MODULE_ID("$Id: frm_sub.c,v 1.5 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +43,8 @@ MODULE_ID("$Id: frm_sub.c,v 1.4 1999/05/16 17:22:11 juergen Exp $") | Return Values : E_OK - success | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int set_form_sub(FORM * form, WINDOW * win) +NCURSES_EXPORT(int) +set_form_sub (FORM * form, WINDOW * win) { if (form && (form->status & _POSTED)) RETURN(E_POSTED); @@ -60,7 +61,8 @@ int set_form_sub(FORM * form, WINDOW * win) | | Return Values : The pointer to the Subwindow. +--------------------------------------------------------------------------*/ -WINDOW *form_sub(const FORM * form) +NCURSES_EXPORT(WINDOW *) +form_sub (const FORM * form) { const FORM* f = Normalize_Form( form ); return Get_Form_Window(f); diff --git a/contrib/ncurses/form/frm_user.c b/contrib/ncurses/form/frm_user.c index 853904f..3b04e53 100644 --- a/contrib/ncurses/form/frm_user.c +++ b/contrib/ncurses/form/frm_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_user.c,v 1.8 1999/05/16 17:22:21 juergen Exp $") +MODULE_ID("$Id: frm_user.c,v 1.9 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +43,8 @@ MODULE_ID("$Id: frm_user.c,v 1.8 1999/05/16 17:22:21 juergen Exp $") | | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ -int set_form_userptr(FORM * form, void *usrptr) +NCURSES_EXPORT(int) +set_form_userptr (FORM * form, void *usrptr) { Normalize_Form(form)->usrptr = usrptr; RETURN(E_OK); @@ -59,7 +60,8 @@ int set_form_userptr(FORM * form, void *usrptr) | Return Values : Value of pointer. If no such pointer has been set, | NULL is returned +--------------------------------------------------------------------------*/ -void *form_userptr(const FORM * form) +NCURSES_EXPORT(void *) +form_userptr (const FORM * form) { return Normalize_Form(form)->usrptr; } diff --git a/contrib/ncurses/form/frm_win.c b/contrib/ncurses/form/frm_win.c index b705d03..1b69fc5 100644 --- a/contrib/ncurses/form/frm_win.c +++ b/contrib/ncurses/form/frm_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_win.c,v 1.8 1999/05/16 17:22:32 juergen Exp $") +MODULE_ID("$Id: frm_win.c,v 1.9 2000/12/10 02:09:37 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +43,8 @@ MODULE_ID("$Id: frm_win.c,v 1.8 1999/05/16 17:22:32 juergen Exp $") | Return Values : E_OK - success | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int set_form_win(FORM * form, WINDOW * win) +NCURSES_EXPORT(int) +set_form_win (FORM * form, WINDOW * win) { if (form && (form->status & _POSTED)) RETURN(E_POSTED); @@ -60,7 +61,8 @@ int set_form_win(FORM * form, WINDOW * win) | | Return Values : The pointer to the Window or stdscr if there is none. +--------------------------------------------------------------------------*/ -WINDOW *form_win(const FORM * form) +NCURSES_EXPORT(WINDOW *) +form_win (const FORM * form) { const FORM* f = Normalize_Form( form ); return (f->win ? f->win : stdscr); diff --git a/contrib/ncurses/form/fty_alnum.c b/contrib/ncurses/form/fty_alnum.c index cb3909d..cbeef17 100644 --- a/contrib/ncurses/form/fty_alnum.c +++ b/contrib/ncurses/form/fty_alnum.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_alnum.c,v 1.9 1999/05/16 17:22:49 juergen Exp $") +MODULE_ID("$Id: fty_alnum.c,v 1.10 2000/12/09 23:46:12 tom Exp $") typedef struct { int width; @@ -132,6 +132,6 @@ static FIELDTYPE typeALNUM = { NULL }; -FIELDTYPE* TYPE_ALNUM = &typeALNUM; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeALNUM; /* fty_alnum.c ends here */ diff --git a/contrib/ncurses/form/fty_alpha.c b/contrib/ncurses/form/fty_alpha.c index 3dd8f2c..ddb295d 100644 --- a/contrib/ncurses/form/fty_alpha.c +++ b/contrib/ncurses/form/fty_alpha.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_alpha.c,v 1.9 1999/05/16 17:22:58 juergen Exp $") +MODULE_ID("$Id: fty_alpha.c,v 1.10 2000/12/09 23:46:12 tom Exp $") typedef struct { int width; @@ -133,6 +133,6 @@ static FIELDTYPE typeALPHA = { NULL }; -FIELDTYPE* TYPE_ALPHA = &typeALPHA; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeALPHA; /* fty_alpha.c ends here */ diff --git a/contrib/ncurses/form/fty_enum.c b/contrib/ncurses/form/fty_enum.c index 490bf26..4f52caf 100644 --- a/contrib/ncurses/form/fty_enum.c +++ b/contrib/ncurses/form/fty_enum.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_enum.c,v 1.13 2000/09/10 00:55:26 juergen Exp $") +MODULE_ID("$Id: fty_enum.c,v 1.15 2000/12/09 23:46:12 tom Exp $") typedef struct { char **kwds; @@ -47,7 +47,7 @@ static void *Make_Enum_Type(va_list * ap) argp->checkunique = cunique ? TRUE : FALSE; kp = argp->kwds; - while( (kp && *kp++) ) cnt++; + while( kp && (*kp++) ) cnt++; argp->count = cnt; } return (void *)argp; @@ -290,6 +290,6 @@ static FIELDTYPE typeENUM = { Previous_Enum }; -FIELDTYPE* TYPE_ENUM = &typeENUM; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ENUM = &typeENUM; /* fty_enum.c ends here */ diff --git a/contrib/ncurses/form/fty_int.c b/contrib/ncurses/form/fty_int.c index cb690bd..85348d7 100644 --- a/contrib/ncurses/form/fty_int.c +++ b/contrib/ncurses/form/fty_int.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_int.c,v 1.10 1999/05/16 17:23:22 juergen Exp $") +MODULE_ID("$Id: fty_int.c,v 1.11 2000/12/09 23:46:12 tom Exp $") typedef struct { int precision; @@ -155,6 +155,6 @@ static FIELDTYPE typeINTEGER = { NULL }; -FIELDTYPE* TYPE_INTEGER = &typeINTEGER; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeINTEGER; /* fty_int.c ends here */ diff --git a/contrib/ncurses/form/fty_ipv4.c b/contrib/ncurses/form/fty_ipv4.c index 064c02c..f49dcdb 100644 --- a/contrib/ncurses/form/fty_ipv4.c +++ b/contrib/ncurses/form/fty_ipv4.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_ipv4.c,v 1.2 1997/04/26 22:06:00 tom Exp $") +MODULE_ID("$Id: fty_ipv4.c,v 1.4 2000/12/09 23:46:12 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -32,13 +32,13 @@ static bool Check_IPV4_Field(FIELD * field, const void * argp GCC_UNUSED) int num = 0, len; unsigned int d1, d2, d3, d4; - if(isdigit(*bp)) /* Must start with digit */ + if(isdigit((unsigned char)*bp)) /* Must start with digit */ { num = sscanf(bp, "%u.%u.%u.%u%n", &d1, &d2, &d3, &d4, &len); if (num == 4) { bp += len; /* Make bp point to what sscanf() left */ - while (*bp && isspace(*bp)) + while (*bp && isspace((unsigned char)*bp)) bp++; /* Allow trailing whitespace */ } } @@ -76,6 +76,6 @@ static FIELDTYPE typeIPV4 = { NULL }; -FIELDTYPE* TYPE_IPV4 = &typeIPV4; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; /* fty_ipv4.c ends here */ diff --git a/contrib/ncurses/form/fty_num.c b/contrib/ncurses/form/fty_num.c index ca0fbe0..39659d1 100644 --- a/contrib/ncurses/form/fty_num.c +++ b/contrib/ncurses/form/fty_num.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_num.c,v 1.13 1999/05/16 17:23:30 juergen Exp $") +MODULE_ID("$Id: fty_num.c,v 1.14 2000/12/09 23:46:12 tom Exp $") #if HAVE_LOCALE_H #include @@ -190,6 +190,6 @@ static FIELDTYPE typeNUMERIC = { NULL }; -FIELDTYPE* TYPE_NUMERIC = &typeNUMERIC; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeNUMERIC; /* fty_num.c ends here */ diff --git a/contrib/ncurses/form/fty_regex.c b/contrib/ncurses/form/fty_regex.c index 7a92812..b575487 100644 --- a/contrib/ncurses/form/fty_regex.c +++ b/contrib/ncurses/form/fty_regex.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_regex.c,v 1.14 1999/05/16 17:23:38 juergen Exp $") +MODULE_ID("$Id: fty_regex.c,v 1.15 2000/12/09 23:46:12 tom Exp $") #if HAVE_REGEX_H_FUNCS /* We prefer POSIX regex */ #include @@ -252,6 +252,6 @@ static FIELDTYPE typeREGEXP = { NULL }; -FIELDTYPE* TYPE_REGEXP = &typeREGEXP; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; /* fty_regex.c ends here */ -- cgit v1.1