1236769Sobrien/****************************************************************************
2236769Sobrien * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
3236769Sobrien *                                                                          *
4236769Sobrien * Permission is hereby granted, free of charge, to any person obtaining a  *
5236769Sobrien * copy of this software and associated documentation files (the            *
6236769Sobrien * "Software"), to deal in the Software without restriction, including      *
7236769Sobrien * without limitation the rights to use, copy, modify, merge, publish,      *
8236769Sobrien * distribute, distribute with modifications, sublicense, and/or sell       *
9236769Sobrien * copies of the Software, and to permit persons to whom the Software is    *
10236769Sobrien * furnished to do so, subject to the following conditions:                 *
11236769Sobrien *                                                                          *
12236769Sobrien * The above copyright notice and this permission notice shall be included  *
13236769Sobrien * in all copies or substantial portions of the Software.                   *
14236769Sobrien *                                                                          *
15236769Sobrien * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16236769Sobrien * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17236769Sobrien * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18236769Sobrien * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19236769Sobrien * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20236769Sobrien * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21236769Sobrien * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22236769Sobrien *                                                                          *
23236769Sobrien * Except as contained in this notice, the name(s) of the above copyright   *
24236769Sobrien * holders shall not be used in advertising or otherwise to promote the     *
25236769Sobrien * sale, use or other dealings in this Software without prior written       *
26236769Sobrien * authorization.                                                           *
27236769Sobrien ****************************************************************************/
28236769Sobrien
29236769Sobrien/****************************************************************************
30236769Sobrien *   Author:  Juergen Pfeifer, 1995,1997                                    *
31236769Sobrien ****************************************************************************/
32236769Sobrien
33236769Sobrien#include "form.priv.h"
34236769Sobrien
35236769SobrienMODULE_ID("$Id: fld_user.c,v 1.15 2004/12/25 22:24:50 tom Exp $")
36236769Sobrien
37236769Sobrien/*---------------------------------------------------------------------------
38236769Sobrien|   Facility      :  libnform
39236769Sobrien|   Function      :  int set_field_userptr(FIELD *field, void *usrptr)
40236769Sobrien|
41236769Sobrien|   Description   :  Set the pointer that is reserved in any field to store
42236769Sobrien|                    application relevant informations
43236769Sobrien|
44236769Sobrien|   Return Values :  E_OK         - on success
45236769Sobrien+--------------------------------------------------------------------------*/
46236769SobrienNCURSES_EXPORT(int)
47236769Sobrienset_field_userptr(FIELD *field, void *usrptr)
48236769Sobrien{
49236769Sobrien  T((T_CALLED("set_field_userptr(%p,%p)"), field, usrptr));
50236769Sobrien
51236769Sobrien  Normalize_Field(field)->usrptr = usrptr;
52236769Sobrien  RETURN(E_OK);
53236769Sobrien}
54236769Sobrien
55236769Sobrien/*---------------------------------------------------------------------------
56236769Sobrien|   Facility      :  libnform
57236769Sobrien|   Function      :  void *field_userptr(const FIELD *field)
58236769Sobrien|
59236769Sobrien|   Description   :  Return the pointer that is reserved in any field to
60236769Sobrien|                    store application relevant informations.
61236769Sobrien|
62236769Sobrien|   Return Values :  Value of pointer. If no such pointer has been set,
63236769Sobrien|                    NULL is returned
64236769Sobrien+--------------------------------------------------------------------------*/
65236769SobrienNCURSES_EXPORT(void *)
66236769Sobrienfield_userptr(const FIELD *field)
67236769Sobrien{
68236769Sobrien  T((T_CALLED("field_userptr(%p)"), field));
69236769Sobrien  returnVoidPtr(Normalize_Field(field)->usrptr);
70236769Sobrien}
71236769Sobrien
72236769Sobrien/* fld_user.c ends here */
73236769Sobrien