getsyntx() — Return LC_SYNTAX characters

Standards

Standards / Extensions C or C++ Dependencies
Language Environment both  

Format

#include <variant.h>

struct variant *getsyntx(void);

General description

Determines the encoding of the special characters defined in the LC_SYNTAX category of the current locale, and stores the encoding values in the structure of type variant. For details of the variant structure, see variant.h.

Returned value

Returns the pointer to the structure containing the values of the special characters.

If the information about the special characters is not available in the current locale, getsyntx() returns a NULL pointer.

The structure returned is not modified by the program that this function is used in. The structure may be invalidated by calls to the setlocale() function with LC_ALL, LC_CTYPE, LC_COLLATE, or LC_SYNTAX.

Example

CELEBG19
⁄* CELEBG19 *⁄                                   
#include <stdio.h>                                                              
#include <stdlib.h>                                                             
#include <variant.h>                                                            
#include <wchar.h>                                                              
                                                                                
int main(void)                                                                  
{                                                                               
   struct variant *var;                                                         
                                                                                
   var = getsyntx();                                                            
   printf("codeset         : %s\n",  var->codeset         );                    
   printf("backslash       : %3d\n", var->backslash       );                    
   printf("right_bracket   : %3d\n", var->right_bracket   );                    
   printf("left_bracket    : %3d\n", var->left_bracket    );                    
   printf("right_brace     : %3d\n", var->right_brace     );                    
   printf("left_brace      : %3d\n", var->left_brace      );                    
   printf("circumflex      : %3d\n", var->circumflex      );                    
   printf("tilde           : %3d\n", var->tilde           );                    
   printf("exclamation_mark: %3d\n", var->exclamation_mark);                    
   printf("number_sign     : %3d\n", var->number_sign     );                    
   printf("vertical_line   : %3d\n", var->vertical_line   );                    
   printf("dollar_sign     : %3d\n", var->dollar_sign     );                    
   printf("commercial_at   : %3d\n", var->commercial_at   );                    
   printf("grave_accent    : %3d\n", var->grave_accent    );                    
}                                                                               

Related information