]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/fld_pad.c
ncurses 6.4 - patch 20240414
[ncurses.git] / form / fld_pad.c
index 7346973c5a5ea8c635997acf7a14f6c8b4a25ee6..fdd803fee07eb5e533f97b56bfe09fdffbec819c 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
+ * Copyright 2020,2021 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            *
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_pad.c,v 1.7 2003/10/25 15:17:08 tom Exp $")
+MODULE_ID("$Id: fld_pad.c,v 1.14 2021/06/17 21:20:30 tom Exp $")
 
 /*---------------------------------------------------------------------------
-|   Facility      :  libnform  
+|   Facility      :  libnform
 |   Function      :  int set_field_pad(FIELD *field, int ch)
-|   
+|
 |   Description   :  Set the pad character used to fill the field. This must
 |                    be a printable character.
 |
@@ -45,18 +46,20 @@ MODULE_ID("$Id: fld_pad.c,v 1.7 2003/10/25 15:17:08 tom Exp $")
 |                    E_BAD_ARGUMENT - invalid field pointer or pad character
 |                    E_SYSTEM_ERROR - system error
 +--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_field_pad (FIELD  * field, int ch)
+FORM_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;
@@ -65,17 +68,19 @@ set_field_pad (FIELD  * field, int ch)
 }
 
 /*---------------------------------------------------------------------------
-|   Facility      :  libnform  
+|   Facility      :  libnform
 |   Function      :  int field_pad(const FIELD *field)
-|   
-|   Description   :  Retrieve the fields pad character.
+|
+|   Description   :  Retrieve the field's pad character.
 |
 |   Return Values :  The pad character.
 +--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-field_pad (const FIELD * field)
+FORM_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 */