]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/fld_type.c
ncurses 6.0 - patch 20171216
[ncurses.git] / form / fld_type.c
index aa889ea047323338aa6ac59d320186b7c0f36482..0b35b7eb9e5641f8e60f57dbabf55c57b735a7d0 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,2010 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            *
  *                                                                          *
  * 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"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_type.c,v 1.12 2003/10/25 15:17:08 tom Exp $")
+MODULE_ID("$Id: fld_type.c,v 1.16 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -46,30 +46,32 @@ MODULE_ID("$Id: fld_type.c,v 1.12 2003/10/25 15:17:08 tom Exp $")
 |                    E_SYSTEM_ERROR - system error
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(int)
 |                    E_SYSTEM_ERROR - system error
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(int)
-set_field_type (FIELD *field,FIELDTYPE *type, ...)
+set_field_type(FIELD *field, FIELDTYPE *type,...)
 {
   va_list ap;
   int res = E_SYSTEM_ERROR;
   int err = 0;
 
 {
   va_list ap;
   int res = E_SYSTEM_ERROR;
   int err = 0;
 
-  va_start(ap,type);
+  T((T_CALLED("set_field_type(%p,%p)"), (void *)field, (void *)type));
+
+  va_start(ap, type);
 
   Normalize_Field(field);
   _nc_Free_Type(field);
 
   field->type = type;
 
   Normalize_Field(field);
   _nc_Free_Type(field);
 
   field->type = type;
-  field->arg  = (void *)_nc_Make_Argument(field->type,&ap,&err);
+  field->arg = (void *)_nc_Make_Argument(field->type, &ap, &err);
 
   if (err)
     {
 
   if (err)
     {
-      _nc_Free_Argument(field->type,(TypeArgument *)(field->arg));
+      _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
       field->type = (FIELDTYPE *)0;
       field->type = (FIELDTYPE *)0;
-      field->arg  = (void *)0;
+      field->arg = (void *)0;
     }
   else
     {
       res = E_OK;
     }
   else
     {
       res = E_OK;
-      if (field->type) 
+      if (field->type)
        field->type->ref++;
     }
 
        field->type->ref++;
     }
 
@@ -86,9 +88,10 @@ set_field_type (FIELD *field,FIELDTYPE *type, ...)
 |   Return Values :  Pointer to fieldtype of NULL if none is defined.
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(FIELDTYPE *)
 |   Return Values :  Pointer to fieldtype of NULL if none is defined.
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(FIELDTYPE *)
-field_type (const FIELD * field)
+field_type(const FIELD *field)
 {
 {
-  return Normalize_Field(field)->type;
+  T((T_CALLED("field_type(%p)"), (const void *)field));
+  returnFieldType(Normalize_Field(field)->type);
 }
 
 /* fld_type.c ends here */
 }
 
 /* fld_type.c ends here */