xref: /openbsd-src/lib/libform/frm_user.c (revision a4afd6dad3fba28f80e70208181c06c482259988)
1 
2 /***************************************************************************
3 *                            COPYRIGHT NOTICE                              *
4 ****************************************************************************
5 *                ncurses is copyright (C) 1992-1995                        *
6 *                          Zeyd M. Ben-Halim                               *
7 *                          zmbenhal@netcom.com                             *
8 *                          Eric S. Raymond                                 *
9 *                          esr@snark.thyrsus.com                           *
10 *                                                                          *
11 *        Permission is hereby granted to reproduce and distribute ncurses  *
12 *        by any means and for any fee, whether alone or as part of a       *
13 *        larger distribution, in source or in binary form, PROVIDED        *
14 *        this notice is included with any such distribution, and is not    *
15 *        removed from any of its header files. Mention of ncurses in any   *
16 *        applications linked with it is highly appreciated.                *
17 *                                                                          *
18 *        ncurses comes AS IS with no warranty, implied or expressed.       *
19 *                                                                          *
20 ***************************************************************************/
21 
22 #include "form.priv.h"
23 
24 /*---------------------------------------------------------------------------
25 |   Facility      :  libnform
26 |   Function      :  int set_form_userptr(FORM *form, void *usrptr)
27 |
28 |   Description   :  Set the pointer that is reserved in any form to store
29 |                    application relevant informations
30 |
31 |   Return Values :  E_OK         - on success
32 +--------------------------------------------------------------------------*/
33 int set_form_userptr(FORM * form, void *usrptr)
34 {
35   Normalize_Form(form)->usrptr = usrptr;
36   RETURN(E_OK);
37 }
38 
39 /*---------------------------------------------------------------------------
40 |   Facility      :  libnform
41 |   Function      :  void *form_userptr(const FORM *form)
42 |
43 |   Description   :  Return the pointer that is reserved in any form to
44 |                    store application relevant informations.
45 |
46 |   Return Values :  Value of pointer. If no such pointer has been set,
47 |                    NULL is returned
48 +--------------------------------------------------------------------------*/
49 void *form_userptr(const FORM * form)
50 {
51   return Normalize_Form(form)->usrptr;
52 }
53 
54 /* frm_user.c ends here */
55