X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=form%2Ffld_def.c;h=de664eb5f8035460faf298f0268400c2b63f2624;hp=681a3713e8c7a07e92160e14e274a00ae1ec9ef5;hb=HEAD;hpb=ba39fbc2e0cee4681395df4079d9e61c27262132 diff --git a/form/fld_def.c b/form/fld_def.c index 681a3713..51bdc648 100644 --- a/form/fld_def.c +++ b/form/fld_def.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * 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 * * copy of this software and associated documentation files (the * @@ -32,7 +33,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_def.c,v 1.40 2012/03/11 00:37:16 tom Exp $") +MODULE_ID("$Id: fld_def.c,v 1.44 2021/03/27 23:49:53 tom Exp $") /* this can't be readonly */ static FIELD default_field = @@ -53,7 +54,7 @@ static FIELD default_field = (int)' ', /* pad */ A_NORMAL, /* fore */ A_NORMAL, /* back */ - ALL_FIELD_OPTS, /* opts */ + STD_FIELD_OPTS, /* opts */ (FIELD *)0, /* snext */ (FIELD *)0, /* sprev */ (FIELD *)0, /* link */ @@ -65,7 +66,7 @@ static FIELD default_field = NCURSES_FIELD_EXTENSION }; -NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; +FORM_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; /*--------------------------------------------------------------------------- | Facility : libnform @@ -81,18 +82,17 @@ NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; | Return Values : Pointer to argument structure. Maybe NULL. | In case of an error in *err an error counter is increased. +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(TypeArgument *) +FORM_EXPORT(TypeArgument *) _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) { TypeArgument *res = (TypeArgument *)0; - TypeArgument *p; if (typ != 0 && (typ->status & _HAS_ARGS) != 0) { assert(err != 0 && ap != (va_list *)0); if ((typ->status & _LINKED_TYPE) != 0) { - p = typeMalloc(TypeArgument, 1); + TypeArgument *p = typeMalloc(TypeArgument, 1); if (p != 0) { @@ -129,18 +129,17 @@ _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) | Return Values : Pointer to argument structure. Maybe NULL. | In case of an error in *err an error counter is increased. +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(TypeArgument *) +FORM_EXPORT(TypeArgument *) _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) { TypeArgument *res = (TypeArgument *)0; - TypeArgument *p; if (typ != 0 && (typ->status & _HAS_ARGS) != 0) { assert(err != 0 && argp != 0); if ((typ->status & _LINKED_TYPE) != 0) { - p = typeMalloc(TypeArgument, 1); + TypeArgument *p = typeMalloc(TypeArgument, 1); if (p != 0) { @@ -178,7 +177,7 @@ _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) | | Return Values : - +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(void) +FORM_EXPORT(void) _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) { if (typ != 0 && (typ->status & _HAS_ARGS) != 0) @@ -211,7 +210,7 @@ _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) | Return Values : TRUE - copy worked | FALSE - error occurred +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(bool) +FORM_EXPORT(bool) _nc_Copy_Type(FIELD *dst, FIELD const *src) { int err = 0; @@ -246,7 +245,7 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src) | | Return Values : - +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(void) +FORM_EXPORT(void) _nc_Free_Type(FIELD *field) { assert(field != 0); @@ -273,7 +272,7 @@ _nc_Free_Type(FIELD *field) | | Return Values : Pointer to the new field or NULL if failure. +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(FIELD *) +FORM_EXPORT(FIELD *) new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) { static const FIELD_CELL blank = BLANK; @@ -294,14 +293,14 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) { T((T_CREATE("field %p"), (void *)New_Field)); *New_Field = default_field; - New_Field->rows = (short) rows; - New_Field->cols = (short) cols; + New_Field->rows = (short)rows; + New_Field->cols = (short)cols; New_Field->drows = rows + nrow; New_Field->dcols = cols; - New_Field->frow = (short) frow; - New_Field->fcol = (short) fcol; + New_Field->frow = (short)frow; + New_Field->fcol = (short)fcol; New_Field->nrow = nrow; - New_Field->nbuf = (short) nbuf; + New_Field->nbuf = (short)nbuf; New_Field->link = New_Field; #if USE_WIDEC_SUPPORT @@ -353,7 +352,7 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) | E_BAD_ARGUMENT - invalid field pointer | E_CONNECTED - field is connected +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(int) +FORM_EXPORT(int) free_field(FIELD *field) { T((T_CALLED("free_field(%p)"), (void *)field));