diff options
Diffstat (limited to 'form')
39 files changed, 701 insertions, 652 deletions
diff --git a/form/Makefile.in b/form/Makefile.in index 3d713469fe0c..a950a3e8ae14 100644 --- a/form/Makefile.in +++ b/form/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.71 2021/01/23 20:42:08 tom Exp $ +# $Id: Makefile.in,v 1.72 2021/07/03 15:45:33 tom Exp $ ############################################################################## # Copyright 2020,2021 Thomas E. Dickey # # Copyright 1998-2015,2018 Free Software Foundation, Inc. # @@ -134,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) diff --git a/form/READ.ME b/form/READ.ME index 0cefd57d1965..7c6ad972e576 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/fld_def.c b/form/fld_def.c index de664eb5f803..51bdc6485800 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.43 2020/05/24 01:40:20 anonymous.maarten 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 = @@ -86,14 +86,13 @@ 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) { @@ -134,14 +133,13 @@ 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) { diff --git a/form/fld_ftchoice.c b/form/fld_ftchoice.c index 265f94f869c3..dfaca149c087 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.17 2020/05/24 01:40:20 anonymous.maarten 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 *), diff --git a/form/fld_ftlink.c b/form/fld_ftlink.c index 3d8af84de999..ed16920078bb 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,17 +33,17 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_ftlink.c,v 1.17 2020/05/24 01:40:20 anonymous.maarten 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) | diff --git a/form/fld_info.c b/form/fld_info.c index 188a31563ef2..bc8399dca743 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,15 +33,15 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_info.c,v 1.15 2020/12/12 01:05:42 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 information about the field's creation parameters. | | Return Values : E_OK - success @@ -78,11 +78,11 @@ 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 information about a dynamic field's current | dynamic parameters. | diff --git a/form/fld_just.c b/form/fld_just.c index 050e66f5d311..62253bcf77b6 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_just.c,v 1.16 2020/12/11 23:16:37 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 field's type of justification. | | Return Values : E_OK - success @@ -70,9 +70,9 @@ set_field_just(FIELD *field, int just) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_just( const FIELD *field ) -| +| | Description : Retrieve the field's type of justification | | Return Values : The justification type. diff --git a/form/fld_link.c b/form/fld_link.c index dda6c97ee6d1..c0604584179f 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,17 +33,17 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_link.c,v 1.16 2020/12/11 23:20:32 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 | diff --git a/form/fld_max.c b/form/fld_max.c index bfeadf9b7fa8..325541a373b5 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_max.c,v 1.17 2020/05/24 01:40:20 anonymous.maarten 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. | diff --git a/form/fld_move.c b/form/fld_move.c index c4b8313639d5..0d9ac4aebc9c 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_move.c,v 1.15 2020/12/11 23:48:05 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 form's subwindow. | diff --git a/form/fld_opts.c b/form/fld_opts.c index a0bbbf41cc5d..ab4d55943a07 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.15 2020/12/11 22:05:24 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. | @@ -65,9 +65,9 @@ set_field_opts(FIELD *field, Field_Options opts) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : Field_Options field_opts(const FIELD *field) -| +| | Description : Retrieve the field's options. | | Return Values : The options. @@ -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 @@ -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 diff --git a/form/fld_pad.c b/form/fld_pad.c index 962958f501b6..fdd803fee07e 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.13 2020/12/11 22:05:24 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. | @@ -68,9 +68,9 @@ set_field_pad(FIELD *field, int ch) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int field_pad(const FIELD *field) -| +| | Description : Retrieve the field's pad character. | | Return Values : The pad character. diff --git a/form/fld_page.c b/form/fld_page.c index 9029768ce2ba..6972d310396d 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,13 +33,13 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_page.c,v 1.15 2020/12/11 23:15:26 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 @@ -63,9 +63,9 @@ set_new_page(FIELD *field, bool new_page_flag) } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : bool new_page(const FIELD *field) -| +| | Description : Retrieve the information whether or not the field starts | a new page on the form. | diff --git a/form/fld_stat.c b/form/fld_stat.c index 7b504bf449fe..62d782edd89d 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_stat.c,v 1.17 2020/12/11 22:05:24 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 | field's primary buffer. | @@ -60,11 +60,11 @@ 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 field's primary buffer. +| for that field's primary buffer. | | Return Values : TRUE - buffer has been changed | FALSE - buffer has not been changed diff --git a/form/fld_type.c b/form/fld_type.c index 12c92cf6e268..c557e053c00c 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.19 2020/12/11 23:20:37 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 ! @@ -81,9 +81,9 @@ 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. diff --git a/form/fld_user.c b/form/fld_user.c index 2f51fa67e3dc..1b13e626506b 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_user.c,v 1.19 2020/12/12 01:05: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 information. | @@ -54,9 +54,9 @@ 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 information. | diff --git a/form/form.h b/form/form.h index 59a97a3d0691..3b62e3901b8e 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.31 2020/07/04 20:38:43 tom Exp $ */ +/* $Id: form.h,v 0.32 2021/06/17 21:26:02 tom Exp $ */ #ifndef FORM_H #define FORM_H @@ -116,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. diff --git a/form/form.priv.h b/form/form.priv.h index 048d9f84592e..ad5af63ad807 100644 --- a/form/form.priv.h +++ b/form/form.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2021,2024 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.47 2020/12/11 23:20:11 tom Exp $ */ +/* $Id: form.priv.h,v 0.49 2024/02/24 12:17:31 tom Exp $ */ #ifndef FORM_PRIV_H #define FORM_PRIV_H 1 @@ -47,10 +47,6 @@ #include <wctype.h> #endif -#ifndef MB_LEN_MAX -#define MB_LEN_MAX 8 /* should be >= MB_CUR_MAX, but that may be a function */ -#endif - #define FIELD_CELL NCURSES_CH_T #define NCURSES_FIELD_INTERNALS char** expanded; WINDOW *working; @@ -202,12 +198,12 @@ 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 *, +_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*), diff --git a/form/frm_cursor.c b/form/frm_cursor.c index daa6c5b7775a..a54b4837a7de 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.12 2020/05/24 01:40:20 anonymous.maarten 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 diff --git a/form/frm_data.c b/form/frm_data.c index 0856afb845e2..940c32db99c6 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_data.c,v 1.19 2020/12/11 23:20:37 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. | @@ -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. | @@ -123,11 +123,11 @@ 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 @@ -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 89ae4ec39c54..a9f21f28a944 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.29 2020/12/11 23:47:16 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 = @@ -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,6 +198,9 @@ 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; else diff --git a/form/frm_driver.c b/form/frm_driver.c index ad82643ed2f7..75656d69ea2a 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.133 2020/12/12 00:36:42 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 @@ -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); @@ -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) @@ -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; @@ -1276,7 +1280,6 @@ _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, @@ -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); } /*--------------------------------------------------------------------------- @@ -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, -| it's more difficult to define what 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 @@ -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) { @@ -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) { diff --git a/form/frm_opts.c b/form/frm_opts.c index cab044598042..62e2bebdc431 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_opts.c,v 1.20 2020/12/12 00:37:00 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. | @@ -61,9 +61,9 @@ 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. @@ -76,13 +76,13 @@ form_opts(const FORM *form) } /*--------------------------------------------------------------------------- -| 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 +--------------------------------------------------------------------------*/ FORM_EXPORT(int) @@ -101,13 +101,13 @@ 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 +--------------------------------------------------------------------------*/ FORM_EXPORT(int) diff --git a/form/frm_page.c b/form/frm_page.c index a4030a2b5f62..ee8dd3837f6b 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.14 2020/05/24 01:40:20 anonymous.maarten 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 @@ -88,9 +88,9 @@ 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 diff --git a/form/frm_req_name.c b/form/frm_req_name.c index 27d4696619f4..8b76a8e4f542 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.21 2020/05/24 01:40:20 anonymous.maarten Exp $") +MODULE_ID("$Id: frm_req_name.c,v 1.23 2021/06/17 21:11:08 tom Exp $") #define DATA(s) { s } @@ -112,9 +112,9 @@ 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 @@ -135,9 +135,9 @@ 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 @@ -150,12 +150,13 @@ form_request_by_name(const char *str) 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 833f74eb97e8..d53798e1bcee 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_scale.c,v 1.12 2020/05/24 01:40:20 anonymous.maarten 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 diff --git a/form/frm_sub.c b/form/frm_sub.c index f718ea4679a6..8f1de099cdf6 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,13 +33,13 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_sub.c,v 1.14 2020/05/24 01:40:20 anonymous.maarten 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 @@ -66,9 +66,9 @@ 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. diff --git a/form/frm_user.c b/form/frm_user.c index e4f86bb6ead0..a4a2249780ad 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,12 +33,12 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_user.c,v 1.18 2020/12/12 01:05:20 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 information. | @@ -54,9 +54,9 @@ 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 information. | diff --git a/form/frm_win.c b/form/frm_win.c index 5f3bc3c658f7..eeea27d37366 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,13 +33,13 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_win.c,v 1.18 2020/05/24 01:40:20 anonymous.maarten 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 @@ -66,9 +66,9 @@ 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. diff --git a/form/fty_enum.c b/form/fty_enum.c index 62242b56b42f..16ffae11036f 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.31 2020/12/12 01:15:37 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 @@ -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 diff --git a/form/fty_generic.c b/form/fty_generic.c index 3672d658cb31..301c80a1f07a 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,7 +35,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_generic.c,v 1.14 2020/12/12 17:27:44 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 @@ -282,7 +282,7 @@ _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 d06ab8b6f389..c7e3135c882b 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.31 2020/12/12 01:15:37 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 @@ -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. +--------------------------------------------------------------------------*/ @@ -136,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 : - @@ -151,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 @@ -170,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) { @@ -183,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) { @@ -227,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) @@ -235,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); @@ -245,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 diff --git a/form/fty_ipv4.c b/form/fty_ipv4.c index d79683de68d3..108f7b4bb177 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.14 2020/12/12 01:15:37 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 diff --git a/form/fty_num.c b/form/fty_num.c index 9eafaecb726c..34cef6364bdb 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.36 2020/12/12 01:15:37 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> @@ -188,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) { @@ -202,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) { @@ -265,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) @@ -273,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); diff --git a/form/fty_regex.c b/form/fty_regex.c index 616b383ad49e..62dcab58c352 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.32 2020/12/12 01:15:37 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_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 diff --git a/form/llib-lform b/form/llib-lform index b7f2acb05332..334f8cb1c819 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 6460016175f1..d91b3f079eb0 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 a24dd1a484d8..340bf59cba53 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 de4900dcff83..199e26c34655 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); } |
