summaryrefslogtreecommitdiff
path: root/form
diff options
context:
space:
mode:
Diffstat (limited to 'form')
-rw-r--r--form/Makefile.in52
-rw-r--r--form/READ.ME8
-rw-r--r--form/f_trace.c12
-rw-r--r--form/fld_arg.c8
-rw-r--r--form/fld_attr.c16
-rw-r--r--form/fld_current.c10
-rw-r--r--form/fld_def.c26
-rw-r--r--form/fld_dup.c15
-rw-r--r--form/fld_ftchoice.c8
-rw-r--r--form/fld_ftlink.c12
-rw-r--r--form/fld_info.c20
-rw-r--r--form/fld_just.c22
-rw-r--r--form/fld_link.c18
-rw-r--r--form/fld_max.c10
-rw-r--r--form/fld_move.c16
-rw-r--r--form/fld_newftyp.c8
-rw-r--r--form/fld_opts.c34
-rw-r--r--form/fld_pad.c18
-rw-r--r--form/fld_page.c22
-rw-r--r--form/fld_stat.c20
-rw-r--r--form/fld_type.c18
-rw-r--r--form/fld_user.c20
-rw-r--r--form/form.h207
-rw-r--r--form/form.priv.h88
-rw-r--r--form/frm_cursor.c10
-rw-r--r--form/frm_data.c29
-rw-r--r--form/frm_def.c88
-rw-r--r--form/frm_driver.c125
-rw-r--r--form/frm_hook.c6
-rw-r--r--form/frm_opts.c44
-rw-r--r--form/frm_page.c16
-rw-r--r--form/frm_post.c6
-rw-r--r--form/frm_req_name.c19
-rw-r--r--form/frm_scale.c10
-rw-r--r--form/frm_sub.c18
-rw-r--r--form/frm_user.c20
-rw-r--r--form/frm_win.c18
-rw-r--r--form/fty_alnum.c12
-rw-r--r--form/fty_alpha.c12
-rw-r--r--form/fty_enum.c55
-rw-r--r--form/fty_generic.c23
-rw-r--r--form/fty_int.c57
-rw-r--r--form/fty_ipv4.c22
-rw-r--r--form/fty_num.c33
-rw-r--r--form/fty_regex.c45
-rw-r--r--form/llib-lform192
-rw-r--r--form/llib-lformt192
-rw-r--r--form/llib-lformtw198
-rw-r--r--form/llib-lformw198
49 files changed, 1108 insertions, 1028 deletions
diff --git a/form/Makefile.in b/form/Makefile.in
index 3e5be8d..a950a3e 100644
--- a/form/Makefile.in
+++ b/form/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.65 2020/02/02 23:34:34 tom Exp $
+# $Id: Makefile.in,v 1.72 2021/07/03 15:45:33 tom Exp $
##############################################################################
-# Copyright 2020 Thomas E. Dickey #
+# Copyright 2020,2021 Thomas E. Dickey #
# Copyright 1998-2015,2018 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -90,16 +90,18 @@ ETAGS = @ETAGS@
CC = @CC@
CPP = @CPP@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
-CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@
+INCDIR = $(top_srcdir)/include
+BASE_DIR = $(top_srcdir)/ncurses
+CPPFLAGS = -I$(BASE_DIR) -DHAVE_CONFIG_H -DBUILDING_FORM @CPPFLAGS@
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
CFLAGS_LIBTOOL = $(CCFLAGS)
-CFLAGS_NORMAL = $(CCFLAGS)
-CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
-CFLAGS_PROFILE = $(CCFLAGS) -pg
+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC
+CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
+CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg
CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
@@ -132,6 +134,19 @@ AUTO_SRC = \
../include/form.h
################################################################################
+
+@MAKE_PHONY@.PHONY : all
+@MAKE_PHONY@.PHONY : clean
+@MAKE_PHONY@.PHONY : distclean
+@MAKE_PHONY@.PHONY : install
+@MAKE_PHONY@.PHONY : install.libs
+@MAKE_PHONY@.PHONY : libs
+@MAKE_PHONY@.PHONY : mostlyclean
+@MAKE_PHONY@.PHONY : realclean
+@MAKE_PHONY@.PHONY : sources
+@MAKE_PHONY@.PHONY : uninstall
+@MAKE_PHONY@.PHONY : uninstall.libs
+
all \
libs \
install :: $(AUTO_SRC) $(LIBRARIES)
@@ -149,11 +164,24 @@ $(DESTDIR)$(libdir) :
cp $(srcdir)/form.h $@
HEADER_DEPS = \
- $(srcdir)/form.priv.h \
- $(srcdir)/form.h \
- ../include/mf_common.h \
../include/curses.h \
- ../include/eti.h
+ ../include/eti.h \
+ ../include/mf_common.h \
+ ../include/ncurses_cfg.h \
+ ../include/ncurses_def.h \
+ ../include/ncurses_dll.h \
+ ../include/term.h \
+ ../include/unctrl.h \
+ $(BASE_DIR)/curses.priv.h \
+ $(BASE_DIR)/new_pair.h \
+ $(INCDIR)/nc_alloc.h \
+ $(INCDIR)/nc_panel.h \
+ $(INCDIR)/nc_string.h \
+ $(INCDIR)/nc_termios.h \
+ $(INCDIR)/nc_tparm.h \
+ $(INCDIR)/term_entry.h \
+ $(srcdir)/form.h \
+ $(srcdir)/form.priv.h
tags:
$(CTAGS) *.[ch]
@@ -175,7 +203,7 @@ realclean :: distclean
../include/mf_common.h \
../include/eti.h :
- cd ../menu && $(MAKE) $@
+ ( cd ../menu && $(MAKE) $@ )
###############################################################################
# The remainder of this file is automatically generated during configuration
diff --git a/form/READ.ME b/form/READ.ME
index 0cefd57..7c6ad97 100644
--- a/form/READ.ME
+++ b/form/READ.ME
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Copyright 2020 Thomas E. Dickey --
+-- Copyright 2020,2021 Thomas E. Dickey --
-- Copyright 1998-2003,2006 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
@@ -26,18 +26,18 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: READ.ME,v 0.8 2020/02/02 23:34:34 tom Exp $
+-- $Id: READ.ME,v 0.9 2021/06/17 21:20:30 tom Exp $
-------------------------------------------------------------------------------
This is a clone of the form library that is available with typical
System V curses implementations (ETI).
It is modelled after the documentation that comes for this library with
-a 386 based SVR4 implementation (ESIX).
+a 386 based SVR4 implementation (ESIX).
The development environment was and is an ELF based Linux system.
-For things that still need doing, see the TO-DO file in the top-level
+For things that still need doing, see the TO-DO file in the top-level
directory.
Juergen Pfeifer
diff --git a/form/f_trace.c b/form/f_trace.c
index d24708c..c8df81a 100644
--- a/form/f_trace.c
+++ b/form/f_trace.c
@@ -33,37 +33,37 @@
#include "form.priv.h"
-MODULE_ID("$Id: f_trace.c,v 1.5 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: f_trace.c,v 1.6 2020/05/24 01:40:20 anonymous.maarten Exp $")
-NCURSES_EXPORT(FIELD **)
+FORM_EXPORT(FIELD **)
_nc_retrace_field_ptr(FIELD **code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(FIELD *)
+FORM_EXPORT(FIELD *)
_nc_retrace_field(FIELD *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_retrace_field_type(FIELDTYPE *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(FORM *)
+FORM_EXPORT(FORM *)
_nc_retrace_form(FORM *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(Form_Hook)
+FORM_EXPORT(Form_Hook)
_nc_retrace_form_hook(Form_Hook code)
{
TR_FUNC_BFR(1);
diff --git a/form/fld_arg.c b/form/fld_arg.c
index e7555f6..2f6c477 100644
--- a/form/fld_arg.c
+++ b/form/fld_arg.c
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_arg.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_arg.c,v 1.18 2020/12/11 22:05:24 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@@ -61,7 +61,7 @@ MODULE_ID("$Id: fld_arg.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid argument
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_fieldtype_arg(FIELDTYPE *typ,
void *(*const make_arg)(va_list *),
void *(*const copy_arg)(const void *),
@@ -90,11 +90,11 @@ set_fieldtype_arg(FIELDTYPE *typ,
| Facility : libnform
| Function : void *field_arg(const FIELD *field)
|
-| Description : Retrieve pointer to the fields argument structure.
+| Description : Retrieve pointer to the field's argument structure.
|
| Return Values : Pointer to structure or NULL if none is defined.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void *)
+FORM_EXPORT(void *)
field_arg(const FIELD *field)
{
T((T_CALLED("field_arg(%p)"), (const void *)field));
diff --git a/form/fld_attr.c b/form/fld_attr.c
index 50e2c73..4ce6b1c 100644
--- a/form/fld_attr.c
+++ b/form/fld_attr.c
@@ -33,14 +33,14 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_attr.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_attr.c,v 1.15 2020/12/11 22:05:24 tom Exp $")
/*----------------------------------------------------------------------------
Field-Attribute manipulation routines
--------------------------------------------------------------------------*/
-/* "Template" macro to generate a function to set a fields attribute */
+/* "Template" macro to generate a function to set a field's attribute */
#define GEN_FIELD_ATTR_SET_FCT( name ) \
-NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\
+FORM_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\
{\
int res = E_BAD_ARGUMENT;\
T((T_CALLED("set_field_" #name "(%p,%s)"), (void *)field, _traceattr(attr)));\
@@ -63,9 +63,9 @@ NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\
RETURN(res);\
}
-/* "Template" macro to generate a function to get a fields attribute */
+/* "Template" macro to generate a function to get a field's attribute */
#define GEN_FIELD_ATTR_GET_FCT( name ) \
-NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\
+FORM_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\
{\
T((T_CALLED("field_" #name "(%p)"), (const void *) field));\
returnAttr( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\
@@ -88,7 +88,7 @@ GEN_FIELD_ATTR_SET_FCT(fore)
| Facility : libnform
| Function : chtype field_fore(const FIELD *)
|
-| Description : Retrieve fields foreground attribute
+| Description : Retrieve field's foreground attribute
|
| Return Values : The foreground attribute
+--------------------------------------------------------------------------*/
@@ -99,7 +99,7 @@ GEN_FIELD_ATTR_GET_FCT(fore)
| Function : int set_field_back(FIELD *field, chtype attr)
|
| Description : Sets the background of the field used to display the
-| fields extend.
+| field's extend.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid attributes
@@ -111,7 +111,7 @@ GEN_FIELD_ATTR_SET_FCT(back)
| Facility : libnform
| Function : chtype field_back(const
|
-| Description : Retrieve fields background attribute
+| Description : Retrieve field's background attribute
|
| Return Values : The background attribute
+--------------------------------------------------------------------------*/
diff --git a/form/fld_current.c b/form/fld_current.c
index 75e68ed..264007e 100644
--- a/form/fld_current.c
+++ b/form/fld_current.c
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_current.c,v 1.15 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_current.c,v 1.16 2020/05/24 01:40:20 anonymous.maarten Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_current.c,v 1.15 2020/02/02 23:34:34 tom Exp $")
| E_INVALID_FIELD - current field can't be left
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_current_field(FORM *form, FIELD *field)
{
int err = E_OK;
@@ -113,7 +113,7 @@ set_current_field(FORM *form, FIELD *field)
| E_BAD_ARGUMENT - invalid form pointer
| E_REQUEST_DENIED - there is no current field to unfocus
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
unfocus_current_field(FORM *const form)
{
T((T_CALLED("unfocus_current_field(%p)"), (const void *)form));
@@ -137,7 +137,7 @@ unfocus_current_field(FORM *const form)
|
| Return Values : Pointer to the current field.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELD *)
+FORM_EXPORT(FIELD *)
current_field(const FORM *form)
{
T((T_CALLED("current_field(%p)"), (const void *)form));
@@ -154,7 +154,7 @@ current_field(const FORM *form)
| Return Values : >= 0 : field index
| -1 : fieldpointer invalid or field not connected
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
field_index(const FIELD *field)
{
T((T_CALLED("field_index(%p)"), (const void *)field));
diff --git a/form/fld_def.c b/form/fld_def.c
index e529b3c..51bdc64 100644
--- a/form/fld_def.c
+++ b/form/fld_def.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_def.c,v 1.42 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.44 2021/03/27 23:49:53 tom Exp $")
/* this can't be readonly */
static FIELD default_field =
@@ -66,7 +66,7 @@ static FIELD default_field =
NCURSES_FIELD_EXTENSION
};
-NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field;
+FORM_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field;
/*---------------------------------------------------------------------------
| Facility : libnform
@@ -82,18 +82,17 @@ NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field;
| Return Values : Pointer to argument structure. Maybe NULL.
| In case of an error in *err an error counter is increased.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(TypeArgument *)
+FORM_EXPORT(TypeArgument *)
_nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err)
{
TypeArgument *res = (TypeArgument *)0;
- TypeArgument *p;
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
{
assert(err != 0 && ap != (va_list *)0);
if ((typ->status & _LINKED_TYPE) != 0)
{
- p = typeMalloc(TypeArgument, 1);
+ TypeArgument *p = typeMalloc(TypeArgument, 1);
if (p != 0)
{
@@ -130,18 +129,17 @@ _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 error counter is increased.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(TypeArgument *)
+FORM_EXPORT(TypeArgument *)
_nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
{
TypeArgument *res = (TypeArgument *)0;
- TypeArgument *p;
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
{
assert(err != 0 && argp != 0);
if ((typ->status & _LINKED_TYPE) != 0)
{
- p = typeMalloc(TypeArgument, 1);
+ TypeArgument *p = typeMalloc(TypeArgument, 1);
if (p != 0)
{
@@ -179,7 +177,7 @@ _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
+FORM_EXPORT(void)
_nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp)
{
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
@@ -212,7 +210,7 @@ _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp)
| Return Values : TRUE - copy worked
| FALSE - error occurred
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
_nc_Copy_Type(FIELD *dst, FIELD const *src)
{
int err = 0;
@@ -247,7 +245,7 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
+FORM_EXPORT(void)
_nc_Free_Type(FIELD *field)
{
assert(field != 0);
@@ -274,7 +272,7 @@ _nc_Free_Type(FIELD *field)
|
| Return Values : Pointer to the new field or NULL if failure.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELD *)
+FORM_EXPORT(FIELD *)
new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
{
static const FIELD_CELL blank = BLANK;
@@ -354,7 +352,7 @@ 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
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
free_field(FIELD *field)
{
T((T_CALLED("free_field(%p)"), (void *)field));
diff --git a/form/fld_dup.c b/form/fld_dup.c
index 9859a09..e195df9 100644
--- a/form/fld_dup.c
+++ b/form/fld_dup.c
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_dup.c,v 1.15 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_dup.c,v 1.18 2020/05/24 01:40:20 anonymous.maarten Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_dup.c,v 1.15 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : Pointer to the new field or NULL if failure
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELD *)
+FORM_EXPORT(FIELD *)
dup_field(FIELD *field, int frow, int fcol)
{
FIELD *New_Field = (FIELD *)0;
@@ -61,8 +61,8 @@ dup_field(FIELD *field, int frow, int fcol)
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = *_nc_Default_Field;
- New_Field->frow = (short) frow;
- New_Field->fcol = (short) fcol;
+ New_Field->frow = (short)frow;
+ New_Field->fcol = (short)fcol;
New_Field->link = New_Field;
New_Field->rows = field->rows;
New_Field->cols = field->cols;
@@ -80,13 +80,12 @@ dup_field(FIELD *field, int frow, int fcol)
if (_nc_Copy_Type(New_Field, field))
{
- size_t i, len;
+ size_t len;
len = Total_Buffer_Size(New_Field);
- if ((New_Field->buf = (FIELD_CELL *)malloc(len)))
+ if ((New_Field->buf = (FIELD_CELL *)malloc(len * 20)))
{
- for (i = 0; i < len; ++i)
- New_Field->buf[i] = field->buf[i];
+ memcpy(New_Field->buf, field->buf, len);
returnField(New_Field);
}
}
diff --git a/form/fld_ftchoice.c b/form/fld_ftchoice.c
index 5dc5f4a..dfaca14 100644
--- a/form/fld_ftchoice.c
+++ b/form/fld_ftchoice.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,10 +33,10 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_ftchoice.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_ftchoice.c,v 1.18 2021/06/17 21:26:02 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_fieldtype_choice(
| FIELDTYPE *typ,
| bool (* const next_choice)(FIELD *,const void *),
@@ -47,7 +47,7 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid arguments
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_fieldtype_choice(FIELDTYPE *typ,
bool (*const next_choice) (FIELD *, const void *),
bool (*const prev_choice) (FIELD *, const void *))
diff --git a/form/fld_ftlink.c b/form/fld_ftlink.c
index afa488b..ed16920 100644
--- a/form/fld_ftlink.c
+++ b/form/fld_ftlink.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,23 +33,23 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_ftlink.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_ftlink.c,v 1.18 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FIELDTYPE *link_fieldtype(
| FIELDTYPE *type1,
| FIELDTYPE *type2)
-|
+|
| Description : Create a new fieldtype built from the two given types.
| They are connected by an logical 'OR'.
-| If an error occurs, errno is set to
+| If an error occurs, errno is set to
| E_BAD_ARGUMENT - invalid arguments
| E_SYSTEM_ERROR - system error (no memory)
|
| Return Values : Fieldtype pointer or NULL if error occurred.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2)
{
FIELDTYPE *nftyp = (FIELDTYPE *)0;
diff --git a/form/fld_info.c b/form/fld_info.c
index 9963b5b..bc8399d 100644
--- a/form/fld_info.c
+++ b/form/fld_info.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,21 +33,21 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_info.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_info.c,v 1.16 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int field_info(const FIELD *field,
| int *rows, int *cols,
| int *frow, int *fcol,
| int *nrow, int *nbuf)
-|
-| Description : Retrieve infos about the fields creation parameters.
+|
+| Description : Retrieve information about the field's creation parameters.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid field pointer
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
field_info(const FIELD *field,
int *rows, int *cols,
int *frow, int *fcol,
@@ -78,18 +78,18 @@ field_info(const FIELD *field,
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int dynamic_field_info(const FIELD *field,
| int *drows, int *dcols,
| int *maxgrow)
-|
-| Description : Retrieve informations about a dynamic fields current
+|
+| Description : Retrieve information about a dynamic field's current
| dynamic parameters.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid argument
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
dynamic_field_info(const FIELD *field, int *drows, int *dcols, int *maxgrow)
{
T((T_CALLED("dynamic_field_info(%p,%p,%p,%p)"),
diff --git a/form/fld_just.c b/form/fld_just.c
index 8097019..62253bc 100644
--- a/form/fld_just.c
+++ b/form/fld_just.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,19 +33,19 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_just.c,v 1.14 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_just.c,v 1.17 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_field_just(FIELD *field, int just)
-|
-| Description : Set the fields type of justification.
+|
+| Description : Set the field's type of justification.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - one of the arguments was incorrect
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_field_just(FIELD *field, int just)
{
int res = E_BAD_ARGUMENT;
@@ -60,7 +60,7 @@ set_field_just(FIELD *field, int just)
Normalize_Field(field);
if (field->just != just)
{
- field->just = (short) just;
+ field->just = (short)just;
res = _nc_Synchronize_Attributes(field);
}
else
@@ -70,14 +70,14 @@ set_field_just(FIELD *field, int just)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int field_just( const FIELD *field )
-|
-| Description : Retrieve the fields type of justification
+|
+| Description : Retrieve the field's type of justification
|
| Return Values : The justification type.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
field_just(const FIELD *field)
{
T((T_CALLED("field_just(%p)"), (const void *)field));
diff --git a/form/fld_link.c b/form/fld_link.c
index cb67ac0..c060458 100644
--- a/form/fld_link.c
+++ b/form/fld_link.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,23 +33,23 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_link.c,v 1.14 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_link.c,v 1.17 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
-| Function : FIELD *link_field(FIELD *field, int frow, int fcol)
-|
+| Facility : libnform
+| Function : FIELD *link_field(FIELD *field, int frow, int fcol)
+|
| Description : Duplicates the field at the specified position. The
| new field shares its buffers with the original one,
| the attributes are independent.
| If an error occurs, errno is set to
-|
+|
| E_BAD_ARGUMENT - invalid argument
| E_SYSTEM_ERROR - system error
|
| Return Values : Pointer to the new field or NULL if failure
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELD *)
+FORM_EXPORT(FIELD *)
link_field(FIELD *field, int frow, int fcol)
{
FIELD *New_Field = (FIELD *)0;
@@ -62,8 +62,8 @@ link_field(FIELD *field, int frow, int fcol)
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = *_nc_Default_Field;
- New_Field->frow = (short) frow;
- New_Field->fcol = (short) fcol;
+ New_Field->frow = (short)frow;
+ New_Field->fcol = (short)fcol;
New_Field->link = field->link;
field->link = New_Field;
diff --git a/form/fld_max.c b/form/fld_max.c
index 7d0e146..325541a 100644
--- a/form/fld_max.c
+++ b/form/fld_max.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,19 +33,19 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_max.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_max.c,v 1.18 2021/06/17 21:26:02 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_max_field(FIELD *field, int maxgrow)
-|
+|
| Description : Set the maximum growth for a dynamic field. If maxgrow=0
| the field may grow to any possible size.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid argument
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_max_field(FIELD *field, int maxgrow)
{
T((T_CALLED("set_max_field(%p,%d)"), (void *)field, maxgrow));
diff --git a/form/fld_move.c b/form/fld_move.c
index 0d6692f..0d9ac4a 100644
--- a/form/fld_move.c
+++ b/form/fld_move.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,20 +33,20 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_move.c,v 1.16 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int move_field(FIELD *field,int frow, int fcol)
-|
+|
| Description : Moves the disconnected field to the new location in
-| the forms subwindow.
+| the form's subwindow.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid argument passed
| E_CONNECTED - field is connected
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
move_field(FIELD *field, int frow, int fcol)
{
T((T_CALLED("move_field(%p,%d,%d)"), (void *)field, frow, fcol));
@@ -57,8 +57,8 @@ move_field(FIELD *field, int frow, int fcol)
if (field->form)
RETURN(E_CONNECTED);
- field->frow = (short) frow;
- field->fcol = (short) fcol;
+ field->frow = (short)frow;
+ field->fcol = (short)fcol;
RETURN(E_OK);
}
diff --git a/form/fld_newftyp.c b/form/fld_newftyp.c
index 18a7c07..c5848d5 100644
--- a/form/fld_newftyp.c
+++ b/form/fld_newftyp.c
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_newftyp.c,v 1.22 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_newftyp.c,v 1.23 2020/05/24 01:40:20 anonymous.maarten Exp $")
static FIELDTYPE default_fieldtype =
{
@@ -53,7 +53,7 @@ static FIELDTYPE default_fieldtype =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE *)
+FORM_EXPORT_VAR(FIELDTYPE *)
_nc_Default_FieldType = &default_fieldtype;
/*---------------------------------------------------------------------------
@@ -71,7 +71,7 @@ NCURSES_EXPORT_VAR(FIELDTYPE *)
|
| Return Values : Fieldtype pointer or NULL if error occurred
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
new_fieldtype(bool (*const field_check) (FIELD *, const void *),
bool (*const char_check) (int, const void *))
{
@@ -121,7 +121,7 @@ new_fieldtype(bool (*const field_check) (FIELD *, const void *),
| E_CONNECTED - there are fields referencing the type
| E_BAD_ARGUMENT - invalid fieldtype pointer
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
free_fieldtype(FIELDTYPE *typ)
{
T((T_CALLED("free_fieldtype(%p)"), (void *)typ));
diff --git a/form/fld_opts.c b/form/fld_opts.c
index fee5804..ab4d559 100644
--- a/form/fld_opts.c
+++ b/form/fld_opts.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,16 +33,16 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_opts.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_opts.c,v 1.16 2021/06/17 21:20:30 tom Exp $")
/*----------------------------------------------------------------------------
Field-Options manipulation routines
--------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_field_opts(FIELD *field, Field_Options opts)
-|
+|
| Description : Turns on the named options for this field and turns
| off all the remaining options.
|
@@ -51,7 +51,7 @@ MODULE_ID("$Id: fld_opts.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - invalid options
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_field_opts(FIELD *field, Field_Options opts)
{
int res = E_BAD_ARGUMENT;
@@ -65,14 +65,14 @@ set_field_opts(FIELD *field, Field_Options opts)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : Field_Options field_opts(const FIELD *field)
-|
-| Description : Retrieve the fields options.
+|
+| Description : Retrieve the field's options.
|
| Return Values : The options.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(Field_Options)
+FORM_EXPORT(Field_Options)
field_opts(const FIELD *field)
{
T((T_CALLED("field_opts(%p)"), (const void *)field));
@@ -81,10 +81,10 @@ field_opts(const FIELD *field)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int field_opts_on(FIELD *field, Field_Options opts)
-|
-| Description : Turns on the named options for this field and all the
+|
+| Description : Turns on the named options for this field and all the
| remaining options are unchanged.
|
| Return Values : E_OK - success
@@ -92,7 +92,7 @@ field_opts(const FIELD *field)
| E_BAD_ARGUMENT - invalid options
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
field_opts_on(FIELD *field, Field_Options opts)
{
int res = E_BAD_ARGUMENT;
@@ -109,10 +109,10 @@ field_opts_on(FIELD *field, Field_Options opts)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int field_opts_off(FIELD *field, Field_Options opts)
-|
-| Description : Turns off the named options for this field and all the
+|
+| Description : Turns off the named options for this field and all the
| remaining options are unchanged.
|
| Return Values : E_OK - success
@@ -120,7 +120,7 @@ field_opts_on(FIELD *field, Field_Options opts)
| E_BAD_ARGUMENT - invalid options
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
field_opts_off(FIELD *field, Field_Options opts)
{
int res = E_BAD_ARGUMENT;
diff --git a/form/fld_pad.c b/form/fld_pad.c
index b6d59e2..fdd803f 100644
--- a/form/fld_pad.c
+++ b/form/fld_pad.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,12 +33,12 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_pad.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_pad.c,v 1.14 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_field_pad(FIELD *field, int ch)
-|
+|
| Description : Set the pad character used to fill the field. This must
| be a printable character.
|
@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_pad.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - invalid field pointer or pad character
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_field_pad(FIELD *field, int ch)
{
int res = E_BAD_ARGUMENT;
@@ -68,14 +68,14 @@ set_field_pad(FIELD *field, int ch)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int field_pad(const FIELD *field)
-|
-| Description : Retrieve the fields pad character.
+|
+| Description : Retrieve the field's pad character.
|
| Return Values : The pad character.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
field_pad(const FIELD *field)
{
T((T_CALLED("field_pad(%p)"), (const void *)field));
diff --git a/form/fld_page.c b/form/fld_page.c
index c6fb37c..6972d31 100644
--- a/form/fld_page.c
+++ b/form/fld_page.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,19 +33,19 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_page.c,v 1.16 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_new_page(FIELD *field, bool new_page_flag)
-|
-| Description : Marks the field as the beginning of a new page of
+|
+| Description : Marks the field as the beginning of a new page of
| the form.
|
| Return Values : E_OK - success
| E_CONNECTED - field is connected
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_new_page(FIELD *field, bool new_page_flag)
{
T((T_CALLED("set_new_page(%p,%d)"), (void *)field, new_page_flag));
@@ -63,16 +63,16 @@ set_new_page(FIELD *field, bool new_page_flag)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : bool new_page(const FIELD *field)
-|
-| Description : Retrieve the info whether or not the field starts a
-| new page on the form.
+|
+| Description : Retrieve the information whether or not the field starts
+| a new page on the form.
|
| Return Values : TRUE - field starts a new page
| FALSE - field doesn't start a new page
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
new_page(const FIELD *field)
{
T((T_CALLED("new_page(%p)"), (const void *)field));
diff --git a/form/fld_stat.c b/form/fld_stat.c
index 487a21d..62d782e 100644
--- a/form/fld_stat.c
+++ b/form/fld_stat.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,18 +33,18 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_stat.c,v 1.15 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_stat.c,v 1.18 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_field_status(FIELD *field, bool status)
-|
+|
| Description : Set or clear the 'changed' indication flag for that
-| fields primary buffer.
+| field's primary buffer.
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_field_status(FIELD *field, bool status)
{
T((T_CALLED("set_field_status(%p,%d)"), (void *)field, status));
@@ -60,16 +60,16 @@ set_field_status(FIELD *field, bool status)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : bool field_status(const FIELD *field)
-|
+|
| Description : Retrieve the value of the 'changed' indication flag
-| for that fields primary buffer.
+| for that field's primary buffer.
|
| Return Values : TRUE - buffer has been changed
| FALSE - buffer has not been changed
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
field_status(const FIELD *field)
{
T((T_CALLED("field_status(%p)"), (const void *)field));
diff --git a/form/fld_type.c b/form/fld_type.c
index a445fa4..c557e05 100644
--- a/form/fld_type.c
+++ b/form/fld_type.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,12 +33,12 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_type.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_type.c,v 1.20 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_field_type(FIELD *field, FIELDTYPE *type,...)
-|
+|
| Description : Associate the specified fieldtype with the field.
| Certain field types take additional arguments. Look
| at the spec of the field types !
@@ -46,8 +46,8 @@ MODULE_ID("$Id: fld_type.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_field_type(FIELD *field, FIELDTYPE *type,...)
+FORM_EXPORT(int)
+set_field_type(FIELD *field, FIELDTYPE *type, ...)
{
va_list ap;
int res = E_SYSTEM_ERROR;
@@ -81,14 +81,14 @@ set_field_type(FIELD *field, FIELDTYPE *type,...)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FIELDTYPE *field_type(const FIELD *field)
-|
+|
| Description : Retrieve the associated fieldtype for this field.
|
| Return Values : Pointer to fieldtype of NULL if none is defined.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
field_type(const FIELD *field)
{
T((T_CALLED("field_type(%p)"), (const void *)field));
diff --git a/form/fld_user.c b/form/fld_user.c
index 5cd165c..1b13e62 100644
--- a/form/fld_user.c
+++ b/form/fld_user.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,18 +33,18 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_user.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fld_user.c,v 1.20 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_field_userptr(FIELD *field, void *usrptr)
-|
+|
| Description : Set the pointer that is reserved in any field to store
-| application relevant informations
+| application relevant information.
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_field_userptr(FIELD *field, void *usrptr)
{
T((T_CALLED("set_field_userptr(%p,%p)"), (void *)field, (void *)usrptr));
@@ -54,16 +54,16 @@ set_field_userptr(FIELD *field, void *usrptr)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : void *field_userptr(const FIELD *field)
-|
+|
| Description : Return the pointer that is reserved in any field to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void *)
+FORM_EXPORT(void *)
field_userptr(const FIELD *field)
{
T((T_CALLED("field_userptr(%p)"), (const void *)field));
diff --git a/form/form.h b/form/form.h
index dabe676..3b62e39 100644
--- a/form/form.h
+++ b/form/form.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2019-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: form.h,v 0.30 2020/02/02 23:34:34 tom Exp $ */
+/* $Id: form.h,v 0.32 2021/06/17 21:26:02 tom Exp $ */
#ifndef FORM_H
#define FORM_H
@@ -44,6 +44,17 @@
extern "C" {
#endif
+#if defined(BUILDING_FORM)
+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define FORM_WRAPPED_VAR(type,name) extern FORM_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define FORM_EXPORT(type) FORM_IMPEXP type NCURSES_API
+#define FORM_EXPORT_VAR(type) FORM_IMPEXP type
+
#ifndef FORM_PRIV_H
typedef void *FIELD_CELL;
#endif
@@ -105,7 +116,7 @@ typedef struct fieldnode
/*
* The wide-character configuration requires extra information. Because
* there are existing applications that manipulate the members of FIELD
- * directly, we cannot make the struct opaque, except by changing the ABI.
+ * directly, we cannot make the struct opaque, except by changing the ABI.
* Offsets of members up to this point are the same in the narrow- and
* wide-character configuration. But note that the type of buf depends on
* the configuration, and is made opaque for that reason.
@@ -309,136 +320,136 @@ typedef void (*Form_Hook)(FORM *);
/*************************
* standard field types *
*************************/
-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;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
/************************************
* built-in additional field types *
* They are not defined in SVr4 *
************************************/
-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
/***********************
* FIELDTYPE routines *
***********************/
-extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype (
+extern FORM_EXPORT(FIELDTYPE *) new_fieldtype (
bool (* const field_check)(FIELD *,const void *),
bool (* const char_check)(int,const void *));
-extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype(
+extern FORM_EXPORT(FIELDTYPE *) link_fieldtype(
FIELDTYPE *, FIELDTYPE *);
-extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *);
-extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *,
+extern FORM_EXPORT(int) free_fieldtype (FIELDTYPE *);
+extern FORM_EXPORT(int) set_fieldtype_arg (FIELDTYPE *,
void * (* const make_arg)(va_list *),
void * (* const copy_arg)(const void *),
void (* const free_arg)(void *));
-extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *,
+extern FORM_EXPORT(int) set_fieldtype_choice (FIELDTYPE *,
bool (* const next_choice)(FIELD *,const void *),
bool (* const prev_choice)(FIELD *,const void *));
/*******************
* FIELD routines *
*******************/
-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 *);
+extern FORM_EXPORT(FIELD *) new_field (int,int,int,int,int,int);
+extern FORM_EXPORT(FIELD *) dup_field (FIELD *,int,int);
+extern FORM_EXPORT(FIELD *) link_field (FIELD *,int,int);
+
+extern FORM_EXPORT(int) free_field (FIELD *);
+extern FORM_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *);
+extern FORM_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *);
+extern FORM_EXPORT(int) set_max_field ( FIELD *,int);
+extern FORM_EXPORT(int) move_field (FIELD *,int,int);
+extern FORM_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...);
+extern FORM_EXPORT(int) set_new_page (FIELD *,bool);
+extern FORM_EXPORT(int) set_field_just (FIELD *,int);
+extern FORM_EXPORT(int) field_just (const FIELD *);
+extern FORM_EXPORT(int) set_field_fore (FIELD *,chtype);
+extern FORM_EXPORT(int) set_field_back (FIELD *,chtype);
+extern FORM_EXPORT(int) set_field_pad (FIELD *,int);
+extern FORM_EXPORT(int) field_pad (const FIELD *);
+extern FORM_EXPORT(int) set_field_buffer (FIELD *,int,const char *);
+extern FORM_EXPORT(int) set_field_status (FIELD *,bool);
+extern FORM_EXPORT(int) set_field_userptr (FIELD *, void *);
+extern FORM_EXPORT(int) set_field_opts (FIELD *,Field_Options);
+extern FORM_EXPORT(int) field_opts_on (FIELD *,Field_Options);
+extern FORM_EXPORT(int) field_opts_off (FIELD *,Field_Options);
+
+extern FORM_EXPORT(chtype) field_fore (const FIELD *);
+extern FORM_EXPORT(chtype) field_back (const FIELD *);
+
+extern FORM_EXPORT(bool) new_page (const FIELD *);
+extern FORM_EXPORT(bool) field_status (const FIELD *);
+
+extern FORM_EXPORT(void *) field_arg (const FIELD *);
+
+extern FORM_EXPORT(void *) field_userptr (const FIELD *);
+
+extern FORM_EXPORT(FIELDTYPE *) field_type (const FIELD *);
+
+extern FORM_EXPORT(char *) field_buffer (const FIELD *,int);
+
+extern FORM_EXPORT(Field_Options) field_opts (const FIELD *);
/******************
* FORM routines *
******************/
-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) unfocus_current_field (FORM *);
-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 FORM_EXPORT(FORM *) new_form (FIELD **);
+
+extern FORM_EXPORT(FIELD **) form_fields (const FORM *);
+extern FORM_EXPORT(FIELD *) current_field (const FORM *);
+
+extern FORM_EXPORT(WINDOW *) form_win (const FORM *);
+extern FORM_EXPORT(WINDOW *) form_sub (const FORM *);
+
+extern FORM_EXPORT(Form_Hook) form_init (const FORM *);
+extern FORM_EXPORT(Form_Hook) form_term (const FORM *);
+extern FORM_EXPORT(Form_Hook) field_init (const FORM *);
+extern FORM_EXPORT(Form_Hook) field_term (const FORM *);
+
+extern FORM_EXPORT(int) free_form (FORM *);
+extern FORM_EXPORT(int) set_form_fields (FORM *,FIELD **);
+extern FORM_EXPORT(int) field_count (const FORM *);
+extern FORM_EXPORT(int) set_form_win (FORM *,WINDOW *);
+extern FORM_EXPORT(int) set_form_sub (FORM *,WINDOW *);
+extern FORM_EXPORT(int) set_current_field (FORM *,FIELD *);
+extern FORM_EXPORT(int) unfocus_current_field (FORM *);
+extern FORM_EXPORT(int) field_index (const FIELD *);
+extern FORM_EXPORT(int) set_form_page (FORM *,int);
+extern FORM_EXPORT(int) form_page (const FORM *);
+extern FORM_EXPORT(int) scale_form (const FORM *,int *,int *);
+extern FORM_EXPORT(int) set_form_init (FORM *,Form_Hook);
+extern FORM_EXPORT(int) set_form_term (FORM *,Form_Hook);
+extern FORM_EXPORT(int) set_field_init (FORM *,Form_Hook);
+extern FORM_EXPORT(int) set_field_term (FORM *,Form_Hook);
+extern FORM_EXPORT(int) post_form (FORM *);
+extern FORM_EXPORT(int) unpost_form (FORM *);
+extern FORM_EXPORT(int) pos_form_cursor (FORM *);
+extern FORM_EXPORT(int) form_driver (FORM *,int);
# if NCURSES_WIDECHAR
-extern NCURSES_EXPORT(int) form_driver_w (FORM *,int,wchar_t);
+extern FORM_EXPORT(int) form_driver_w (FORM *,int,wchar_t);
# endif
-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 FORM_EXPORT(int) set_form_userptr (FORM *,void *);
+extern FORM_EXPORT(int) set_form_opts (FORM *,Form_Options);
+extern FORM_EXPORT(int) form_opts_on (FORM *,Form_Options);
+extern FORM_EXPORT(int) form_opts_off (FORM *,Form_Options);
+extern FORM_EXPORT(int) form_request_by_name (const char *);
-extern NCURSES_EXPORT(const char *) form_request_name (int);
+extern FORM_EXPORT(const char *) form_request_name (int);
-extern NCURSES_EXPORT(void *) form_userptr (const FORM *);
+extern FORM_EXPORT(void *) form_userptr (const FORM *);
-extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *);
+extern FORM_EXPORT(Form_Options) form_opts (const FORM *);
-extern NCURSES_EXPORT(bool) data_ahead (const FORM *);
-extern NCURSES_EXPORT(bool) data_behind (const FORM *);
+extern FORM_EXPORT(bool) data_ahead (const FORM *);
+extern FORM_EXPORT(bool) data_behind (const FORM *);
#if NCURSES_SP_FUNCS
-extern NCURSES_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **);
+extern FORM_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **);
#endif
#ifdef __cplusplus
diff --git a/form/form.priv.h b/form/form.priv.h
index 53c717c..4cf3071 100644
--- a/form/form.priv.h
+++ b/form/form.priv.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: form.priv.h,v 0.45 2020/02/02 23:34:34 tom Exp $ */
+/* $Id: form.priv.h,v 0.48 2021/06/17 21:30:22 tom Exp $ */
#ifndef FORM_PRIV_H
#define FORM_PRIV_H 1
@@ -69,9 +69,9 @@
/***********************
* Default objects *
***********************/
-extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form;
-extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field;
-extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
+extern FORM_EXPORT_VAR(FORM *) _nc_Default_Form;
+extern FORM_EXPORT_VAR(FIELD *) _nc_Default_Field;
+extern FORM_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
/* form status values */
#define _OVLMODE (0x04U) /* Form is in overlay mode */
@@ -110,7 +110,7 @@ extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
#define Get_Form_Screen(form) CURRENT_SCREEN
#endif
-/* Retrieve forms window */
+/* Retrieve form's window */
#define Get_Form_Window(form) \
((form)->sub \
? (form)->sub \
@@ -176,54 +176,54 @@ TypeArgument;
#define C_ZEROS '\0'
-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*);
-extern NCURSES_EXPORT(void) _nc_Unset_Current_Field(FORM *form);
+extern FORM_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*);
+extern FORM_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*);
+extern FORM_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*);
+extern FORM_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *);
+extern FORM_EXPORT(void) _nc_Free_Type (FIELD *);
+
+extern FORM_EXPORT(int) _nc_Synchronize_Attributes (FIELD*);
+extern FORM_EXPORT(int) _nc_Synchronize_Options (FIELD*, Field_Options);
+extern FORM_EXPORT(int) _nc_Set_Form_Page (FORM*, int, FIELD*);
+extern FORM_EXPORT(int) _nc_Refresh_Current_Field (FORM*);
+extern FORM_EXPORT(FIELD *) _nc_First_Active_Field (FORM*);
+extern FORM_EXPORT(bool) _nc_Internal_Validation (FORM*);
+extern FORM_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*);
+extern FORM_EXPORT(int) _nc_Position_Form_Cursor (FORM*);
+extern FORM_EXPORT(void) _nc_Unset_Current_Field(FORM *form);
#if NCURSES_INTEROP_FUNCS
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void);
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void);
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void);
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void);
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void);
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void);
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void);
-
-extern NCURSES_EXPORT(FIELDTYPE *)
-_nc_generic_fieldtype(bool (*const field_check) (FORM*,
- FIELD *,
+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void);
+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void);
+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void);
+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void);
+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void);
+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void);
+extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void);
+
+extern FORM_EXPORT(FIELDTYPE *)
+_nc_generic_fieldtype(bool (*const field_check) (FORM*,
+ FIELD *,
const void *),
- bool (*const char_check) (int,
- FORM*,
- FIELD*,
+ bool (*const char_check) (int,
+ FORM*,
+ FIELD*,
const void *),
bool (*const next)(FORM*,FIELD*,const void*),
bool (*const prev)(FORM*,FIELD*,const void*),
void (*freecallback)(void*));
-extern NCURSES_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**));
-extern NCURSES_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* );
+extern FORM_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**));
+extern FORM_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* );
#define INIT_FT_FUNC(func) {func}
#else
#define INIT_FT_FUNC(func) func
#endif
-extern NCURSES_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*);
+extern FORM_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*);
#if USE_WIDEC_SUPPORT
-extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
+extern FORM_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
#endif
#ifdef TRACE
@@ -234,11 +234,11 @@ extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
#define returnFieldType(code) TRACE_RETURN1(code,field_type)
#define returnFormHook(code) TRACE_RETURN1(code,form_hook)
-extern NCURSES_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **);
-extern NCURSES_EXPORT(FIELD *) _nc_retrace_field (FIELD *);
-extern NCURSES_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *);
-extern NCURSES_EXPORT(FORM *) _nc_retrace_form (FORM *);
-extern NCURSES_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook);
+extern FORM_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **);
+extern FORM_EXPORT(FIELD *) _nc_retrace_field (FIELD *);
+extern FORM_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *);
+extern FORM_EXPORT(FORM *) _nc_retrace_form (FORM *);
+extern FORM_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook);
#else /* !TRACE */
diff --git a/form/frm_cursor.c b/form/frm_cursor.c
index 8ff42bf..a54b483 100644
--- a/form/frm_cursor.c
+++ b/form/frm_cursor.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,12 +33,12 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_cursor.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_cursor.c,v 1.13 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int pos_form_cursor(FORM * form)
-|
+|
| Description : Moves the form window cursor to the location required
| by the form driver to resume form processing. This may
| be needed after the application calls a curses library
@@ -49,7 +49,7 @@ MODULE_ID("$Id: frm_cursor.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - Invalid form pointer
| E_NOT_POSTED - Form is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
pos_form_cursor(FORM *form)
{
int res;
diff --git a/form/frm_data.c b/form/frm_data.c
index 5c3b2a0..940c32d 100644
--- a/form/frm_data.c
+++ b/form/frm_data.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,19 +33,19 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_data.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.21 2021/06/17 21:11:08 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : bool data_behind(const FORM *form)
-|
+|
| Description : Check for off-screen data behind. This is nearly trivial
| because the beginning of a field is fixed.
|
| Return Values : TRUE - there are off-screen data behind
| FALSE - there are no off-screen data behind
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
data_behind(const FORM *form)
{
bool result = FALSE;
@@ -70,12 +70,12 @@ data_behind(const FORM *form)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static char * Only_Padding(
| WINDOW *w,
| int len,
| int pad)
-|
+|
| Description : Test if 'length' cells starting at the current position
| contain a padding character.
|
@@ -104,7 +104,7 @@ Only_Padding(WINDOW *w, int len, int pad)
}
}
#else
- cell = (FIELD_CELL) winch(w);
+ cell = (FIELD_CELL)winch(w);
if (ChCharOf(cell) != ChCharOf(pad))
{
result = FALSE;
@@ -123,16 +123,16 @@ Only_Padding(WINDOW *w, int len, int pad)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : bool data_ahead(const FORM *form)
-|
+|
| Description : Check for off-screen data ahead. This is more difficult
-| because a dynamic field has a variable end.
+| because a dynamic field has a variable end.
|
| Return Values : TRUE - there are off-screen data ahead
| FALSE - there are no off-screen data ahead
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
data_ahead(const FORM *form)
{
bool result = FALSE;
@@ -150,12 +150,11 @@ data_ahead(const FORM *form)
if (Single_Line_Field(field))
{
- int check_len;
-
pos = form->begincol + field->cols;
while (pos < field->dcols)
{
- check_len = field->dcols - pos;
+ int check_len = field->dcols - pos;
+
if (check_len >= field->cols)
check_len = field->cols;
cursor_moved = TRUE;
diff --git a/form/frm_def.c b/form/frm_def.c
index 0722d51..a9f21f2 100644
--- a/form/frm_def.c
+++ b/form/frm_def.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_def.c,v 1.27 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.30 2021/03/27 23:49:58 tom Exp $")
/* this can't be readonly */
static FORM default_form =
@@ -62,14 +62,14 @@ static FORM default_form =
NULL /* fieldterm */
};
-NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
-
+FORM_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
+
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static FIELD *Insert_Field_By_Position(
-| FIELD *new_field,
+| FIELD *new_field,
| FIELD *head )
-|
+|
| Description : Insert new_field into sorted fieldlist with head "head"
| and return new head of sorted fieldlist. Sorting
| criteria is (row,column). This is a circular list.
@@ -113,9 +113,9 @@ Insert_Field_By_Position(FIELD *newfield, FIELD *head)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void Disconnect_Fields(FORM *form)
-|
+|
| Description : Break association between form and array of fields.
|
| Return Values : -
@@ -143,9 +143,9 @@ Disconnect_Fields(FORM *form)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static int Connect_Fields(FORM *form, FIELD **fields)
-|
+|
| Description : Set association between form and array of fields.
|
| Return Values : E_OK - no error
@@ -158,7 +158,6 @@ Connect_Fields(FORM *form, FIELD **fields)
{
int field_cnt, j;
int page_nr;
- int maximum_row_in_field, maximum_col_in_field;
_PAGE *pg;
T((T_CALLED("Connect_Fields(%p,%p)"), (void *)form, (void *)fields));
@@ -199,15 +198,18 @@ Connect_Fields(FORM *form, FIELD **fields)
size of the form */
for (j = 0; j < field_cnt; j++)
{
+ int maximum_row_in_field;
+ int maximum_col_in_field;
+
if (j == 0)
- pg->pmin = (short) j;
+ pg->pmin = (short)j;
else
{
if (fields[j]->status & _NEWPAGE)
{
- pg->pmax = (short) (j - 1);
+ pg->pmax = (short)(j - 1);
pg++;
- pg->pmin = (short) j;
+ pg->pmin = (short)j;
}
}
@@ -215,14 +217,14 @@ Connect_Fields(FORM *form, FIELD **fields)
maximum_col_in_field = fields[j]->fcol + fields[j]->cols;
if (form->rows < maximum_row_in_field)
- form->rows = (short) maximum_row_in_field;
+ form->rows = (short)maximum_row_in_field;
if (form->cols < maximum_col_in_field)
- form->cols = (short) maximum_col_in_field;
+ form->cols = (short)maximum_col_in_field;
}
- pg->pmax = (short) (field_cnt - 1);
- form->maxfield = (short) field_cnt;
- form->maxpage = (short) page_nr;
+ pg->pmax = (short)(field_cnt - 1);
+ form->maxfield = (short)field_cnt;
+ form->maxpage = (short)page_nr;
/* Sort fields on form pages */
for (page_nr = 0; page_nr < form->maxpage; page_nr++)
@@ -231,8 +233,8 @@ Connect_Fields(FORM *form, FIELD **fields)
for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
{
- fields[j]->index = (short) j;
- fields[j]->page = (short) page_nr;
+ fields[j]->index = (short)j;
+ fields[j]->page = (short)page_nr;
fld = Insert_Field_By_Position(fields[j], fld);
}
if (fld)
@@ -250,10 +252,10 @@ Connect_Fields(FORM *form, FIELD **fields)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static int Associate_Fields(FORM *form, FIELD **fields)
-|
-| Description : Set association between form and array of fields.
+|
+| Description : Set association between form and array of fields.
| If there are fields, position to first active field.
|
| Return Values : E_OK - success
@@ -283,9 +285,9 @@ Associate_Fields(FORM *form, FIELD **fields)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FORM *new_form_sp(SCREEN* sp, FIELD** fields )
-|
+|
| Description : Create new form with given array of fields.
|
| Return Values : Pointer to form. NULL if error occurred.
@@ -295,7 +297,7 @@ Associate_Fields(FORM *form, FIELD **fields)
| E_CONNECTED - a field is already connected
| E_SYSTEM_ERROR - not enough memory
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FORM *)
+FORM_EXPORT(FORM *)
NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
{
int err = E_SYSTEM_ERROR;
@@ -331,9 +333,9 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FORM* new_form(FIELD** fields )
-|
+|
| Description : Create new form with given array of fields.
|
| Return Values : Pointer to form. NULL if error occurred.
@@ -344,7 +346,7 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
| E_SYSTEM_ERROR - not enough memory
+--------------------------------------------------------------------------*/
#if NCURSES_SP_FUNCS
-NCURSES_EXPORT(FORM *)
+FORM_EXPORT(FORM *)
new_form(FIELD **fields)
{
return NCURSES_SP_NAME(new_form) (CURRENT_SCREEN, fields);
@@ -352,16 +354,16 @@ new_form(FIELD **fields)
#endif
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int free_form( FORM *form )
-|
+|
| Description : Release internal memory associated with form.
|
| Return Values : E_OK - no error
| E_BAD_ARGUMENT - invalid form pointer
| E_POSTED - form is posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
free_form(FORM *form)
{
T((T_CALLED("free_form(%p)"), (void *)form));
@@ -381,9 +383,9 @@ free_form(FORM *form)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_form_fields( FORM *form, FIELD **fields )
-|
+|
| Description : Set a new association of an array of fields to a form
|
| Return Values : E_OK - no error
@@ -392,7 +394,7 @@ free_form(FORM *form)
| E_POSTED - form is posted
| E_SYSTEM_ERROR - not enough memory
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_form_fields(FORM *form, FIELD **fields)
{
FIELD **old;
@@ -416,14 +418,14 @@ set_form_fields(FORM *form, FIELD **fields)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FIELD **form_fields( const FORM *form )
-|
+|
| Description : Retrieve array of fields
|
| Return Values : Pointer to field array
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELD **)
+FORM_EXPORT(FIELD **)
form_fields(const FORM *form)
{
T((T_CALLED("form_field(%p)"), (const void *)form));
@@ -431,14 +433,14 @@ form_fields(const FORM *form)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int field_count( const FORM *form )
-|
+|
| Description : Retrieve number of fields
|
| Return Values : Number of fields, -1 if none are defined
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
field_count(const FORM *form)
{
T((T_CALLED("field_count(%p)"), (const void *)form));
diff --git a/form/frm_driver.c b/form/frm_driver.c
index b9f91e1..75656d6 100644
--- a/form/frm_driver.c
+++ b/form/frm_driver.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.129 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.135 2021/09/01 23:34:01 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
@@ -131,34 +131,34 @@ static int FE_Delete_Previous(FORM *);
/* Calculate the position of a single row in a field buffer */
#define Position_Of_Row_In_Buffer(field,row) ((row)*(field)->dcols)
-/* Calculate start address for the fields buffer# N */
+/* Calculate start address for the field's buffer# N */
#define Address_Of_Nth_Buffer(field,N) \
((field)->buf + (N)*(1+Buffer_Length(field)))
-/* Calculate the start address of the row in the fields specified buffer# N */
+/* Calculate the start address of the row in the field's specified buffer# N */
#define Address_Of_Row_In_Nth_Buffer(field,N,row) \
(Address_Of_Nth_Buffer(field,N) + Position_Of_Row_In_Buffer(field,row))
-/* Calculate the start address of the row in the fields primary buffer */
+/* Calculate the start address of the row in the field's primary buffer */
#define Address_Of_Row_In_Buffer(field,row) \
Address_Of_Row_In_Nth_Buffer(field,0,row)
-/* Calculate the start address of the row in the forms current field
+/* Calculate the start address of the row in the form's current field
buffer# N */
#define Address_Of_Current_Row_In_Nth_Buffer(form,N) \
Address_Of_Row_In_Nth_Buffer((form)->current,N,(form)->currow)
-/* Calculate the start address of the row in the forms current field
+/* Calculate the start address of the row in the form's current field
primary buffer */
#define Address_Of_Current_Row_In_Buffer(form) \
Address_Of_Current_Row_In_Nth_Buffer(form,0)
-/* Calculate the address of the cursor in the forms current field
+/* Calculate the address of the cursor in the form's current field
primary buffer */
#define Address_Of_Current_Position_In_Nth_Buffer(form,N) \
(Address_Of_Current_Row_In_Nth_Buffer(form,N) + (form)->curcol)
-/* Calculate the address of the cursor in the forms current field
+/* Calculate the address of the cursor in the form's current field
buffer# N */
#define Address_Of_Current_Position_In_Buffer(form) \
Address_Of_Current_Position_In_Nth_Buffer(form,0)
@@ -187,7 +187,7 @@ static int FE_Delete_Previous(FORM *);
/* Logic to determine whether or not a dynamic field may still grow */
#define Growable(field) ((field)->status & _MAY_GROW)
-/* Macro to set the attributes for a fields window */
+/* Macro to set the attributes for a field's window */
#define Set_Field_Window_Attributes(field,win) \
( wbkgdset((win),(chtype)((chtype)((field)->pad) | (field)->back)), \
(void) wattrset((win), (int)(field)->fore) )
@@ -217,10 +217,10 @@ static FIELD_CELL myZEROS;
static void
check_pos(FORM *form, int lineno)
{
- int y, x;
-
if (form && form->w)
{
+ int y, x;
+
getyx(form->w, y, x);
if (y != form->currow || x != form->curcol)
{
@@ -265,10 +265,11 @@ static int
wide_winsnstr(WINDOW *w, const cchar_t *s, int n)
{
int code = ERR;
- int y, x;
while (n-- > 0)
{
+ int y, x;
+
getyx(w, y, x);
if ((code = wins_wch(w, s++)) != OK)
break;
@@ -511,7 +512,6 @@ Buffer_To_Window(const FIELD *field, WINDOW *win)
{
int width, height;
int y, x;
- int len;
int row;
FIELD_CELL *pBuffer;
@@ -525,6 +525,8 @@ Buffer_To_Window(const FIELD *field, WINDOW *win)
row < height;
row++, pBuffer += width)
{
+ int len;
+
if ((len = (int)(After_End_Of_Data(pBuffer, width) - pBuffer)) > 0)
{
wmove(win, row, 0);
@@ -548,7 +550,7 @@ Buffer_To_Window(const FIELD *field, WINDOW *win)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
+FORM_EXPORT(void)
_nc_get_fieldbuffer(FORM *form, FIELD *field, FIELD_CELL *buf)
{
int pad;
@@ -706,8 +708,6 @@ Field_Grown(FIELD *field, int amount)
* realloc().
*/
int i, j;
- FIELD_CELL *old_bp;
- FIELD_CELL *new_bp;
result = TRUE; /* allow sharing of recovery on failure */
@@ -715,8 +715,9 @@ Field_Grown(FIELD *field, int amount)
field->buf = newbuf;
for (i = 0; i <= field->nbuf; i++)
{
- new_bp = Address_Of_Nth_Buffer(field, i);
- old_bp = oldbuf + i * (1 + old_buflen);
+ FIELD_CELL *new_bp = Address_Of_Nth_Buffer(field, i);
+ FIELD_CELL *old_bp = oldbuf + i * (1 + old_buflen);
+
for (j = 0; j < old_buflen; ++j)
new_bp[j] = old_bp[j];
while (j < new_buflen)
@@ -826,7 +827,7 @@ Field_encloses(FIELD *field, int ry, int rx)
| E_SYSTEM_ERROR - form has no current field or
| field-window
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
_nc_Position_Form_Cursor(FORM *form)
{
FIELD *field;
@@ -860,7 +861,7 @@ _nc_Position_Form_Cursor(FORM *form)
| Facility : libnform
| Function : int _nc_Refresh_Current_Field(FORM * form)
|
-| Description : Propagate the changes in the fields window to the
+| Description : Propagate the changes in the field's window to the
| window of the form.
|
| Return Values : E_OK - on success
@@ -868,7 +869,7 @@ _nc_Position_Form_Cursor(FORM *form)
| E_SYSTEM_ERROR - general error
+--------------------------------------------------------------------------*/
static bool move_after_insert = TRUE;
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
_nc_Refresh_Current_Field(FORM *form)
{
WINDOW *formwin;
@@ -917,11 +918,12 @@ _nc_Refresh_Current_Field(FORM *form)
else
{
/* A multi-line, i.e. vertical scrolling field */
- int row_after_bottom, first_modified_row, first_unmodified_row;
+ int first_modified_row, first_unmodified_row;
if (field->drows > field->rows)
{
- row_after_bottom = form->toprow + field->rows;
+ int row_after_bottom = form->toprow + field->rows;
+
if (form->currow < form->toprow)
{
form->toprow = form->currow;
@@ -1005,7 +1007,6 @@ Perform_Justification(FIELD *field, WINDOW *win)
{
FIELD_CELL *bp;
int len;
- int col = 0;
bp = (Field_Has_Option(field, O_NO_LEFT_STRIP)
? field->buf
@@ -1014,6 +1015,8 @@ Perform_Justification(FIELD *field, WINDOW *win)
if (len > 0)
{
+ int col = 0;
+
assert(win && (field->drows == 1));
if (field->cols - len >= 0)
@@ -1240,7 +1243,6 @@ Synchronize_Linked_Fields(FIELD *field)
{
FIELD *linked_field;
int res = E_OK;
- int syncres;
if (!field)
return (E_BAD_ARGUMENT);
@@ -1252,6 +1254,8 @@ Synchronize_Linked_Fields(FIELD *field)
(linked_field != field) && (linked_field != 0);
linked_field = linked_field->link)
{
+ int syncres;
+
if (((syncres = Synchronize_Field(linked_field)) != E_OK) &&
(res == E_OK))
res = syncres;
@@ -1263,7 +1267,7 @@ Synchronize_Linked_Fields(FIELD *field)
| Facility : libnform
| Function : int _nc_Synchronize_Attributes(FIELD * field)
|
-| Description : If a fields visual attributes have changed, this
+| Description : If a field's visual attributes have changed, this
| routine is called to propagate those changes to the
| screen.
|
@@ -1271,12 +1275,11 @@ Synchronize_Linked_Fields(FIELD *field)
| E_BAD_ARGUMENT - invalid field pointer
| E_SYSTEM_ERROR - some severe basic error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
_nc_Synchronize_Attributes(FIELD *field)
{
FORM *form;
int res = E_OK;
- WINDOW *formwin;
T((T_CALLED("_nc_Synchronize_Attributes(%p)"), (void *)field));
@@ -1303,7 +1306,8 @@ _nc_Synchronize_Attributes(FIELD *field)
}
else
{
- formwin = Get_Form_Window(form);
+ WINDOW *formwin = Get_Form_Window(form);
+
copywin(form->w, formwin,
0, 0,
field->frow, field->fcol,
@@ -1329,7 +1333,7 @@ _nc_Synchronize_Attributes(FIELD *field)
| Function : int _nc_Synchronize_Options(FIELD * field,
| Field_Options newopts)
|
-| Description : If a fields options have changed, this routine is
+| Description : If a field's options have changed, this routine is
| called to propagate these changes to the screen and
| to really change the behavior of the field.
|
@@ -1338,7 +1342,7 @@ _nc_Synchronize_Attributes(FIELD *field)
| E_CURRENT - field is the current one
| E_SYSTEM_ERROR - some severe basic error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
_nc_Synchronize_Options(FIELD *field, Field_Options newopts)
{
Field_Options oldopts;
@@ -1491,7 +1495,7 @@ _nc_Unset_Current_Field(FORM *form)
| E_SYSTEM_ERROR - some severe basic error
| E_NOT_CONNECTED - no fields are connected to the form
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
_nc_Set_Current_Field(FORM *form, FIELD *newfield)
{
FIELD *field;
@@ -2422,7 +2426,6 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
int datalen = (int)(After_End_Of_Data(bp, field->dcols) - bp);
int freelen = field->dcols - datalen;
int requiredlen = len + 1;
- FIELD_CELL *split;
int result = E_REQUEST_DENIED;
if (freelen >= requiredlen)
@@ -2431,7 +2434,7 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
myINSNSTR(form->w, txt, len);
wmove(form->w, row, len);
myINSNSTR(form->w, &myBLANK, 1);
- return E_OK;
+ result = E_OK;
}
else
{
@@ -2447,6 +2450,8 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
if (row < (field->drows - 1))
{
+ FIELD_CELL *split;
+
split =
After_Last_Whitespace_Character(bp,
(int)(Get_Start_Of_Data(bp
@@ -2470,8 +2475,8 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
return E_OK;
}
}
- return (result);
}
+ return (result);
}
/*---------------------------------------------------------------------------
@@ -3225,7 +3230,7 @@ Check_Field(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
| Return Values : TRUE - field is valid
| FALSE - field is invalid
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
_nc_Internal_Validation(FORM *form)
{
FIELD *field;
@@ -3284,7 +3289,7 @@ FV_Validation(FORM *form)
|
| Description : Get the next field after the given field on the current
| page. The order of fields is the one defined by the
-| fields array. Only visible and active fields are
+| field's array. Only visible and active fields are
| counted.
|
| Return Values : Pointer to the next field.
@@ -3319,7 +3324,7 @@ Next_Field_On_Page(FIELD *field)
|
| Return Values : Pointer to calculated field.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELD *)
+FORM_EXPORT(FIELD *)
_nc_First_Active_Field(FORM *form)
{
FIELD **last_on_page = &form->field[form->page[form->curpage].pmax];
@@ -3367,7 +3372,7 @@ _nc_First_Active_Field(FORM *form)
|
| Description : Get the previous field before the given field on the
| current page. The order of fields is the one defined by
-| the fields array. Only visible and active fields are
+| the field's array. Only visible and active fields are
| counted.
|
| Return Values : Pointer to the previous field.
@@ -3501,10 +3506,10 @@ Right_Neighbor_Field(FIELD *field)
| Function : static FIELD *Upper_Neighbor_Field(FIELD * field)
|
| Description : Because of the row-major nature of sorting the fields,
-| it is more difficult to define whats the upper neighbor
+| it is more difficult to define what the upper neighbor
| field really means. We define that it must be on a
| 'previous' line (cyclic order!) and is the rightmost
-| field laying on the left side of the given field. If
+| field lying on the left side of the given field. If
| this set is empty, we take the first field on the line.
|
| Return Values : Pointer to the upper neighbor field.
@@ -3551,7 +3556,7 @@ Upper_Neighbor_Field(FIELD *field)
| Function : static FIELD *Down_Neighbor_Field(FIELD * field)
|
| Description : Because of the row-major nature of sorting the fields,
-| its more difficult to define whats the down neighbor
+| it is more difficult to define what the down neighbor
| field really means. We define that it must be on a
| 'next' line (cyclic order!) and is the leftmost
| field laying on the right side of the given field. If
@@ -3873,7 +3878,7 @@ FN_Down_Field(FORM *form)
| E_BAD_ARGUMENT - invalid field pointer
| E_SYSTEM_ERROR - some severe basic error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
_nc_Set_Form_Page(FORM *form, int page, FIELD *field)
{
int res = E_OK;
@@ -3952,7 +3957,7 @@ Previous_Page_Number(const FORM *form)
| that the field is left and a new field is entered.
| So the field must be validated and the field init/term
| hooks must be called. Because also the page is changed,
-| the forms init/term hooks must be called also.
+| the form's init/term hooks must be called also.
|
| Return Values : E_OK - success
| E_INVALID_FIELD - field is invalid
@@ -4354,10 +4359,10 @@ static const Binding_Info bindings[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] =
| E_NOT_CONNECTED - no fields are connected to the form
| E_UNKNOWN_COMMAND - command not known
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
form_driver(FORM *form, int c)
{
- const Binding_Info *BI = (Binding_Info *) 0;
+ const Binding_Info *BI = (Binding_Info *)0;
int res = E_UNKNOWN_COMMAND;
move_after_insert = TRUE;
@@ -4412,7 +4417,7 @@ form_driver(FORM *form, int c)
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
- size_t method = (size_t) ((BI->keycode >> ID_Shft) & 0xffff); /* see ID_Mask */
+ size_t method = (size_t)((BI->keycode >> ID_Shft) & 0xffff); /* see ID_Mask */
if ((method >= nMethods) || !(BI->cmd))
res = E_SYSTEM_ERROR;
@@ -4474,14 +4479,13 @@ form_driver(FORM *form, int c)
}
else if (wenclose(sub, event.y, event.x))
{ /* Inside the area we try to find the hit item */
- int i;
-
ry = event.y;
rx = event.x;
if (wmouse_trafo(sub, &ry, &rx, FALSE))
{
int min_field = form->page[form->curpage].pmin;
int max_field = form->page[form->curpage].pmax;
+ int i;
for (i = min_field; i <= max_field; ++i)
{
@@ -4561,10 +4565,10 @@ form_driver(FORM *form, int c)
| E_NOT_CONNECTED - no fields are connected to the form
| E_UNKNOWN_COMMAND - command not known
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
form_driver_w(FORM *form, int type, wchar_t c)
{
- const Binding_Info *BI = (Binding_Info *) 0;
+ const Binding_Info *BI = (Binding_Info *)0;
int res = E_UNKNOWN_COMMAND;
T((T_CALLED("form_driver(%p,%d)"), (void *)form, (int)c));
@@ -4618,7 +4622,7 @@ form_driver_w(FORM *form, int type, wchar_t c)
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
- size_t method = (size_t) (BI->keycode >> ID_Shft) & 0xffff; /* see ID_Mask */
+ size_t method = (size_t)(BI->keycode >> ID_Shft) & 0xffff; /* see ID_Mask */
if ((method >= nMethods) || !(BI->cmd))
res = E_SYSTEM_ERROR;
@@ -4676,14 +4680,13 @@ form_driver_w(FORM *form, int type, wchar_t c)
}
else if (wenclose(sub, event.y, event.x))
{ /* Inside the area we try to find the hit item */
- int i;
-
ry = event.y;
rx = event.x;
if (wmouse_trafo(sub, &ry, &rx, FALSE))
{
int min_field = form->page[form->curpage].pmin;
int max_field = form->page[form->curpage].pmax;
+ int i;
for (i = min_field; i <= max_field; ++i)
{
@@ -4736,14 +4739,14 @@ form_driver_w(FORM *form, int type, wchar_t c)
| For dynamic fields this may grow the fieldbuffers if
| the length of the value exceeds the current buffer
| length. For buffer 0 only printable values are allowed.
-| For static fields, the value needs not to be zero ter-
-| minated. It is copied up to the length of the buffer.
+| For static fields, the value must not be zero terminated.
+| It is copied up to the length of the buffer.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid argument
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_field_buffer(FIELD *field, int buffer, const char *value)
{
FIELD_CELL *p;
@@ -4860,7 +4863,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
|
| Return Values : Pointer to buffer or NULL if arguments were invalid.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(char *)
+FORM_EXPORT(char *)
field_buffer(const FIELD *field, int buffer)
{
char *result = 0;
@@ -4928,7 +4931,7 @@ field_buffer(const FIELD *field, int buffer)
| Convert a multibyte string to a wide-character string. The result must be
| freed by the caller.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(wchar_t *)
+FORM_EXPORT(wchar_t *)
_nc_Widen_String(char *source, int *lengthp)
{
wchar_t *result = 0;
@@ -4972,7 +4975,7 @@ _nc_Widen_String(char *source, int *lengthp)
{
result[need] = wch;
}
- passed += (size_t) status;
+ passed += (size_t)status;
++need;
}
else
diff --git a/form/frm_hook.c b/form/frm_hook.c
index 3051cdd..39d4d22 100644
--- a/form/frm_hook.c
+++ b/form/frm_hook.c
@@ -33,11 +33,11 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_hook.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_hook.c,v 1.20 2020/05/24 01:40:20 anonymous.maarten Exp $")
/* "Template" macro to generate function to set application specific hook */
#define GEN_HOOK_SET_FUNCTION( typ, name ) \
-NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\
+FORM_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\
{\
TR_FUNC_BFR(1); \
T((T_CALLED("set_" #typ"_"#name"(%p,%s)"), (void *) form, TR_FUNC_ARG(0, func)));\
@@ -47,7 +47,7 @@ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook f
/* "Template" macro to generate function to get application specific hook */
#define GEN_HOOK_GET_FUNCTION( typ, name ) \
-NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\
+FORM_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\
{\
T((T_CALLED(#typ "_" #name "(%p)"), (const void *) form));\
returnFormHook( Normalize_Form( form ) -> typ ## name );\
diff --git a/form/frm_opts.c b/form/frm_opts.c
index 18ab293..62e2beb 100644
--- a/form/frm_opts.c
+++ b/form/frm_opts.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,24 +33,24 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_opts.c,v 1.18 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_opts.c,v 1.21 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_form_opts(FORM *form, Form_Options opts)
-|
+|
| Description : Turns on the named options and turns off all the
| remaining options for that form.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_form_opts(FORM *form, Form_Options opts)
{
T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts));
- opts &= (Form_Options) ALL_FORM_OPTS;
+ opts &= (Form_Options)ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
@@ -61,36 +61,36 @@ set_form_opts(FORM *form, Form_Options opts)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : Form_Options form_opts(const FORM *)
-|
+|
| Description : Retrieves the current form options.
|
| Return Values : The option flags.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(Form_Options)
+FORM_EXPORT(Form_Options)
form_opts(const FORM *form)
{
T((T_CALLED("form_opts(%p)"), (const void *)form));
- returnCode((Form_Options) ((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS));
+ returnCode((Form_Options)((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS));
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int form_opts_on(FORM *form, Form_Options opts)
-|
-| Description : Turns on the named options; no other options are
+|
+| Description : Turns on the named options; no other options are
| changed.
|
-| Return Values : E_OK - success
+| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
form_opts_on(FORM *form, Form_Options opts)
{
T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts));
- opts &= (Form_Options) ALL_FORM_OPTS;
+ opts &= (Form_Options)ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
@@ -101,21 +101,21 @@ form_opts_on(FORM *form, Form_Options opts)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int form_opts_off(FORM *form, Form_Options opts)
-|
-| Description : Turns off the named options; no other options are
+|
+| Description : Turns off the named options; no other options are
| changed.
|
-| Return Values : E_OK - success
+| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
form_opts_off(FORM *form, Form_Options opts)
{
T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts));
- opts &= (Form_Options) ALL_FORM_OPTS;
+ opts &= (Form_Options)ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
diff --git a/form/frm_page.c b/form/frm_page.c
index c8569ee..ee8dd38 100644
--- a/form/frm_page.c
+++ b/form/frm_page.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,12 +33,12 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_page.c,v 1.15 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_form_page(FORM * form,int page)
-|
+|
| Description : Set the page number of the form.
|
| Return Values : E_OK - success
@@ -47,7 +47,7 @@ MODULE_ID("$Id: frm_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
| E_INVALID_FIELD - current field can't be left
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_form_page(FORM *form, int page)
{
int err = E_OK;
@@ -88,15 +88,15 @@ set_form_page(FORM *form, int page)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int form_page(const FORM * form)
-|
+|
| Description : Return the current page of the form.
|
| Return Values : >= 0 : current page number
| -1 : invalid form pointer
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
form_page(const FORM *form)
{
T((T_CALLED("form_page(%p)"), (const void *)form));
diff --git a/form/frm_post.c b/form/frm_post.c
index 2f1ad81..ab88089 100644
--- a/form/frm_post.c
+++ b/form/frm_post.c
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_post.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_post.c,v 1.14 2020/05/24 01:40:20 anonymous.maarten Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@@ -48,7 +48,7 @@ MODULE_ID("$Id: frm_post.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
| E_NO_ROOM - form doesn't fit into subwindow
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
post_form(FORM *form)
{
WINDOW *formwin;
@@ -98,7 +98,7 @@ post_form(FORM *form)
| E_NOT_POSTED - form isn't posted
| E_BAD_STATE - called from a hook routine
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
unpost_form(FORM *form)
{
T((T_CALLED("unpost_form(%p)"), (void *)form));
diff --git a/form/frm_req_name.c b/form/frm_req_name.c
index 1e56c3d..8b76a8e 100644
--- a/form/frm_req_name.c
+++ b/form/frm_req_name.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -38,7 +38,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_req_name.c,v 1.20 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_req_name.c,v 1.23 2021/06/17 21:11:08 tom Exp $")
#define DATA(s) { s }
@@ -112,15 +112,15 @@ static const char request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1][13] =
#define A_SIZE (sizeof(request_names)/sizeof(request_names[0]))
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : const char * form_request_name (int request);
-|
+|
| Description : Get the external name of a form request.
|
| Return Values : Pointer to name - on success
| NULL - on invalid request code
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
+FORM_EXPORT(const char *)
form_request_name(int request)
{
T((T_CALLED("form_request_name(%d)"), request));
@@ -135,27 +135,28 @@ form_request_name(int request)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int form_request_by_name (const char *str);
-|
+|
| Description : Search for a request with this name.
|
| Return Values : Request Id - on success
| E_NO_MATCH - request not found
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_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.
*/
size_t i = 0;
- char buf[16]; /* longest name is 10 chars */
T((T_CALLED("form_request_by_name(%s)"), _nc_visbuf(str)));
if (str != 0 && (i = strlen(str)) != 0)
{
+ char buf[16]; /* longest name is 10 chars */
+
if (i > sizeof(buf) - 2)
i = sizeof(buf) - 2;
memcpy(buf, str, i);
diff --git a/form/frm_scale.c b/form/frm_scale.c
index 34c3611..d53798e 100644
--- a/form/frm_scale.c
+++ b/form/frm_scale.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,19 +33,19 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_scale.c,v 1.13 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int scale_form( const FORM *form, int *rows, int *cols )
-|
+|
| Description : Retrieve size of form
|
| Return Values : E_OK - no error
| E_BAD_ARGUMENT - invalid form pointer
| E_NOT_CONNECTED - no fields connected to form
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
scale_form(const FORM *form, int *rows, int *cols)
{
T((T_CALLED("scale_form(%p,%p,%p)"),
diff --git a/form/frm_sub.c b/form/frm_sub.c
index 9621e30..8f1de09 100644
--- a/form/frm_sub.c
+++ b/form/frm_sub.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,18 +33,18 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_sub.c,v 1.15 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_form_sub(FORM *form, WINDOW *win)
-|
-| Description : Set the subwindow of the form to win.
+|
+| Description : Set the subwindow of the form to win.
|
| Return Values : E_OK - success
| E_POSTED - form is posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_form_sub(FORM *form, WINDOW *win)
{
T((T_CALLED("set_form_sub(%p,%p)"), (void *)form, (void *)win));
@@ -66,14 +66,14 @@ set_form_sub(FORM *form, WINDOW *win)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : WINDOW *form_sub(const FORM *)
-|
+|
| Description : Retrieve the window of the form.
|
| Return Values : The pointer to the Subwindow.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(WINDOW *)
+FORM_EXPORT(WINDOW *)
form_sub(const FORM *form)
{
const FORM *f;
diff --git a/form/frm_user.c b/form/frm_user.c
index e1210f2..a4a2249 100644
--- a/form/frm_user.c
+++ b/form/frm_user.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,18 +33,18 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_user.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_user.c,v 1.19 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_form_userptr(FORM *form, void *usrptr)
-|
+|
| Description : Set the pointer that is reserved in any form to store
-| application relevant informations
+| application relevant information.
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_form_userptr(FORM *form, void *usrptr)
{
T((T_CALLED("set_form_userptr(%p,%p)"), (void *)form, (void *)usrptr));
@@ -54,16 +54,16 @@ set_form_userptr(FORM *form, void *usrptr)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : void *form_userptr(const FORM *form)
-|
+|
| Description : Return the pointer that is reserved in any form to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void *)
+FORM_EXPORT(void *)
form_userptr(const FORM *form)
{
T((T_CALLED("form_userptr(%p)"), (const void *)form));
diff --git a/form/frm_win.c b/form/frm_win.c
index b7d1272..eeea27d 100644
--- a/form/frm_win.c
+++ b/form/frm_win.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,18 +33,18 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_win.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: frm_win.c,v 1.19 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_form_win(FORM *form,WINDOW *win)
-|
-| Description : Set the window of the form to win.
+|
+| Description : Set the window of the form to win.
|
| Return Values : E_OK - success
| E_POSTED - form is posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
set_form_win(FORM *form, WINDOW *win)
{
T((T_CALLED("set_form_win(%p,%p)"), (void *)form, (void *)win));
@@ -66,14 +66,14 @@ set_form_win(FORM *form, WINDOW *win)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : WINDOW *form_win(const FORM *)
-|
+|
| Description : Retrieve the window of the form.
|
| Return Values : The pointer to the Window or stdscr if there is none.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(WINDOW *)
+FORM_EXPORT(WINDOW *)
form_win(const FORM *form)
{
WINDOW *result;
diff --git a/form/fty_alnum.c b/form/fty_alnum.c
index a2ca351..854dc33 100644
--- a/form/fty_alnum.c
+++ b/form/fty_alnum.c
@@ -35,7 +35,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_alnum.c,v 1.25 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_alnum.c,v 1.29 2020/12/12 01:15:37 tom Exp $")
#define thisARG alnumARG
@@ -56,7 +56,7 @@ thisARG;
static void *
Generic_This_Type(void *arg)
{
- thisARG *argp = (thisARG *) 0;
+ thisARG *argp = (thisARG *)0;
if (arg)
{
@@ -140,7 +140,7 @@ static bool
Check_This_Character(int c, const void *argp GCC_UNUSED)
{
#if USE_WIDEC_SUPPORT
- if (iswalnum((wint_t) c))
+ if (iswalnum((wint_t)c))
return TRUE;
#endif
return (isalnum(UChar(c)) ? TRUE : FALSE);
@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_TYPE_ALNUM(void)
{
return TYPE_ALNUM;
diff --git a/form/fty_alpha.c b/form/fty_alpha.c
index 7dec23f..a37459a 100644
--- a/form/fty_alpha.c
+++ b/form/fty_alpha.c
@@ -35,7 +35,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_alpha.c,v 1.27 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_alpha.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
#define thisARG alphaARG
@@ -56,7 +56,7 @@ thisARG;
static void *
Generic_This_Type(void *arg)
{
- thisARG *argp = (thisARG *) 0;
+ thisARG *argp = (thisARG *)0;
if (arg)
{
@@ -140,7 +140,7 @@ static bool
Check_This_Character(int c, const void *argp GCC_UNUSED)
{
#if USE_WIDEC_SUPPORT
- if (iswalpha((wint_t) c))
+ if (iswalpha((wint_t)c))
return TRUE;
#endif
return (isalpha(UChar(c)) ? TRUE : FALSE);
@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_TYPE_ALPHA(void)
{
return TYPE_ALPHA;
diff --git a/form/fty_enum.c b/form/fty_enum.c
index 71978e3..16ffae1 100644
--- a/form/fty_enum.c
+++ b/form/fty_enum.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,7 +35,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_enum.c,v 1.27 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.33 2021/06/17 21:11:08 tom Exp $")
typedef struct
{
@@ -55,9 +55,9 @@ typedef struct
enumParams;
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void *Generic_Enum_Type(void * arg)
-|
+|
| Description : Allocate structure for enumeration type argument.
|
| Return Values : Pointer to argument structure or NULL on error
@@ -66,7 +66,7 @@ static void *
Generic_Enum_Type(void *arg)
{
enumARG *argp = (enumARG *)0;
- enumParams *params = (enumParams *) arg;
+ enumParams *params = (enumParams *)arg;
if (params)
{
@@ -77,7 +77,6 @@ Generic_Enum_Type(void *arg)
int cnt = 0;
char **kp = (char **)0;
char **kwds = (char **)0;
- char **kptarget;
int ccase, cunique;
T((T_CREATE("enumARG %p"), (void *)argp));
@@ -96,6 +95,8 @@ Generic_Enum_Type(void *arg)
if (cnt > 0)
{
+ char **kptarget;
+
/* We copy the keywords, because we can't rely on the fact
that the caller doesn't relocate or free the memory used
for the keywords (maybe he has GC)
@@ -118,9 +119,9 @@ Generic_Enum_Type(void *arg)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void *Make_Enum_Type( va_list * ap )
-|
+|
| Description : Allocate structure for enumeration type argument.
|
| Return Values : Pointer to argument structure or NULL on error
@@ -138,10 +139,10 @@ Make_Enum_Type(va_list *ap)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void *Copy_Enum_Type( const void * argp )
-|
-| Description : Copy structure for enumeration type argument.
+|
+| Description : Copy structure for enumeration type argument.
|
| Return Values : Pointer to argument structure or NULL on error.
+--------------------------------------------------------------------------*/
@@ -182,9 +183,9 @@ Copy_Enum_Type(const void *argp)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void Free_Enum_Type( void * argp )
-|
+|
| Description : Free structure for enumeration type argument.
|
| Return Values : -
@@ -219,11 +220,11 @@ Free_Enum_Type(void *argp)
#define EXACT 2
/*---------------------------------------------------------------------------
-| Facility : libnform
-| Function : static int Compare(const unsigned char * s,
+| Facility : libnform
+| Function : static int Compare(const unsigned char * s,
| const unsigned char * buf,
| bool ccase )
-|
+|
| Description : Check whether or not the text in 'buf' matches the
| text in 's', at least partial.
|
@@ -274,11 +275,11 @@ Compare(const unsigned char *s, const unsigned char *buf,
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static bool Check_Enum_Field(
| FIELD * field,
| const void * argp)
-|
+|
| Description : Validate buffer content to be a valid enumeration value
|
| Return Values : TRUE - field is valid
@@ -292,10 +293,11 @@ Check_Enum_Field(FIELD *field, const void *argp)
bool unique = ((const enumARG *)argp)->checkunique;
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
char *s, *t, *p;
- int res;
while (kwds && (s = (*kwds++)))
{
+ int res;
+
if ((res = Compare((unsigned char *)s, bp, ccase)) != NOMATCH)
{
p = t = s; /* t is at least a partial match */
@@ -331,10 +333,10 @@ static const char *dummy[] =
{(char *)0};
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static bool Next_Enum(FIELD * field,
| const void * argp)
-|
+|
| Description : Check for the next enumeration value
|
| Return Values : TRUE - next value found and loaded
@@ -368,11 +370,11 @@ Next_Enum(FIELD *field, const void *argp)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static bool Previous_Enum(
| FIELD * field,
| const void * argp)
-|
+|
| Description : Check for the previous enumeration value
|
| Return Values : TRUE - previous value found and loaded
@@ -425,15 +427,14 @@ static FIELDTYPE typeENUM =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE *)
-TYPE_ENUM = &typeENUM;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM = &typeENUM;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_TYPE_ENUM(void)
{
return TYPE_ENUM;
diff --git a/form/fty_generic.c b/form/fty_generic.c
index 159d305..301c80a 100644
--- a/form/fty_generic.c
+++ b/form/fty_generic.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2008-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,27 +35,28 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_generic.c,v 1.10 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_generic.c,v 1.15 2021/03/27 23:49:53 tom Exp $")
/*
* This is not a full implementation of a field type, but adds some
* support for higher level languages with some restrictions to interop
- * with C language. Especially the collection of arguments for the
+ * with C language. In particular, the collection of arguments for the
* various fieldtypes is not based on the vararg C mechanism, but on a
- * iterator based callback mechanism that allowes the high level language
+ * iterator based callback mechanism that allows the high level language
* to provide the arguments as a structure. Most languages have mechanisms
* to layout structures so that they can be passed to C.
+ *
* The languages can register a new generic fieldtype dynamically and store
* a handle (key) to the calling object as an argument. Together with that
* it can register a freearg callback, so that the high level language
* remains in control of the memory management of the arguments they pass.
* The design idea is, that the high-level language - typically a OO
- * language like C# or Java, uses it's own dispatching mechanisms
+ * language like C# or Java, uses its own dispatching mechanisms
* (polymorphism) to call the proper check routines responsible for the
* argument type. So these language implement typically only one generic
* fieldtype they register with the forms library using this call.
*
- * For that purpose we have extended the fieldtype struc by a new element
+ * For that purpose we have extended the fieldtype structure by a new element
* that gets the arguments from a single struct passed by the caller.
*
*/
@@ -99,7 +100,7 @@ Generic_This_Type(void *arg)
|
| Return Values : Fieldtype pointer or NULL if error occurred
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_generic_fieldtype(bool (*const field_check) (FORM *, FIELD *, const void *),
bool (*const char_check) (int, FORM *, FIELD *, const
void *),
@@ -220,7 +221,7 @@ GenericArgument(const FIELDTYPE *typ,
| Return Values : E_OK if all went well
| E_SYSTEM_ERROR if an error occurred
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+FORM_EXPORT(int)
_nc_set_generic_fieldtype(FIELD *field,
FIELDTYPE *ftyp,
int (*argiterator) (void **))
@@ -273,15 +274,15 @@ _nc_set_generic_fieldtype(FIELD *field,
| Description : Get the current position of the form cursor position
| We also return the field window
|
-| Return Values : The fields Window or NULL on error
+| Return Values : The field's Window or NULL on error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(WINDOW *)
+FORM_EXPORT(WINDOW *)
_nc_form_cursor(const FORM *form, int *pRow, int *pCol)
{
int code = E_SYSTEM_ERROR;
WINDOW *res = (WINDOW *)0;
- if (!(form == 0 || pRow == 0 || pCol == 0))
+ if (form != 0 && pRow != 0 && pCol != 0)
{
*pRow = form->currow;
*pCol = form->curcol;
diff --git a/form/fty_int.c b/form/fty_int.c
index 7105640..c7e3135 100644
--- a/form/fty_int.c
+++ b/form/fty_int.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,7 +35,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_int.c,v 1.27 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_int.c,v 1.33 2021/06/17 21:11:08 tom Exp $")
#if USE_WIDEC_SUPPORT
#define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
@@ -62,9 +62,9 @@ typedef struct
integerPARM;
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void *Generic_This_Type( void * arg )
-|
+|
| Description : Allocate structure for integer type argument.
|
| Return Values : Pointer to argument structure or NULL on error
@@ -72,8 +72,8 @@ integerPARM;
static void *
Generic_This_Type(void *arg)
{
- thisARG *argp = (thisARG *) 0;
- thisARG *param = (thisARG *) arg;
+ thisARG *argp = (thisARG *)0;
+ thisARG *param = (thisARG *)arg;
if (param)
{
@@ -89,9 +89,9 @@ Generic_This_Type(void *arg)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void *Make_This_Type( va_list * ap )
-|
+|
| Description : Allocate structure for integer type argument.
|
| Return Values : Pointer to argument structure or NULL on error
@@ -109,10 +109,10 @@ Make_This_Type(va_list *ap)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void *Copy_This_Type(const void * argp)
-|
-| Description : Copy structure for integer type argument.
+|
+| Description : Copy structure for integer type argument.
|
| Return Values : Pointer to argument structure or NULL on error.
+--------------------------------------------------------------------------*/
@@ -120,11 +120,12 @@ static void *
Copy_This_Type(const void *argp)
{
const thisARG *ap = (const thisARG *)argp;
- thisARG *result = (thisARG *) 0;
+ thisARG *result = (thisARG *)0;
if (argp)
{
result = typeMalloc(thisARG, 1);
+
if (result)
{
T((T_CREATE("thisARG %p"), (void *)result));
@@ -135,9 +136,9 @@ Copy_This_Type(const void *argp)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void Free_This_Type(void * argp)
-|
+|
| Description : Free structure for integer type argument.
|
| Return Values : -
@@ -150,11 +151,11 @@ Free_This_Type(void *argp)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static bool Check_This_Field(
| FIELD * field,
| const void * argp)
-|
+|
| Description : Validate buffer content to be a valid integer value
|
| Return Values : TRUE - field is valid
@@ -169,11 +170,9 @@ Check_This_Field(FIELD *field, const void *argp)
int prec = argi->precision;
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
char *s = (char *)bp;
- long val;
- char buf[100];
bool result = FALSE;
- while (*bp && *bp == ' ')
+ while (*bp == ' ')
bp++;
if (*bp)
{
@@ -182,13 +181,14 @@ Check_This_Field(FIELD *field, const void *argp)
#if USE_WIDEC_SUPPORT
if (*bp)
{
- bool blank = FALSE;
int len;
- int n;
wchar_t *list = _nc_Widen_String((char *)bp, &len);
if (list != 0)
{
+ bool blank = FALSE;
+ int n;
+
result = TRUE;
for (n = 0; n < len; ++n)
{
@@ -226,7 +226,8 @@ Check_This_Field(FIELD *field, const void *argp)
#endif
if (result)
{
- val = atol(s);
+ long val = atol(s);
+
if (low < high)
{
if (val < low || val > high)
@@ -234,6 +235,8 @@ Check_This_Field(FIELD *field, const void *argp)
}
if (result)
{
+ char buf[100];
+
_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
"%.*ld", (prec > 0 ? prec : 0), val);
set_field_buffer(field, 0, buf);
@@ -244,11 +247,11 @@ Check_This_Field(FIELD *field, const void *argp)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static bool Check_This_Character(
| int c,
| const void * argp)
-|
+|
| Description : Check a character for the integer type.
|
| Return Values : TRUE - character is valid
@@ -278,14 +281,14 @@ static FIELDTYPE typeTHIS =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_TYPE_INTEGER(void)
{
return TYPE_INTEGER;
diff --git a/form/fty_ipv4.c b/form/fty_ipv4.c
index 3713377..108f7b4 100644
--- a/form/fty_ipv4.c
+++ b/form/fty_ipv4.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2006,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,14 +35,14 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_ipv4.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_ipv4.c,v 1.16 2021/06/17 21:11:08 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static bool Check_IPV4_Field(
| FIELD * field,
| const void * argp)
-|
+|
| Description : Validate buffer content to be a valid IP number (Ver. 4)
|
| Return Values : TRUE - field is valid
@@ -53,7 +53,7 @@ Check_IPV4_Field(FIELD *field, const void *argp GCC_UNUSED)
{
char *bp = field_buffer(field, 0);
int num = 0, len;
- unsigned int d1, d2, d3, d4;
+ unsigned int d1 = 0, d2 = 0, d3 = 0, d4 = 0;
if (isdigit(UChar(*bp))) /* Must start with digit */
{
@@ -70,11 +70,11 @@ Check_IPV4_Field(FIELD *field, const void *argp GCC_UNUSED)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static bool Check_IPV4_Character(
-| int c,
+| int c,
| const void *argp )
-|
+|
| Description : Check a character for unsigned type or period.
|
| Return Values : TRUE - character is valid
@@ -104,14 +104,14 @@ static FIELDTYPE typeIPV4 =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4 = &typeIPV4;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_TYPE_IPV4(void)
{
return TYPE_IPV4;
diff --git a/form/fty_num.c b/form/fty_num.c
index b4dfeb9..34cef63 100644
--- a/form/fty_num.c
+++ b/form/fty_num.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,7 +35,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_num.c,v 1.32 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_num.c,v 1.37 2021/03/27 23:49:58 tom Exp $")
#if HAVE_LOCALE_H
#include <locale.h>
@@ -83,8 +83,8 @@ thisPARM;
static void *
Generic_This_Type(void *arg)
{
- thisARG *argn = (thisARG *) 0;
- thisPARM *args = (thisPARM *) arg;
+ thisARG *argn = (thisARG *)0;
+ thisPARM *args = (thisPARM *)arg;
if (args)
{
@@ -139,11 +139,12 @@ static void *
Copy_This_Type(const void *argp)
{
const thisARG *ap = (const thisARG *)argp;
- thisARG *result = (thisARG *) 0;
+ thisARG *result = (thisARG *)0;
if (argp)
{
result = typeMalloc(thisARG, 1);
+
if (result)
{
T((T_CREATE("thisARG %p"), (void *)result));
@@ -187,12 +188,10 @@ Check_This_Field(FIELD *field, const void *argp)
int prec = argn->precision;
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
char *s = (char *)bp;
- double val = 0.0;
struct lconv *L = argn->L;
- char buf[64];
bool result = FALSE;
- while (*bp && *bp == ' ')
+ while (*bp == ' ')
bp++;
if (*bp)
{
@@ -201,14 +200,15 @@ Check_This_Field(FIELD *field, const void *argp)
#if USE_WIDEC_SUPPORT
if (*bp)
{
- bool blank = FALSE;
- int state = 0;
int len;
- int n;
wchar_t *list = _nc_Widen_String((char *)bp, &len);
if (list != 0)
{
+ bool blank = FALSE;
+ int state = 0;
+ int n;
+
result = TRUE;
for (n = 0; n < len; ++n)
{
@@ -264,7 +264,8 @@ Check_This_Field(FIELD *field, const void *argp)
#endif
if (result)
{
- val = atof(s);
+ double val = atof(s);
+
if (low < high)
{
if (val < low || val > high)
@@ -272,6 +273,8 @@ Check_This_Field(FIELD *field, const void *argp)
}
if (result)
{
+ char buf[64];
+
_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
"%.*f", (prec > 0 ? prec : 0), val);
set_field_buffer(field, 0, buf);
@@ -324,14 +327,14 @@ static FIELDTYPE typeTHIS =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_TYPE_NUMERIC(void)
{
return TYPE_NUMERIC;
diff --git a/form/fty_regex.c b/form/fty_regex.c
index da0ef08..62dcab5 100644
--- a/form/fty_regex.c
+++ b/form/fty_regex.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,12 +35,43 @@
#include "form.priv.h"
-MODULE_ID("$Id: fty_regex.c,v 1.28 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: fty_regex.c,v 1.33 2021/08/14 15:01:52 tom Exp $")
#if HAVE_REGEX_H_FUNCS || HAVE_LIB_PCRE2 /* We prefer POSIX regex */
-#if HAVE_PCRE2_POSIX_H
-#include <pcre2-posix.h>
+#if HAVE_PCRE2POSIX_H
+#include <pcre2posix.h>
+
+/* pcre2 used to provide its "POSIX" entrypoints using the same names as the
+ * standard ones in the C runtime, but that never worked because the linker
+ * would use the C runtime. Debian patched the library to fix this symbol
+ * conflict, but overlooked the header file, and Debian's patch was made
+ * obsolete when pcre2 was changed early in 2019 to provide different names.
+ *
+ * Here is a workaround to make the older version of Debian's package work.
+ */
+#if !defined(PCRE2regcomp) && defined(HAVE_PCRE2REGCOMP)
+
+#undef regcomp
+#undef regexec
+#undef regfree
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+ PCRE2POSIX_EXP_DECL int PCRE2regcomp(regex_t *, const char *, int);
+ PCRE2POSIX_EXP_DECL int PCRE2regexec(const regex_t *, const char *, size_t,
+ regmatch_t *, int);
+ PCRE2POSIX_EXP_DECL void PCRE2regfree(regex_t *);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+#define regcomp(r,s,n) PCRE2regcomp(r,s,n)
+#define regexec(r,s,n,m,x) PCRE2regexec(r,s,n,m,x)
+#define regfree(r) PCRE2regfree(r)
+#endif
+/* end workaround... */
#elif HAVE_PCREPOSIX_H
#include <pcreposix.h>
#else
@@ -340,14 +371,14 @@ static FIELDTYPE typeREGEXP =
#endif
};
-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP = &typeREGEXP;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
-NCURSES_EXPORT(FIELDTYPE *)
+FORM_EXPORT(FIELDTYPE *)
_nc_TYPE_REGEXP(void)
{
return TYPE_REGEXP;
diff --git a/form/llib-lform b/form/llib-lform
index b7f2acb..334f8cb 100644
--- a/form/llib-lform
+++ b/form/llib-lform
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2015,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -65,11 +65,11 @@ Form_Hook _nc_retrace_form_hook(
#undef set_fieldtype_arg
int set_fieldtype_arg(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
void *(*const make_arg)(
- va_list *p1),
+ va_list *p1),
void *(*const copy_arg)(
- const void *p1),
+ const void *p1),
void (*const free_arg)(
void *p1))
{ return(*(int *)0); }
@@ -83,7 +83,7 @@ void *field_arg(
#undef set_field_fore
int set_field_fore(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -94,7 +94,7 @@ chtype field_fore(
#undef set_field_back
int set_field_back(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -107,7 +107,7 @@ chtype field_back(
#undef set_current_field
int set_current_field(
- FORM *form,
+ FORM *form,
FIELD *field)
{ return(*(int *)0); }
@@ -133,27 +133,27 @@ FIELD *_nc_Default_Field;
#undef _nc_Make_Argument
TypeArgument *_nc_Make_Argument(
- const FIELDTYPE *typ,
- va_list *ap,
+ const FIELDTYPE *typ,
+ va_list *ap,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Copy_Argument
TypeArgument *_nc_Copy_Argument(
- const FIELDTYPE *typ,
- const TypeArgument *argp,
+ const FIELDTYPE *typ,
+ const TypeArgument *argp,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Free_Argument
void _nc_Free_Argument(
- const FIELDTYPE *typ,
+ const FIELDTYPE *typ,
TypeArgument *argp)
{ /* void */ }
#undef _nc_Copy_Type
NCURSES_BOOL _nc_Copy_Type(
- FIELD *dst,
+ FIELD *dst,
FIELD const *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -164,11 +164,11 @@ void _nc_Free_Type(
#undef new_field
FIELD *new_field(
- int rows,
- int cols,
- int frow,
- int fcol,
- int nrow,
+ int rows,
+ int cols,
+ int frow,
+ int fcol,
+ int nrow,
int nbuf)
{ return(*(FIELD **)0); }
@@ -181,8 +181,8 @@ int free_field(
#undef dup_field
FIELD *dup_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -190,12 +190,12 @@ FIELD *dup_field(
#undef set_fieldtype_choice
int set_fieldtype_choice(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
NCURSES_BOOL (*const next_choice)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const prev_choice)(
- FIELD *p1,
+ FIELD *p1,
const void *p2))
{ return(*(int *)0); }
@@ -203,7 +203,7 @@ int set_fieldtype_choice(
#undef link_fieldtype
FIELDTYPE *link_fieldtype(
- FIELDTYPE *type1,
+ FIELDTYPE *type1,
FIELDTYPE *type2)
{ return(*(FIELDTYPE **)0); }
@@ -211,20 +211,20 @@ FIELDTYPE *link_fieldtype(
#undef field_info
int field_info(
- const FIELD *field,
- int *rows,
- int *cols,
- int *frow,
- int *fcol,
- int *nrow,
+ const FIELD *field,
+ int *rows,
+ int *cols,
+ int *frow,
+ int *fcol,
+ int *nrow,
int *nbuf)
{ return(*(int *)0); }
#undef dynamic_field_info
int dynamic_field_info(
- const FIELD *field,
- int *drows,
- int *dcols,
+ const FIELD *field,
+ int *drows,
+ int *dcols,
int *maxgrow)
{ return(*(int *)0); }
@@ -232,7 +232,7 @@ int dynamic_field_info(
#undef set_field_just
int set_field_just(
- FIELD *field,
+ FIELD *field,
int just)
{ return(*(int *)0); }
@@ -245,8 +245,8 @@ int field_just(
#undef link_field
FIELD *link_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -254,7 +254,7 @@ FIELD *link_field(
#undef set_max_field
int set_max_field(
- FIELD *field,
+ FIELD *field,
int maxgrow)
{ return(*(int *)0); }
@@ -262,8 +262,8 @@ int set_max_field(
#undef move_field
int move_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(int *)0); }
@@ -275,10 +275,10 @@ FIELDTYPE *_nc_Default_FieldType;
#undef new_fieldtype
FIELDTYPE *new_fieldtype(
NCURSES_BOOL (*const field_check)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const char_check)(
- int p1,
+ int p1,
const void *p2))
{ return(*(FIELDTYPE **)0); }
@@ -291,7 +291,7 @@ int free_fieldtype(
#undef set_field_opts
int set_field_opts(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -302,13 +302,13 @@ Field_Options field_opts(
#undef field_opts_on
int field_opts_on(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
#undef field_opts_off
int field_opts_off(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -316,7 +316,7 @@ int field_opts_off(
#undef set_field_pad
int set_field_pad(
- FIELD *field,
+ FIELD *field,
int ch)
{ return(*(int *)0); }
@@ -329,7 +329,7 @@ int field_pad(
#undef set_new_page
int set_new_page(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL new_page_flag)
{ return(*(int *)0); }
@@ -342,7 +342,7 @@ NCURSES_BOOL new_page(
#undef set_field_status
int set_field_status(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL status)
{ return(*(int *)0); }
@@ -355,8 +355,8 @@ NCURSES_BOOL field_status(
#undef set_field_type
int set_field_type(
- FIELD *field,
- FIELDTYPE *type,
+ FIELD *field,
+ FIELDTYPE *type,
...)
{ return(*(int *)0); }
@@ -369,7 +369,7 @@ FIELDTYPE *field_type(
#undef set_field_userptr
int set_field_userptr(
- FIELD *field,
+ FIELD *field,
void *usrptr)
{ return(*(int *)0); }
@@ -404,7 +404,7 @@ FORM *_nc_Default_Form;
#undef new_form_sp
FORM *new_form_sp(
- SCREEN *sp,
+ SCREEN *sp,
FIELD **fields)
{ return(*(FORM **)0); }
@@ -420,7 +420,7 @@ int free_form(
#undef set_form_fields
int set_form_fields(
- FORM *form,
+ FORM *form,
FIELD **fields)
{ return(*(int *)0); }
@@ -438,8 +438,8 @@ int field_count(
#undef _nc_get_fieldbuffer
void _nc_get_fieldbuffer(
- FORM *form,
- FIELD *field,
+ FORM *form,
+ FIELD *field,
char *buf)
{ /* void */ }
@@ -460,7 +460,7 @@ int _nc_Synchronize_Attributes(
#undef _nc_Synchronize_Options
int _nc_Synchronize_Options(
- FIELD *field,
+ FIELD *field,
Field_Options newopts)
{ return(*(int *)0); }
@@ -471,7 +471,7 @@ void _nc_Unset_Current_Field(
#undef _nc_Set_Current_Field
int _nc_Set_Current_Field(
- FORM *form,
+ FORM *form,
FIELD *newfield)
{ return(*(int *)0); }
@@ -487,34 +487,34 @@ FIELD *_nc_First_Active_Field(
#undef _nc_Set_Form_Page
int _nc_Set_Form_Page(
- FORM *form,
- int page,
+ FORM *form,
+ int page,
FIELD *field)
{ return(*(int *)0); }
typedef struct
{
- int keycode;
- int (*cmd) (FORM *);
+ int keycode;
+ int (*cmd) (FORM *);
}
Binding_Info;
#undef form_driver
int form_driver(
- FORM *form,
+ FORM *form,
int c)
{ return(*(int *)0); }
#undef set_field_buffer
int set_field_buffer(
- FIELD *field,
- int buffer,
+ FIELD *field,
+ int buffer,
const char *value)
{ return(*(int *)0); }
#undef field_buffer
char *field_buffer(
- const FIELD *field,
+ const FIELD *field,
int buffer)
{ return(*(char **)0); }
@@ -522,7 +522,7 @@ char *field_buffer(
#undef set_field_init
int set_field_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -533,7 +533,7 @@ Form_Hook field_init(
#undef set_field_term
int set_field_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -544,7 +544,7 @@ Form_Hook field_term(
#undef set_form_init
int set_form_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -555,7 +555,7 @@ Form_Hook form_init(
#undef set_form_term
int set_form_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -568,7 +568,7 @@ Form_Hook form_term(
#undef set_form_opts
int set_form_opts(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -579,13 +579,13 @@ Form_Options form_opts(
#undef form_opts_on
int form_opts_on(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
#undef form_opts_off
int form_opts_off(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -593,7 +593,7 @@ int form_opts_off(
#undef set_form_page
int set_form_page(
- FORM *form,
+ FORM *form,
int page)
{ return(*(int *)0); }
@@ -630,8 +630,8 @@ int form_request_by_name(
#undef scale_form
int scale_form(
- const FORM *form,
- int *rows,
+ const FORM *form,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -639,7 +639,7 @@ int scale_form(
#undef set_form_sub
int set_form_sub(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -652,7 +652,7 @@ WINDOW *form_sub(
#undef set_form_userptr
int set_form_userptr(
- FORM *form,
+ FORM *form,
void *usrptr)
{ return(*(int *)0); }
@@ -665,7 +665,7 @@ void *form_userptr(
#undef set_form_win
int set_form_win(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -735,38 +735,38 @@ FIELDTYPE *_nc_TYPE_ENUM(void)
#undef _nc_generic_fieldtype
FIELDTYPE *_nc_generic_fieldtype(
NCURSES_BOOL (*const field_check)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const char_check)(
- int p1,
- FORM *p2,
- FIELD *p3,
- const void *p4),
+ int p1,
+ FORM *p2,
+ FIELD *p3,
+ const void *p4),
NCURSES_BOOL (*const next)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const prev)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
void (*freecallback)(
void *p1))
{ return(*(FIELDTYPE **)0); }
#undef _nc_set_generic_fieldtype
int _nc_set_generic_fieldtype(
- FIELD *field,
- FIELDTYPE *ftyp,
+ FIELD *field,
+ FIELDTYPE *ftyp,
int (*argiterator)(
void **p1))
{ return(*(int *)0); }
#undef _nc_form_cursor
WINDOW *_nc_form_cursor(
- const FORM *form,
- int *pRow,
+ const FORM *form,
+ int *pRow,
int *pCol)
{ return(*(WINDOW **)0); }
diff --git a/form/llib-lformt b/form/llib-lformt
index 6460016..d91b3f0 100644
--- a/form/llib-lformt
+++ b/form/llib-lformt
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2010-2015,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -65,11 +65,11 @@ Form_Hook _nc_retrace_form_hook(
#undef set_fieldtype_arg
int set_fieldtype_arg(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
void *(*const make_arg)(
- va_list *p1),
+ va_list *p1),
void *(*const copy_arg)(
- const void *p1),
+ const void *p1),
void (*const free_arg)(
void *p1))
{ return(*(int *)0); }
@@ -83,7 +83,7 @@ void *field_arg(
#undef set_field_fore
int set_field_fore(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -94,7 +94,7 @@ chtype field_fore(
#undef set_field_back
int set_field_back(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -107,7 +107,7 @@ chtype field_back(
#undef set_current_field
int set_current_field(
- FORM *form,
+ FORM *form,
FIELD *field)
{ return(*(int *)0); }
@@ -133,27 +133,27 @@ FIELD *_nc_Default_Field;
#undef _nc_Make_Argument
TypeArgument *_nc_Make_Argument(
- const FIELDTYPE *typ,
- va_list *ap,
+ const FIELDTYPE *typ,
+ va_list *ap,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Copy_Argument
TypeArgument *_nc_Copy_Argument(
- const FIELDTYPE *typ,
- const TypeArgument *argp,
+ const FIELDTYPE *typ,
+ const TypeArgument *argp,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Free_Argument
void _nc_Free_Argument(
- const FIELDTYPE *typ,
+ const FIELDTYPE *typ,
TypeArgument *argp)
{ /* void */ }
#undef _nc_Copy_Type
NCURSES_BOOL _nc_Copy_Type(
- FIELD *dst,
+ FIELD *dst,
FIELD const *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -164,11 +164,11 @@ void _nc_Free_Type(
#undef new_field
FIELD *new_field(
- int rows,
- int cols,
- int frow,
- int fcol,
- int nrow,
+ int rows,
+ int cols,
+ int frow,
+ int fcol,
+ int nrow,
int nbuf)
{ return(*(FIELD **)0); }
@@ -181,8 +181,8 @@ int free_field(
#undef dup_field
FIELD *dup_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -190,12 +190,12 @@ FIELD *dup_field(
#undef set_fieldtype_choice
int set_fieldtype_choice(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
NCURSES_BOOL (*const next_choice)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const prev_choice)(
- FIELD *p1,
+ FIELD *p1,
const void *p2))
{ return(*(int *)0); }
@@ -203,7 +203,7 @@ int set_fieldtype_choice(
#undef link_fieldtype
FIELDTYPE *link_fieldtype(
- FIELDTYPE *type1,
+ FIELDTYPE *type1,
FIELDTYPE *type2)
{ return(*(FIELDTYPE **)0); }
@@ -211,20 +211,20 @@ FIELDTYPE *link_fieldtype(
#undef field_info
int field_info(
- const FIELD *field,
- int *rows,
- int *cols,
- int *frow,
- int *fcol,
- int *nrow,
+ const FIELD *field,
+ int *rows,
+ int *cols,
+ int *frow,
+ int *fcol,
+ int *nrow,
int *nbuf)
{ return(*(int *)0); }
#undef dynamic_field_info
int dynamic_field_info(
- const FIELD *field,
- int *drows,
- int *dcols,
+ const FIELD *field,
+ int *drows,
+ int *dcols,
int *maxgrow)
{ return(*(int *)0); }
@@ -232,7 +232,7 @@ int dynamic_field_info(
#undef set_field_just
int set_field_just(
- FIELD *field,
+ FIELD *field,
int just)
{ return(*(int *)0); }
@@ -245,8 +245,8 @@ int field_just(
#undef link_field
FIELD *link_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -254,7 +254,7 @@ FIELD *link_field(
#undef set_max_field
int set_max_field(
- FIELD *field,
+ FIELD *field,
int maxgrow)
{ return(*(int *)0); }
@@ -262,8 +262,8 @@ int set_max_field(
#undef move_field
int move_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(int *)0); }
@@ -275,10 +275,10 @@ FIELDTYPE *_nc_Default_FieldType;
#undef new_fieldtype
FIELDTYPE *new_fieldtype(
NCURSES_BOOL (*const field_check)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const char_check)(
- int p1,
+ int p1,
const void *p2))
{ return(*(FIELDTYPE **)0); }
@@ -291,7 +291,7 @@ int free_fieldtype(
#undef set_field_opts
int set_field_opts(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -302,13 +302,13 @@ Field_Options field_opts(
#undef field_opts_on
int field_opts_on(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
#undef field_opts_off
int field_opts_off(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -316,7 +316,7 @@ int field_opts_off(
#undef set_field_pad
int set_field_pad(
- FIELD *field,
+ FIELD *field,
int ch)
{ return(*(int *)0); }
@@ -329,7 +329,7 @@ int field_pad(
#undef set_new_page
int set_new_page(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL new_page_flag)
{ return(*(int *)0); }
@@ -342,7 +342,7 @@ NCURSES_BOOL new_page(
#undef set_field_status
int set_field_status(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL status)
{ return(*(int *)0); }
@@ -355,8 +355,8 @@ NCURSES_BOOL field_status(
#undef set_field_type
int set_field_type(
- FIELD *field,
- FIELDTYPE *type,
+ FIELD *field,
+ FIELDTYPE *type,
...)
{ return(*(int *)0); }
@@ -369,7 +369,7 @@ FIELDTYPE *field_type(
#undef set_field_userptr
int set_field_userptr(
- FIELD *field,
+ FIELD *field,
void *usrptr)
{ return(*(int *)0); }
@@ -404,7 +404,7 @@ FORM *_nc_Default_Form;
#undef new_form_sp
FORM *new_form_sp(
- SCREEN *sp,
+ SCREEN *sp,
FIELD **fields)
{ return(*(FORM **)0); }
@@ -420,7 +420,7 @@ int free_form(
#undef set_form_fields
int set_form_fields(
- FORM *form,
+ FORM *form,
FIELD **fields)
{ return(*(int *)0); }
@@ -438,8 +438,8 @@ int field_count(
#undef _nc_get_fieldbuffer
void _nc_get_fieldbuffer(
- FORM *form,
- FIELD *field,
+ FORM *form,
+ FIELD *field,
char *buf)
{ /* void */ }
@@ -460,7 +460,7 @@ int _nc_Synchronize_Attributes(
#undef _nc_Synchronize_Options
int _nc_Synchronize_Options(
- FIELD *field,
+ FIELD *field,
Field_Options newopts)
{ return(*(int *)0); }
@@ -471,7 +471,7 @@ void _nc_Unset_Current_Field(
#undef _nc_Set_Current_Field
int _nc_Set_Current_Field(
- FORM *form,
+ FORM *form,
FIELD *newfield)
{ return(*(int *)0); }
@@ -487,34 +487,34 @@ FIELD *_nc_First_Active_Field(
#undef _nc_Set_Form_Page
int _nc_Set_Form_Page(
- FORM *form,
- int page,
+ FORM *form,
+ int page,
FIELD *field)
{ return(*(int *)0); }
typedef struct
{
- int keycode;
- int (*cmd) (FORM *);
+ int keycode;
+ int (*cmd) (FORM *);
}
Binding_Info;
#undef form_driver
int form_driver(
- FORM *form,
+ FORM *form,
int c)
{ return(*(int *)0); }
#undef set_field_buffer
int set_field_buffer(
- FIELD *field,
- int buffer,
+ FIELD *field,
+ int buffer,
const char *value)
{ return(*(int *)0); }
#undef field_buffer
char *field_buffer(
- const FIELD *field,
+ const FIELD *field,
int buffer)
{ return(*(char **)0); }
@@ -522,7 +522,7 @@ char *field_buffer(
#undef set_field_init
int set_field_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -533,7 +533,7 @@ Form_Hook field_init(
#undef set_field_term
int set_field_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -544,7 +544,7 @@ Form_Hook field_term(
#undef set_form_init
int set_form_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -555,7 +555,7 @@ Form_Hook form_init(
#undef set_form_term
int set_form_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -568,7 +568,7 @@ Form_Hook form_term(
#undef set_form_opts
int set_form_opts(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -579,13 +579,13 @@ Form_Options form_opts(
#undef form_opts_on
int form_opts_on(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
#undef form_opts_off
int form_opts_off(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -593,7 +593,7 @@ int form_opts_off(
#undef set_form_page
int set_form_page(
- FORM *form,
+ FORM *form,
int page)
{ return(*(int *)0); }
@@ -630,8 +630,8 @@ int form_request_by_name(
#undef scale_form
int scale_form(
- const FORM *form,
- int *rows,
+ const FORM *form,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -639,7 +639,7 @@ int scale_form(
#undef set_form_sub
int set_form_sub(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -652,7 +652,7 @@ WINDOW *form_sub(
#undef set_form_userptr
int set_form_userptr(
- FORM *form,
+ FORM *form,
void *usrptr)
{ return(*(int *)0); }
@@ -665,7 +665,7 @@ void *form_userptr(
#undef set_form_win
int set_form_win(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -735,38 +735,38 @@ FIELDTYPE *_nc_TYPE_ENUM(void)
#undef _nc_generic_fieldtype
FIELDTYPE *_nc_generic_fieldtype(
NCURSES_BOOL (*const field_check)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const char_check)(
- int p1,
- FORM *p2,
- FIELD *p3,
- const void *p4),
+ int p1,
+ FORM *p2,
+ FIELD *p3,
+ const void *p4),
NCURSES_BOOL (*const next)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const prev)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
void (*freecallback)(
void *p1))
{ return(*(FIELDTYPE **)0); }
#undef _nc_set_generic_fieldtype
int _nc_set_generic_fieldtype(
- FIELD *field,
- FIELDTYPE *ftyp,
+ FIELD *field,
+ FIELDTYPE *ftyp,
int (*argiterator)(
void **p1))
{ return(*(int *)0); }
#undef _nc_form_cursor
WINDOW *_nc_form_cursor(
- const FORM *form,
- int *pRow,
+ const FORM *form,
+ int *pRow,
int *pCol)
{ return(*(WINDOW **)0); }
diff --git a/form/llib-lformtw b/form/llib-lformtw
index a24dd1a..340bf59 100644
--- a/form/llib-lformtw
+++ b/form/llib-lformtw
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2010-2015,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -65,11 +65,11 @@ Form_Hook _nc_retrace_form_hook(
#undef set_fieldtype_arg
int set_fieldtype_arg(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
void *(*const make_arg)(
- va_list *p1),
+ va_list *p1),
void *(*const copy_arg)(
- const void *p1),
+ const void *p1),
void (*const free_arg)(
void *p1))
{ return(*(int *)0); }
@@ -83,7 +83,7 @@ void *field_arg(
#undef set_field_fore
int set_field_fore(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -94,7 +94,7 @@ chtype field_fore(
#undef set_field_back
int set_field_back(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -107,7 +107,7 @@ chtype field_back(
#undef set_current_field
int set_current_field(
- FORM *form,
+ FORM *form,
FIELD *field)
{ return(*(int *)0); }
@@ -133,27 +133,27 @@ FIELD *_nc_Default_Field;
#undef _nc_Make_Argument
TypeArgument *_nc_Make_Argument(
- const FIELDTYPE *typ,
- va_list *ap,
+ const FIELDTYPE *typ,
+ va_list *ap,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Copy_Argument
TypeArgument *_nc_Copy_Argument(
- const FIELDTYPE *typ,
- const TypeArgument *argp,
+ const FIELDTYPE *typ,
+ const TypeArgument *argp,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Free_Argument
void _nc_Free_Argument(
- const FIELDTYPE *typ,
+ const FIELDTYPE *typ,
TypeArgument *argp)
{ /* void */ }
#undef _nc_Copy_Type
NCURSES_BOOL _nc_Copy_Type(
- FIELD *dst,
+ FIELD *dst,
FIELD const *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -164,11 +164,11 @@ void _nc_Free_Type(
#undef new_field
FIELD *new_field(
- int rows,
- int cols,
- int frow,
- int fcol,
- int nrow,
+ int rows,
+ int cols,
+ int frow,
+ int fcol,
+ int nrow,
int nbuf)
{ return(*(FIELD **)0); }
@@ -181,8 +181,8 @@ int free_field(
#undef dup_field
FIELD *dup_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -190,12 +190,12 @@ FIELD *dup_field(
#undef set_fieldtype_choice
int set_fieldtype_choice(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
NCURSES_BOOL (*const next_choice)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const prev_choice)(
- FIELD *p1,
+ FIELD *p1,
const void *p2))
{ return(*(int *)0); }
@@ -203,7 +203,7 @@ int set_fieldtype_choice(
#undef link_fieldtype
FIELDTYPE *link_fieldtype(
- FIELDTYPE *type1,
+ FIELDTYPE *type1,
FIELDTYPE *type2)
{ return(*(FIELDTYPE **)0); }
@@ -211,20 +211,20 @@ FIELDTYPE *link_fieldtype(
#undef field_info
int field_info(
- const FIELD *field,
- int *rows,
- int *cols,
- int *frow,
- int *fcol,
- int *nrow,
+ const FIELD *field,
+ int *rows,
+ int *cols,
+ int *frow,
+ int *fcol,
+ int *nrow,
int *nbuf)
{ return(*(int *)0); }
#undef dynamic_field_info
int dynamic_field_info(
- const FIELD *field,
- int *drows,
- int *dcols,
+ const FIELD *field,
+ int *drows,
+ int *dcols,
int *maxgrow)
{ return(*(int *)0); }
@@ -232,7 +232,7 @@ int dynamic_field_info(
#undef set_field_just
int set_field_just(
- FIELD *field,
+ FIELD *field,
int just)
{ return(*(int *)0); }
@@ -245,8 +245,8 @@ int field_just(
#undef link_field
FIELD *link_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -254,7 +254,7 @@ FIELD *link_field(
#undef set_max_field
int set_max_field(
- FIELD *field,
+ FIELD *field,
int maxgrow)
{ return(*(int *)0); }
@@ -262,8 +262,8 @@ int set_max_field(
#undef move_field
int move_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(int *)0); }
@@ -275,10 +275,10 @@ FIELDTYPE *_nc_Default_FieldType;
#undef new_fieldtype
FIELDTYPE *new_fieldtype(
NCURSES_BOOL (*const field_check)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const char_check)(
- int p1,
+ int p1,
const void *p2))
{ return(*(FIELDTYPE **)0); }
@@ -291,7 +291,7 @@ int free_fieldtype(
#undef set_field_opts
int set_field_opts(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -302,13 +302,13 @@ Field_Options field_opts(
#undef field_opts_on
int field_opts_on(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
#undef field_opts_off
int field_opts_off(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -316,7 +316,7 @@ int field_opts_off(
#undef set_field_pad
int set_field_pad(
- FIELD *field,
+ FIELD *field,
int ch)
{ return(*(int *)0); }
@@ -329,7 +329,7 @@ int field_pad(
#undef set_new_page
int set_new_page(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL new_page_flag)
{ return(*(int *)0); }
@@ -342,7 +342,7 @@ NCURSES_BOOL new_page(
#undef set_field_status
int set_field_status(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL status)
{ return(*(int *)0); }
@@ -355,8 +355,8 @@ NCURSES_BOOL field_status(
#undef set_field_type
int set_field_type(
- FIELD *field,
- FIELDTYPE *type,
+ FIELD *field,
+ FIELDTYPE *type,
...)
{ return(*(int *)0); }
@@ -369,7 +369,7 @@ FIELDTYPE *field_type(
#undef set_field_userptr
int set_field_userptr(
- FIELD *field,
+ FIELD *field,
void *usrptr)
{ return(*(int *)0); }
@@ -404,7 +404,7 @@ FORM *_nc_Default_Form;
#undef new_form_sp
FORM *new_form_sp(
- SCREEN *sp,
+ SCREEN *sp,
FIELD **fields)
{ return(*(FORM **)0); }
@@ -420,7 +420,7 @@ int free_form(
#undef set_form_fields
int set_form_fields(
- FORM *form,
+ FORM *form,
FIELD **fields)
{ return(*(int *)0); }
@@ -438,8 +438,8 @@ int field_count(
#undef _nc_get_fieldbuffer
void _nc_get_fieldbuffer(
- FORM *form,
- FIELD *field,
+ FORM *form,
+ FIELD *field,
cchar_t *buf)
{ /* void */ }
@@ -460,7 +460,7 @@ int _nc_Synchronize_Attributes(
#undef _nc_Synchronize_Options
int _nc_Synchronize_Options(
- FIELD *field,
+ FIELD *field,
Field_Options newopts)
{ return(*(int *)0); }
@@ -471,7 +471,7 @@ void _nc_Unset_Current_Field(
#undef _nc_Set_Current_Field
int _nc_Set_Current_Field(
- FORM *form,
+ FORM *form,
FIELD *newfield)
{ return(*(int *)0); }
@@ -487,47 +487,47 @@ FIELD *_nc_First_Active_Field(
#undef _nc_Set_Form_Page
int _nc_Set_Form_Page(
- FORM *form,
- int page,
+ FORM *form,
+ int page,
FIELD *field)
{ return(*(int *)0); }
typedef struct
{
- int keycode;
- int (*cmd) (FORM *);
+ int keycode;
+ int (*cmd) (FORM *);
}
Binding_Info;
#undef form_driver
int form_driver(
- FORM *form,
+ FORM *form,
int c)
{ return(*(int *)0); }
#undef form_driver_w
int form_driver_w(
- FORM *form,
- int type,
+ FORM *form,
+ int type,
wchar_t c)
{ return(*(int *)0); }
#undef set_field_buffer
int set_field_buffer(
- FIELD *field,
- int buffer,
+ FIELD *field,
+ int buffer,
const char *value)
{ return(*(int *)0); }
#undef field_buffer
char *field_buffer(
- const FIELD *field,
+ const FIELD *field,
int buffer)
{ return(*(char **)0); }
#undef _nc_Widen_String
wchar_t *_nc_Widen_String(
- char *source,
+ char *source,
int *lengthp)
{ return(*(wchar_t **)0); }
@@ -535,7 +535,7 @@ wchar_t *_nc_Widen_String(
#undef set_field_init
int set_field_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -546,7 +546,7 @@ Form_Hook field_init(
#undef set_field_term
int set_field_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -557,7 +557,7 @@ Form_Hook field_term(
#undef set_form_init
int set_form_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -568,7 +568,7 @@ Form_Hook form_init(
#undef set_form_term
int set_form_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -581,7 +581,7 @@ Form_Hook form_term(
#undef set_form_opts
int set_form_opts(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -592,13 +592,13 @@ Form_Options form_opts(
#undef form_opts_on
int form_opts_on(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
#undef form_opts_off
int form_opts_off(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -606,7 +606,7 @@ int form_opts_off(
#undef set_form_page
int set_form_page(
- FORM *form,
+ FORM *form,
int page)
{ return(*(int *)0); }
@@ -643,8 +643,8 @@ int form_request_by_name(
#undef scale_form
int scale_form(
- const FORM *form,
- int *rows,
+ const FORM *form,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -652,7 +652,7 @@ int scale_form(
#undef set_form_sub
int set_form_sub(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -665,7 +665,7 @@ WINDOW *form_sub(
#undef set_form_userptr
int set_form_userptr(
- FORM *form,
+ FORM *form,
void *usrptr)
{ return(*(int *)0); }
@@ -678,7 +678,7 @@ void *form_userptr(
#undef set_form_win
int set_form_win(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -748,38 +748,38 @@ FIELDTYPE *_nc_TYPE_ENUM(void)
#undef _nc_generic_fieldtype
FIELDTYPE *_nc_generic_fieldtype(
NCURSES_BOOL (*const field_check)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const char_check)(
- int p1,
- FORM *p2,
- FIELD *p3,
- const void *p4),
+ int p1,
+ FORM *p2,
+ FIELD *p3,
+ const void *p4),
NCURSES_BOOL (*const next)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const prev)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
void (*freecallback)(
void *p1))
{ return(*(FIELDTYPE **)0); }
#undef _nc_set_generic_fieldtype
int _nc_set_generic_fieldtype(
- FIELD *field,
- FIELDTYPE *ftyp,
+ FIELD *field,
+ FIELDTYPE *ftyp,
int (*argiterator)(
void **p1))
{ return(*(int *)0); }
#undef _nc_form_cursor
WINDOW *_nc_form_cursor(
- const FORM *form,
- int *pRow,
+ const FORM *form,
+ int *pRow,
int *pCol)
{ return(*(WINDOW **)0); }
diff --git a/form/llib-lformw b/form/llib-lformw
index de4900d..199e26c 100644
--- a/form/llib-lformw
+++ b/form/llib-lformw
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2002-2015,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -65,11 +65,11 @@ Form_Hook _nc_retrace_form_hook(
#undef set_fieldtype_arg
int set_fieldtype_arg(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
void *(*const make_arg)(
- va_list *p1),
+ va_list *p1),
void *(*const copy_arg)(
- const void *p1),
+ const void *p1),
void (*const free_arg)(
void *p1))
{ return(*(int *)0); }
@@ -83,7 +83,7 @@ void *field_arg(
#undef set_field_fore
int set_field_fore(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -94,7 +94,7 @@ chtype field_fore(
#undef set_field_back
int set_field_back(
- FIELD *field,
+ FIELD *field,
chtype attr)
{ return(*(int *)0); }
@@ -107,7 +107,7 @@ chtype field_back(
#undef set_current_field
int set_current_field(
- FORM *form,
+ FORM *form,
FIELD *field)
{ return(*(int *)0); }
@@ -133,27 +133,27 @@ FIELD *_nc_Default_Field;
#undef _nc_Make_Argument
TypeArgument *_nc_Make_Argument(
- const FIELDTYPE *typ,
- va_list *ap,
+ const FIELDTYPE *typ,
+ va_list *ap,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Copy_Argument
TypeArgument *_nc_Copy_Argument(
- const FIELDTYPE *typ,
- const TypeArgument *argp,
+ const FIELDTYPE *typ,
+ const TypeArgument *argp,
int *err)
{ return(*(TypeArgument **)0); }
#undef _nc_Free_Argument
void _nc_Free_Argument(
- const FIELDTYPE *typ,
+ const FIELDTYPE *typ,
TypeArgument *argp)
{ /* void */ }
#undef _nc_Copy_Type
NCURSES_BOOL _nc_Copy_Type(
- FIELD *dst,
+ FIELD *dst,
FIELD const *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -164,11 +164,11 @@ void _nc_Free_Type(
#undef new_field
FIELD *new_field(
- int rows,
- int cols,
- int frow,
- int fcol,
- int nrow,
+ int rows,
+ int cols,
+ int frow,
+ int fcol,
+ int nrow,
int nbuf)
{ return(*(FIELD **)0); }
@@ -181,8 +181,8 @@ int free_field(
#undef dup_field
FIELD *dup_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -190,12 +190,12 @@ FIELD *dup_field(
#undef set_fieldtype_choice
int set_fieldtype_choice(
- FIELDTYPE *typ,
+ FIELDTYPE *typ,
NCURSES_BOOL (*const next_choice)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const prev_choice)(
- FIELD *p1,
+ FIELD *p1,
const void *p2))
{ return(*(int *)0); }
@@ -203,7 +203,7 @@ int set_fieldtype_choice(
#undef link_fieldtype
FIELDTYPE *link_fieldtype(
- FIELDTYPE *type1,
+ FIELDTYPE *type1,
FIELDTYPE *type2)
{ return(*(FIELDTYPE **)0); }
@@ -211,20 +211,20 @@ FIELDTYPE *link_fieldtype(
#undef field_info
int field_info(
- const FIELD *field,
- int *rows,
- int *cols,
- int *frow,
- int *fcol,
- int *nrow,
+ const FIELD *field,
+ int *rows,
+ int *cols,
+ int *frow,
+ int *fcol,
+ int *nrow,
int *nbuf)
{ return(*(int *)0); }
#undef dynamic_field_info
int dynamic_field_info(
- const FIELD *field,
- int *drows,
- int *dcols,
+ const FIELD *field,
+ int *drows,
+ int *dcols,
int *maxgrow)
{ return(*(int *)0); }
@@ -232,7 +232,7 @@ int dynamic_field_info(
#undef set_field_just
int set_field_just(
- FIELD *field,
+ FIELD *field,
int just)
{ return(*(int *)0); }
@@ -245,8 +245,8 @@ int field_just(
#undef link_field
FIELD *link_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(FIELD **)0); }
@@ -254,7 +254,7 @@ FIELD *link_field(
#undef set_max_field
int set_max_field(
- FIELD *field,
+ FIELD *field,
int maxgrow)
{ return(*(int *)0); }
@@ -262,8 +262,8 @@ int set_max_field(
#undef move_field
int move_field(
- FIELD *field,
- int frow,
+ FIELD *field,
+ int frow,
int fcol)
{ return(*(int *)0); }
@@ -275,10 +275,10 @@ FIELDTYPE *_nc_Default_FieldType;
#undef new_fieldtype
FIELDTYPE *new_fieldtype(
NCURSES_BOOL (*const field_check)(
- FIELD *p1,
- const void *p2),
+ FIELD *p1,
+ const void *p2),
NCURSES_BOOL (*const char_check)(
- int p1,
+ int p1,
const void *p2))
{ return(*(FIELDTYPE **)0); }
@@ -291,7 +291,7 @@ int free_fieldtype(
#undef set_field_opts
int set_field_opts(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -302,13 +302,13 @@ Field_Options field_opts(
#undef field_opts_on
int field_opts_on(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
#undef field_opts_off
int field_opts_off(
- FIELD *field,
+ FIELD *field,
Field_Options opts)
{ return(*(int *)0); }
@@ -316,7 +316,7 @@ int field_opts_off(
#undef set_field_pad
int set_field_pad(
- FIELD *field,
+ FIELD *field,
int ch)
{ return(*(int *)0); }
@@ -329,7 +329,7 @@ int field_pad(
#undef set_new_page
int set_new_page(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL new_page_flag)
{ return(*(int *)0); }
@@ -342,7 +342,7 @@ NCURSES_BOOL new_page(
#undef set_field_status
int set_field_status(
- FIELD *field,
+ FIELD *field,
NCURSES_BOOL status)
{ return(*(int *)0); }
@@ -355,8 +355,8 @@ NCURSES_BOOL field_status(
#undef set_field_type
int set_field_type(
- FIELD *field,
- FIELDTYPE *type,
+ FIELD *field,
+ FIELDTYPE *type,
...)
{ return(*(int *)0); }
@@ -369,7 +369,7 @@ FIELDTYPE *field_type(
#undef set_field_userptr
int set_field_userptr(
- FIELD *field,
+ FIELD *field,
void *usrptr)
{ return(*(int *)0); }
@@ -404,7 +404,7 @@ FORM *_nc_Default_Form;
#undef new_form_sp
FORM *new_form_sp(
- SCREEN *sp,
+ SCREEN *sp,
FIELD **fields)
{ return(*(FORM **)0); }
@@ -420,7 +420,7 @@ int free_form(
#undef set_form_fields
int set_form_fields(
- FORM *form,
+ FORM *form,
FIELD **fields)
{ return(*(int *)0); }
@@ -438,8 +438,8 @@ int field_count(
#undef _nc_get_fieldbuffer
void _nc_get_fieldbuffer(
- FORM *form,
- FIELD *field,
+ FORM *form,
+ FIELD *field,
cchar_t *buf)
{ /* void */ }
@@ -460,7 +460,7 @@ int _nc_Synchronize_Attributes(
#undef _nc_Synchronize_Options
int _nc_Synchronize_Options(
- FIELD *field,
+ FIELD *field,
Field_Options newopts)
{ return(*(int *)0); }
@@ -471,7 +471,7 @@ void _nc_Unset_Current_Field(
#undef _nc_Set_Current_Field
int _nc_Set_Current_Field(
- FORM *form,
+ FORM *form,
FIELD *newfield)
{ return(*(int *)0); }
@@ -487,47 +487,47 @@ FIELD *_nc_First_Active_Field(
#undef _nc_Set_Form_Page
int _nc_Set_Form_Page(
- FORM *form,
- int page,
+ FORM *form,
+ int page,
FIELD *field)
{ return(*(int *)0); }
typedef struct
{
- int keycode;
- int (*cmd) (FORM *);
+ int keycode;
+ int (*cmd) (FORM *);
}
Binding_Info;
#undef form_driver
int form_driver(
- FORM *form,
+ FORM *form,
int c)
{ return(*(int *)0); }
#undef form_driver_w
int form_driver_w(
- FORM *form,
- int type,
+ FORM *form,
+ int type,
wchar_t c)
{ return(*(int *)0); }
#undef set_field_buffer
int set_field_buffer(
- FIELD *field,
- int buffer,
+ FIELD *field,
+ int buffer,
const char *value)
{ return(*(int *)0); }
#undef field_buffer
char *field_buffer(
- const FIELD *field,
+ const FIELD *field,
int buffer)
{ return(*(char **)0); }
#undef _nc_Widen_String
wchar_t *_nc_Widen_String(
- char *source,
+ char *source,
int *lengthp)
{ return(*(wchar_t **)0); }
@@ -535,7 +535,7 @@ wchar_t *_nc_Widen_String(
#undef set_field_init
int set_field_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -546,7 +546,7 @@ Form_Hook field_init(
#undef set_field_term
int set_field_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -557,7 +557,7 @@ Form_Hook field_term(
#undef set_form_init
int set_form_init(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -568,7 +568,7 @@ Form_Hook form_init(
#undef set_form_term
int set_form_term(
- FORM *form,
+ FORM *form,
Form_Hook func)
{ return(*(int *)0); }
@@ -581,7 +581,7 @@ Form_Hook form_term(
#undef set_form_opts
int set_form_opts(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -592,13 +592,13 @@ Form_Options form_opts(
#undef form_opts_on
int form_opts_on(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
#undef form_opts_off
int form_opts_off(
- FORM *form,
+ FORM *form,
Form_Options opts)
{ return(*(int *)0); }
@@ -606,7 +606,7 @@ int form_opts_off(
#undef set_form_page
int set_form_page(
- FORM *form,
+ FORM *form,
int page)
{ return(*(int *)0); }
@@ -643,8 +643,8 @@ int form_request_by_name(
#undef scale_form
int scale_form(
- const FORM *form,
- int *rows,
+ const FORM *form,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -652,7 +652,7 @@ int scale_form(
#undef set_form_sub
int set_form_sub(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -665,7 +665,7 @@ WINDOW *form_sub(
#undef set_form_userptr
int set_form_userptr(
- FORM *form,
+ FORM *form,
void *usrptr)
{ return(*(int *)0); }
@@ -678,7 +678,7 @@ void *form_userptr(
#undef set_form_win
int set_form_win(
- FORM *form,
+ FORM *form,
WINDOW *win)
{ return(*(int *)0); }
@@ -748,38 +748,38 @@ FIELDTYPE *_nc_TYPE_ENUM(void)
#undef _nc_generic_fieldtype
FIELDTYPE *_nc_generic_fieldtype(
NCURSES_BOOL (*const field_check)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const char_check)(
- int p1,
- FORM *p2,
- FIELD *p3,
- const void *p4),
+ int p1,
+ FORM *p2,
+ FIELD *p3,
+ const void *p4),
NCURSES_BOOL (*const next)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
NCURSES_BOOL (*const prev)(
- FORM *p1,
- FIELD *p2,
- const void *p3),
+ FORM *p1,
+ FIELD *p2,
+ const void *p3),
void (*freecallback)(
void *p1))
{ return(*(FIELDTYPE **)0); }
#undef _nc_set_generic_fieldtype
int _nc_set_generic_fieldtype(
- FIELD *field,
- FIELDTYPE *ftyp,
+ FIELD *field,
+ FIELDTYPE *ftyp,
int (*argiterator)(
void **p1))
{ return(*(int *)0); }
#undef _nc_form_cursor
WINDOW *_nc_form_cursor(
- const FORM *form,
- int *pRow,
+ const FORM *form,
+ int *pRow,
int *pCol)
{ return(*(WINDOW **)0); }