ncurses 6.2 - patch 20200509
[ncurses.git] / form / fld_pad.c
index c7ac9086084d6958e088f9e2ff908187ed7752de..b6d59e2c1cdc76e9a971f8f7a363709e938dba40 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 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            *
  ****************************************************************************/
 
 /****************************************************************************
- *   Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1995,1997        *
+ *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
+
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_pad.c,v 1.2 1998/02/11 12:13:44 tom Exp $")
+MODULE_ID("$Id: fld_pad.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -44,17 +46,20 @@ MODULE_ID("$Id: fld_pad.c,v 1.2 1998/02/11 12:13:44 tom Exp $")
 |                    E_BAD_ARGUMENT - invalid field pointer or pad character
 |                    E_SYSTEM_ERROR - system error
 +--------------------------------------------------------------------------*/
-int set_field_pad(FIELD  * field, int ch)
+NCURSES_EXPORT(int)
+set_field_pad(FIELD *field, int ch)
 {
   int res = E_BAD_ARGUMENT;
 
-  Normalize_Field( field );
-  if (isprint((unsigned char)ch))
+  T((T_CALLED("set_field_pad(%p,%d)"), (void *)field, ch));
+
+  Normalize_Field(field);
+  if (isprint(UChar(ch)))
     {
       if (field->pad != ch)
        {
          field->pad = ch;
-         res = _nc_Synchronize_Attributes( field );
+         res = _nc_Synchronize_Attributes(field);
        }
       else
        res = E_OK;
@@ -70,9 +75,12 @@ int set_field_pad(FIELD  * field, int ch)
 |
 |   Return Values :  The pad character.
 +--------------------------------------------------------------------------*/
-int field_pad(const FIELD * field)
+NCURSES_EXPORT(int)
+field_pad(const FIELD *field)
 {
-  return Normalize_Field( field )->pad;
+  T((T_CALLED("field_pad(%p)"), (const void *)field));
+
+  returnCode(Normalize_Field(field)->pad);
 }
 
 /* fld_pad.c ends here */