EZ_RegisterApplicationResources man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

EZ_RegisterApplicationResources(EZWGL FunctiEZ_RegisterApplicationResources(3)

NAME
       EZ_RegisterApplicationResources	 -  register  a	 list  of  application
       resources

SYNOPSIS
       #include <EZ.h>

       void EZ_RegisterApplicationResources( int nresources, EZ_ResourceSpec resources,
	    int (configure)(void*notUsed,intoption,EZ_Value*values))

       typedef struct {
	 int	 option;    /* reference index, must > 1024 */
	 char	 *iname;    /* resource name  */
	 char	 *cname;    /* resource class */
	 char	 *vtypes;   /* value types, e.g "int,float,string" */
       } EZ_ResourceSpec;

       typedef struct {
	 int  type;
	 union {
	   char	   c;	 unsigned char	uc;
	   short   s;	 unsigned short us;
	   int	   i;	 unsigned int	ui;
	   float   f;
	   void	   *p;
	   void	   *function;
	   char	   *str;
	   unsigned long l;
	 } value;
       } EZ_Value;

ARGUMENTS
       resources  Specifies a list of resources.

       nresources  Specifies the number of resources.

       configure  Specifies a procedure that sets the  values  of  application
       variable from resources.

DESCRIPTION
       EZ_RegisterApplicationResources	 registers   a	 list  of  application
       resources. Its purpose is to set application variables from  resources.
       See  the	 example below for its usage. Only global variables can be set
       via resources.

An Example
       #include "EZ.h";
       static int   int1 = 0,	int2 = 0; /* var set by resources */
       static float float2 = 0;

       static  EZ_ResourceSpec exampleResources[] =
       {
	  { 1234, "aPairOfInt",	 "APairOfInt", "int,int"   },
	  { 1235, "intFloat",	 "IntFloat",   "int,float" },
       };

       int configure(EZ_Widget *notused, int option, EZ_Value *values)
       {
	 switch(option)
	  {
	    case 1:  int1 = values[0].value.i; int2 = values[1].value.i; break;
	    case 2:  int1 = values[0].value.i; float2 = values[1].value.f; break;
	    default:  break;
	  }
       }

       main(int ac, char **av)
       {
	 EZ_Initialize(ac, av, 1);
	 EZ_RegisterApplicationResources(2, exampleResources, configure);
	 printf("int1=%d, int2=%d, float2=%f0, int1, int2, float2);
	 /* more stuff ... */
       }

SEE ALSO
       EZ_RegisterResourcesWidget(3)

EZWGL					    EZ_RegisterApplicationResources(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net