ncurses 6.1 - patch 20190907
[ncurses.git] / form / frm_opts.c
index 009c189741ba0e3a0761d02088930ec30b0009d9..42d6267fba0b90a1a8ce777a9f5657c7c02c4063 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright (c) 1998-2012,2013 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@gmx.net> 1995,1997            *
+ *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_opts.c,v 1.8 1999/05/16 17:38:05 juergen Exp $")
+MODULE_ID("$Id: frm_opts.c,v 1.17 2013/08/24 22:58:47 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -44,14 +44,17 @@ MODULE_ID("$Id: frm_opts.c,v 1.8 1999/05/16 17:38:05 juergen Exp $")
 |   Return Values :  E_OK              - success
 |                    E_BAD_ARGUMENT    - invalid options
 +--------------------------------------------------------------------------*/
-int set_form_opts(FORM * form, Form_Options  opts)
+NCURSES_EXPORT(int)
+set_form_opts(FORM *form, Form_Options opts)
 {
-  opts &= ALL_FORM_OPTS;
-  if (opts & ~ALL_FORM_OPTS)
+  T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts));
+
+  opts &= (Form_Options) ALL_FORM_OPTS;
+  if ((unsigned)opts & ~ALL_FORM_OPTS)
     RETURN(E_BAD_ARGUMENT);
   else
     {
-      Normalize_Form( form )->opts = opts;
+      Normalize_Form(form)->opts = opts;
       RETURN(E_OK);
     }
 }
@@ -64,9 +67,11 @@ int set_form_opts(FORM * form, Form_Options  opts)
 |
 |   Return Values :  The option flags.
 +--------------------------------------------------------------------------*/
-Form_Options form_opts(const FORM * form)
+NCURSES_EXPORT(Form_Options)
+form_opts(const FORM *form)
 {
-  return (Normalize_Form(form)->opts & ALL_FORM_OPTS);
+  T((T_CALLED("form_opts(%p)"), (const void *)form));
+  returnCode((Form_Options) ((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS));
 }
 
 /*---------------------------------------------------------------------------
@@ -79,14 +84,17 @@ Form_Options form_opts(const FORM * form)
 |   Return Values :  E_OK            - success 
 |                    E_BAD_ARGUMENT  - invalid options
 +--------------------------------------------------------------------------*/
-int form_opts_on(FORM * form, Form_Options opts)
+NCURSES_EXPORT(int)
+form_opts_on(FORM *form, Form_Options opts)
 {
-  opts &= ALL_FORM_OPTS;
-  if (opts & ~ALL_FORM_OPTS)
+  T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts));
+
+  opts &= (Form_Options) ALL_FORM_OPTS;
+  if ((unsigned)opts & ~ALL_FORM_OPTS)
     RETURN(E_BAD_ARGUMENT);
   else
     {
-      Normalize_Form( form )->opts |= opts;    
+      Normalize_Form(form)->opts |= opts;
       RETURN(E_OK);
     }
 }
@@ -101,10 +109,13 @@ int form_opts_on(FORM * form, Form_Options opts)
 |   Return Values :  E_OK            - success 
 |                    E_BAD_ARGUMENT  - invalid options
 +--------------------------------------------------------------------------*/
-int form_opts_off(FORM * form, Form_Options opts)
+NCURSES_EXPORT(int)
+form_opts_off(FORM *form, Form_Options opts)
 {
-  opts &= ALL_FORM_OPTS;
-  if (opts & ~ALL_FORM_OPTS)
+  T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts));
+
+  opts &= (Form_Options) ALL_FORM_OPTS;
+  if ((unsigned)opts & ~ALL_FORM_OPTS)
     RETURN(E_BAD_ARGUMENT);
   else
     {