X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=form%2Ffld_arg.c;h=001c1d157a003a5773499b3a0e0f9abf802245f6;hp=bc816e9efd0f241c96098511b521d7798aa5f5ca;hb=67ab4b308e932639a3a832052228d445c41c54b4;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce;ds=inline diff --git a/form/fld_arg.c b/form/fld_arg.c index bc816e9e..001c1d15 100644 --- a/form/fld_arg.c +++ b/form/fld_arg.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2012 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,21 +27,21 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_arg.c,v 1.4 1999/05/16 17:16:04 juergen Exp $") +MODULE_ID("$Id: fld_arg.c,v 1.13 2012/06/10 00:27:49 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_fieldtype_arg( | FIELDTYPE *typ, | void * (* const make_arg)(va_list *), | void * (* const copy_arg)(const void *), | void (* const free_arg)(void *) ) -| +| | Description : Connects to the type additional arguments necessary | for a set_field_type call. The various function pointer | arguments are: @@ -60,32 +60,39 @@ MODULE_ID("$Id: fld_arg.c,v 1.4 1999/05/16 17:16:04 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid argument +--------------------------------------------------------------------------*/ -int set_fieldtype_arg(FIELDTYPE * typ, - void * (* const make_arg)(va_list *), - void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)) +NCURSES_EXPORT(int) +set_fieldtype_arg(FIELDTYPE *typ, + void *(*const make_arg)(va_list *), + void *(*const copy_arg)(const void *), + void (*const free_arg) (void *)) { - if ( !typ || !make_arg ) - RETURN(E_BAD_ARGUMENT); + T((T_CALLED("set_fieldtype_arg(%p,%p,%p,%p)"), + (void *)typ, make_arg, copy_arg, free_arg)); - typ->status |= _HAS_ARGS; - typ->makearg = make_arg; - typ->copyarg = copy_arg; - typ->freearg = free_arg; - RETURN(E_OK); + if (typ != 0 && make_arg != (void *)0) + { + SetStatus(typ, _HAS_ARGS); + typ->makearg = make_arg; + typ->copyarg = copy_arg; + typ->freearg = free_arg; + RETURN(E_OK); + } + RETURN(E_BAD_ARGUMENT); } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : void *field_arg(const FIELD *field) -| +| | Description : Retrieve pointer to the fields argument structure. | | Return Values : Pointer to structure or NULL if none is defined. +--------------------------------------------------------------------------*/ -void *field_arg(const FIELD * field) +NCURSES_EXPORT(void *) +field_arg(const FIELD *field) { - return Normalize_Field(field)->arg; + T((T_CALLED("field_arg(%p)"), (const void *)field)); + returnVoidPtr(Normalize_Field(field)->arg); } /* fld_arg.c ends here */