All pastes #496639 Raw Edit

hisham

public c v1 · immutable
·published 2007-05-19 11:01 UTC
rendered paste body
#include <stdio.h>#include <string.h>#include <Etk.h>typedef struct _Evolve_Widget_Packing_Info Evolve_Widget_Packing_Info;typedef struct _Evolve_Widget_Packing_Option Evolve_Widget_Packing_Option;typedef struct _Evolve_Widget_Packing_Option_Tuple Evolve_Widget_Packing_Option_Tuple;struct _Evolve_Widget_Packing_Info{   char *widget_type;   Evolve_Widget_Packing_Option *options;};struct _Evolve_Widget_Packing_Option{   char *name;   Evolve_Widget_Packing_Option_Tuple *values;};struct _Evolve_Widget_Packing_Option_Tuple{   char *str;   char *num;};static Evolve_Widget_Packing_Info _evolve_packing_options[] = {   /* box begin */     {        "box",        {           {              "fill_policy",              {                   { "__default__", ETK_BOX_EXPAND_FILL },                   { "none", ETK_BOX_NONE },                   { "fill", ETK_BOX_FILL },                   { "expand", ETK_BOX_EXPAND },                   { "expand_fill", ETK_BOX_EXPAND_FILL },                   { "shrink_opposite", ETK_BOX_SHRINK_OPPOSITE },                   { NULL, 0 }              }           },           {              "group",              {                   { "start", ETK_BOX_START },                   { "end", ETK_BOX_END },                   { NULL, 0 }              }           },           {              NULL,              NULL           },        }     },   /* box end */   /* table begin */     {        "table",        NULL     },    {        NULL,        NULL     }   /* table end */};#endifint main(){   Evolve_Widget_Packing_Info *po;   for (po = &_evolve_packing_options; po->widget_type; po++)     {        Evolve_Widget_Packing_Option *p;        printf("widget type: %s\n", po->widget_type);        for (p = &po->options; p && p->name; p++)          {             Evolve_Widget_Packing_Option_Tuple *t;             printf("  option name: %s\n", p->name);             for (t = &p->values; t && t->str; t++)               {                  printf("    str: %s, value: %s\n", t->str, t->num);               }          }     }             return 0;}