]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/fld_just.c
ncurses 6.2 - patch 20210227
[ncurses.git] / form / fld_just.c
index 31bf0fd00e8dbafe5eea69820db57f36fbcfa2e7..050e66f5d311823240ef4dbbd6b640e7a8907235 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-2010,2012 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, 1995,1997                                    *
- *   Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en             *
  ****************************************************************************/
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_just.c,v 1.7 2002/07/06 15:33:27 juergen Exp $")
+MODULE_ID("$Id: fld_just.c,v 1.16 2020/12/11 23:16:37 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 |   Function      :  int set_field_just(FIELD *field, int just)
 |   
-|   Description   :  Set the fields type of justification.
+|   Description   :  Set the field's type of justification.
 |
 |   Return Values :  E_OK            - success
 |                    E_BAD_ARGUMENT  - one of the arguments was incorrect
 |                    E_SYSTEM_ERROR  - system error
 +--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_field_just (FIELD * field, int just)
+FORM_EXPORT(int)
+set_field_just(FIELD *field, int just)
 {
   int res = E_BAD_ARGUMENT;
 
-  if ((just==NO_JUSTIFICATION)  ||
-      (just==JUSTIFY_LEFT)     ||
-      (just==JUSTIFY_CENTER)   ||
-      (just==JUSTIFY_RIGHT)    )
+  T((T_CALLED("set_field_just(%p,%d)"), (void *)field, just));
+
+  if ((just == NO_JUSTIFICATION) ||
+      (just == JUSTIFY_LEFT) ||
+      (just == JUSTIFY_CENTER) ||
+      (just == JUSTIFY_RIGHT))
     {
-      Normalize_Field( field );
+      Normalize_Field(field);
       if (field->just != just)
        {
-         field->just = just;
-         res = _nc_Synchronize_Attributes( field );
+         field->just = (short)just;
+         res = _nc_Synchronize_Attributes(field);
        }
       else
        res = E_OK;
@@ -71,14 +73,15 @@ set_field_just (FIELD * field, int just)
 |   Facility      :  libnform  
 |   Function      :  int field_just( const FIELD *field )
 |   
-|   Description   :  Retrieve the fields type of justification
+|   Description   :  Retrieve the field's type of justification
 |
 |   Return Values :  The justification type.
 +--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-field_just (const FIELD * field)
+FORM_EXPORT(int)
+field_just(const FIELD *field)
 {
-  return Normalize_Field( field )->just;
+  T((T_CALLED("field_just(%p)"), (const void *)field));
+  returnCode(Normalize_Field(field)->just);
 }
 
 /* fld_just.c ends here */