Community articleUFLIsSigned function
Added by IBM contributorIBM on August 16, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.



Description

This function determines whether a node is signed.

Function

   r_error UFLIsSigned(
      formNodeP theFormNode, 
      r_boolean excludeSelf, 
      r_boolean *theStatus
   );


Parameters

Table 1. Function parameters
ExpressionTypeDescription
theFormNode formNodePAny form node.
excludeSelfr_booleanA signature node is always self-signed. To determine whether a second signature has been applied to that node, you must exclude the self-signing from this check.
To exclude the self-signing from the signature check, set this to OK. To include the self-signing, set this to NOTOK.
theStatus r_boolean*A pointer that will contain the node's status. OK indicates that it is signed, NOTOK indicates that it is not signed.


Returns

OK on success or an error code on failure.

Example

The following function locates the value node for a Date field, checks to see if it is signed, and sets the value if the node is not signed.
   r_error setDateValue(r_charP date, formNodeP theForm);
   {
   formNodeP tempNode;
   r_boolean theStatus;
 
      /* Locate the value option for the Date field */
 
      if ((tempNode = UFLDereferenceEx(theForm, NULL,
         "PAGE1.Date.value", 0, UFL_OPTION_REFERENCE, NULL))
         == NULL)
      {
         fprintf(stderr, "Could not locate value node for Date.\n");
         return(NOTOK);
      }
 
      /* Check the value node to see if it is signed. */
 
      if (UFLIsSigned(tempNode, NOTOK, &theStatus) != OK)
      {
         fprintf(stderr, 
            "Could not determine whether Date's value is signed.\n");
         return(NOTOK);
      }
   
      /* If the value node is signed, return an error. Otherwise, set it to
         the value passed into the function. */
 
      if (theStatus == OK)
      {
         fprintf(stderr, "Date's value is signed.\n");
         return(NOTOK);
      }
      else
      {
         if (UFLSetLiteralEx(tempNode, NULL, date) != OK)
         {
            fprintf(stderr, "Could not set literal for Date.\n");
            return(NOTOK);
         }
      }
      return(OK);
   }


Parent topic:
FormNodeP functions