X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=form%2Ffld_newftyp.c;h=59cd1a6f7b2e41d1a09300bf8471f98d3c771b66;hb=refs%2Ftags%2Fv5.4;hp=12487c90372232fda721064615e16b14f9ea6c68;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1;p=ncurses.git diff --git a/form/fld_newftyp.c b/form/fld_newftyp.c index 12487c90..59cd1a6f 100644 --- a/form/fld_newftyp.c +++ b/form/fld_newftyp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2002,2003 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 * @@ -27,12 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_newftyp.c,v 1.2 1998/02/11 12:13:44 tom Exp $") +MODULE_ID("$Id: fld_newftyp.c,v 1.9 2003/11/08 20:45:36 tom Exp $") static FIELDTYPE const default_fieldtype = { 0, /* status */ @@ -48,7 +48,7 @@ static FIELDTYPE const default_fieldtype = { NULL /* enumerate previous function */ }; -const FIELDTYPE* _nc_Default_FieldType = &default_fieldtype; +NCURSES_EXPORT_VAR(const FIELDTYPE*) _nc_Default_FieldType = &default_fieldtype; /*--------------------------------------------------------------------------- | Facility : libnform @@ -63,15 +63,16 @@ const FIELDTYPE* _nc_Default_FieldType = &default_fieldtype; | E_BAD_ARGUMENT - invalid arguments | E_SYSTEM_ERROR - system error (no memory) | -| Return Values : Fieldtype pointer or NULL if error occured +| Return Values : Fieldtype pointer or NULL if error occurred +--------------------------------------------------------------------------*/ -FIELDTYPE *new_fieldtype( +NCURSES_EXPORT(FIELDTYPE *) +new_fieldtype ( bool (* const field_check)(FIELD *,const void *), bool (* const char_check) (int,const void *) ) { FIELDTYPE *nftyp = (FIELDTYPE *)0; - if ( (field_check) && (char_check) ) + if ( (field_check) || (char_check) ) { nftyp = (FIELDTYPE *)malloc(sizeof(FIELDTYPE)); if (nftyp) @@ -102,7 +103,8 @@ FIELDTYPE *new_fieldtype( | E_CONNECTED - there are fields referencing the type | E_BAD_ARGUMENT - invalid fieldtype pointer +--------------------------------------------------------------------------*/ -int free_fieldtype(FIELDTYPE *typ) +NCURSES_EXPORT(int) +free_fieldtype (FIELDTYPE *typ) { if (!typ) RETURN(E_BAD_ARGUMENT);