aboutsummaryrefslogtreecommitdiff
path: root/form/frm_def.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-02-28 19:12:44 +0000
committerXin LI <delphij@FreeBSD.org>2014-02-28 19:12:44 +0000
commit4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a (patch)
treeb8f6e12b479a78216f3bffb8e1258d54087268de /form/frm_def.c
parente07762606a5bf651a501cb095c98cba90e4a8fe2 (diff)
downloadsrc-4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a.tar.gz
src-4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a.zip
Undo two previous imports which was never done in preparation of doing a
new import.
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=262616
Diffstat (limited to 'form/frm_def.c')
-rw-r--r--form/frm_def.c67
1 files changed, 18 insertions, 49 deletions
diff --git a/form/frm_def.c b/form/frm_def.c
index 86500f239863..e6897514ffdd 100644
--- a/form/frm_def.c
+++ b/form/frm_def.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 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 +32,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_def.c,v 1.25 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.23 2008/08/04 00:07:55 tom Exp $")
/* this can't be readonly */
static FORM default_form =
@@ -160,7 +160,7 @@ Connect_Fields(FORM *form, FIELD **fields)
int maximum_row_in_field, maximum_col_in_field;
_PAGE *pg;
- T((T_CALLED("Connect_Fields(%p,%p)"), (void *)form, (void *)fields));
+ T((T_CALLED("Connect_Fields(%p,%p)"), form, fields));
assert(form);
@@ -188,7 +188,7 @@ Connect_Fields(FORM *form, FIELD **fields)
/* allocate page structures */
if ((pg = typeMalloc(_PAGE, page_nr)) != (_PAGE *) 0)
{
- T((T_CREATE("_PAGE %p"), (void *)pg));
+ T((T_CREATE("_PAGE %p"), pg));
form->page = pg;
}
else
@@ -283,7 +283,7 @@ Associate_Fields(FORM *form, FIELD **fields)
/*---------------------------------------------------------------------------
| Facility : libnform
-| Function : FORM *new_form_sp(SCREEN* sp, FIELD** fields )
+| Function : FORM *new_form( FIELD **fields )
|
| Description : Create new form with given array of fields.
|
@@ -295,31 +295,21 @@ Associate_Fields(FORM *form, FIELD **fields)
| E_SYSTEM_ERROR - not enough memory
+--------------------------------------------------------------------------*/
NCURSES_EXPORT(FORM *)
-NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
+new_form(FIELD **fields)
{
int err = E_SYSTEM_ERROR;
- FORM *form = (FORM *)0;
- T((T_CALLED("new_form(%p,%p)"), (void *)SP_PARM, (void *)fields));
+ FORM *form = typeMalloc(FORM, 1);
- if (IsValidScreen(SP_PARM))
+ T((T_CALLED("new_form(%p)"), fields));
+ if (form)
{
- form = typeMalloc(FORM, 1);
-
- if (form)
+ T((T_CREATE("form %p"), form));
+ *form = *_nc_Default_Form;
+ if ((err = Associate_Fields(form, fields)) != E_OK)
{
- T((T_CREATE("form %p"), (void *)form));
- *form = *_nc_Default_Form;
- /* This ensures win and sub are always non-null,
- so we can derive always the SCREEN that this form is
- running on. */
- form->win = StdScreen(SP_PARM);
- form->sub = StdScreen(SP_PARM);
- if ((err = Associate_Fields(form, fields)) != E_OK)
- {
- free_form(form);
- form = (FORM *)0;
- }
+ free_form(form);
+ form = (FORM *)0;
}
}
@@ -331,27 +321,6 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
/*---------------------------------------------------------------------------
| Facility : libnform
-| Function : FORM* new_form(FIELD** fields )
-|
-| Description : Create new form with given array of fields.
-|
-| Return Values : Pointer to form. NULL if error occurred.
-! Set errno:
-| E_OK - success
-| E_BAD_ARGUMENT - Invalid form pointer or field array
-| E_CONNECTED - a field is already connected
-| E_SYSTEM_ERROR - not enough memory
-+--------------------------------------------------------------------------*/
-#if NCURSES_SP_FUNCS
-NCURSES_EXPORT(FORM *)
-new_form(FIELD **fields)
-{
- return NCURSES_SP_NAME(new_form) (CURRENT_SCREEN, fields);
-}
-#endif
-
-/*---------------------------------------------------------------------------
-| Facility : libnform
| Function : int free_form( FORM *form )
|
| Description : Release internal memory associated with form.
@@ -363,7 +332,7 @@ new_form(FIELD **fields)
NCURSES_EXPORT(int)
free_form(FORM *form)
{
- T((T_CALLED("free_form(%p)"), (void *)form));
+ T((T_CALLED("free_form(%p)"), form));
if (!form)
RETURN(E_BAD_ARGUMENT);
@@ -397,7 +366,7 @@ set_form_fields(FORM *form, FIELD **fields)
FIELD **old;
int res;
- T((T_CALLED("set_form_fields(%p,%p)"), (void *)form, (void *)fields));
+ T((T_CALLED("set_form_fields(%p,%p)"), form, fields));
if (!form)
RETURN(E_BAD_ARGUMENT);
@@ -425,7 +394,7 @@ set_form_fields(FORM *form, FIELD **fields)
NCURSES_EXPORT(FIELD **)
form_fields(const FORM *form)
{
- T((T_CALLED("form_field(%p)"), (const void *)form));
+ T((T_CALLED("form_field(%p)"), form));
returnFieldPtr(Normalize_Form(form)->field);
}
@@ -440,7 +409,7 @@ form_fields(const FORM *form)
NCURSES_EXPORT(int)
field_count(const FORM *form)
{
- T((T_CALLED("field_count(%p)"), (const void *)form));
+ T((T_CALLED("field_count(%p)"), form));
returnCode(Normalize_Form(form)->maxfield);
}