46 #ifdef HAVE_SYS_TYPES_H
47 #include <sys/types.h>
50 #ifdef HAVE_SYS_STAT_H
65 #include "lrealpath.h"
88 #define GERBV_PROJECT_FILE_VERSION "2.0A"
93 #define GERBV_DEFAULT_PROJECT_FILE_VERSION "1.9A"
99 static const char * known_versions[] = {
106 #define dprintf if(DEBUG) printf
108 static project_list_t *project_list_top = NULL;
110 static const int alpha_def_value = 177*257;
116 static int current_file_version = 0;
124 version_str_to_int(
const char * str)
127 gchar *dup, *tmps, *ptr;
132 dprintf(
"%s(\"%s\")\n", __FUNCTION__, str);
139 tmps = g_strdup(str);
141 while(*ptr !=
'\0' && *ptr !=
'.') { ptr++; }
148 r = 10000 * atoi(tmps);
149 dprintf(
"%s(): Converted \"%s\" to r = %d\n", __FUNCTION__, tmps, r);
161 while(*ptr !=
'\0' && *ptr !=
'.') { ptr++; }
169 while(*ptr !=
'\0' && isdigit( (
int) *ptr)) { ptr++; }
176 r += 100 * atoi(tmps);
177 dprintf(
"%s(): Converted \"%s\" to r = %d\n", __FUNCTION__, tmps, r);
190 while(*ptr !=
'\0' && (isdigit( (
int) *ptr) || *ptr ==
'.') ) { ptr++; }
197 dprintf(
"%s(): Processing \"%s\"\n", __FUNCTION__, tmps);
199 if( strlen(tmps) == 1) {
200 r += *tmps -
'A' + 1;
201 dprintf(
"%s(): Converted \"%s\" to r = %d\n", __FUNCTION__, tmps, r);
202 }
else if( strlen(tmps) == 2 ) {
206 r += *tmps -
'A' + 1;
228 version_int_to_str(
int ver )
230 int major, minor, teeny;
239 minor = (ver - 10000*major) / 100;
240 teeny = (ver - 10000*major - 100*minor);
241 if(teeny >= 1 && teeny <= 26) {
242 l[0] =
'A' + teeny - 1;
243 }
else if(teeny > 26 && teeny <= 52) {
245 l[1] =
'A' + teeny - 26 - 1;
248 str = g_strdup_printf(
"%d.%d%s", major, minor, l);
253 check_vector_and_length(scheme *sc, pointer value,
254 unsigned int length,
const char *item)
256 if (!sc->vptr->is_vector(value)) {
257 GERB_MESSAGE(_(
"'%s' parameter not a vector"), item);
262 if (sc->vptr->vector_length(value) != length) {
263 GERB_MESSAGE(_(
"'%s' vector of incorrect length"), item);
272 get_color(scheme *sc, pointer value,
int *color)
277 if (check_vector_and_length(sc, value, 3,
"color"))
280 for (i = 0; i < 3; i++) {
281 elem = sc->vptr->vector_elem(value, i);
282 if (sc->vptr->is_integer(elem) && sc->vptr->is_number(elem))
283 color[i] = sc->vptr->ivalue(elem);
286 GERB_MESSAGE(_(
"Illegal color in projectfile"));
294 get_alpha(scheme *sc, pointer value,
int *alpha)
298 if (check_vector_and_length(sc, value, 1,
"alpha"))
301 elem = sc->vptr->vector_elem(value, 0);
302 if (sc->vptr->is_integer(elem) && sc->vptr->is_number(elem)) {
303 *alpha = sc->vptr->ivalue(elem);
307 GERB_MESSAGE(_(
"Illegal alpha value in projectfile"));
311 get_double(scheme *sc, pointer value,
char *item,
double *x,
double def)
315 if (check_vector_and_length(sc, value, 1, item))
318 elem = sc->vptr->vector_elem(value, 0);
319 if (sc->vptr->is_real(elem) && sc->vptr->is_number(elem)) {
320 *x = sc->vptr->rvalue(elem);
323 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
328 get_double_pair(scheme *sc, pointer value,
char *item,
329 double *x,
double *y,
double def)
333 if (check_vector_and_length(sc, value, 2, item))
336 elem = sc->vptr->vector_elem(value, 0);
337 if (sc->vptr->is_real(elem) && sc->vptr->is_number(elem)) {
338 *x = sc->vptr->rvalue(elem);
341 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
344 elem = sc->vptr->vector_elem(value, 1);
345 if (sc->vptr->is_real(elem) && sc->vptr->is_number(elem)) {
346 *y = sc->vptr->rvalue(elem);
349 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
354 get_bool_pair(scheme *sc, pointer value,
char *item,
355 char *x,
char *y,
char def)
359 if (check_vector_and_length(sc, value, 2, item))
362 elem = sc->vptr->vector_elem(value, 0);
365 }
else if (elem == sc->T) {
369 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
372 elem = sc->vptr->vector_elem(value, 1);
375 }
else if (elem == sc->T) {
379 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
388 static char *bindir = NULL;
389 static char *exec_prefix = NULL;
390 static char *pkgdatadir = NULL;
391 static gchar *scmdatadir = NULL;
403 if (bindir != NULL) {
408 if (exec_prefix != NULL) {
413 if (pkgdatadir != NULL) {
418 if (scmdatadir != NULL) {
428 init_paths (
char *argv0)
434 int found_bindir = 0;
448 for (i = 0; i < strlen (argv0) ; i++)
450 if (argv0[i] == GERBV_DIR_SEPARATOR_C)
454 dprintf(
"%s (%s): haspath = %d\n", __FUNCTION__, argv0, haspath);
457 bindir = strdup (lrealpath (argv0));
462 char *path, *p, *tmps;
466 tmps = getenv (
"PATH");
470 path = strdup (tmps);
473 for (p = strtok (path, GERBV_PATH_DELIMETER); p && *p;
474 p = strtok (NULL, GERBV_PATH_DELIMETER))
476 dprintf (
"Looking for %s in %s\n", argv0, p);
477 if ( (tmps = malloc ( (strlen (argv0) + strlen (p) + 2) *
sizeof (
char))) == NULL )
479 fprintf (stderr, _(
"%s(): malloc failed\n"), __FUNCTION__);
482 sprintf (tmps,
"%s%s%s", p, GERBV_DIR_SEPARATOR_S, argv0);
483 r = stat (tmps, &sb);
486 dprintf (
"Found it: \"%s\"\n", tmps);
487 bindir = lrealpath (tmps);
497 dprintf (
"%s(): bindir = \"%s\"\n", __FUNCTION__, bindir);
504 t1 = strchr (bindir, GERBV_DIR_SEPARATOR_C);
505 while (t1 != NULL && *t1 !=
'\0')
508 t1 = strchr (t2 + 1, GERBV_DIR_SEPARATOR_C);
512 dprintf (
"After stripping off the executible name, we found\n");
513 dprintf (
"bindir = \"%s\"\n", bindir);
521 bindir = strdup (BINDIR);
525 l = strlen (bindir) + 1 + strlen (BINDIR_TO_EXECPREFIX) + 1;
526 if ( (exec_prefix = (
char *) malloc (l *
sizeof (
char) )) == NULL )
528 fprintf (stderr, _(
"%s(): malloc failed\n"), __FUNCTION__);
531 sprintf (exec_prefix,
"%s%s%s", bindir, GERBV_DIR_SEPARATOR_S,
532 BINDIR_TO_EXECPREFIX);
535 l = strlen (bindir) + 1 + strlen (BINDIR_TO_PKGDATADIR) + 1;
536 if ( (pkgdatadir = (
char *) malloc (l *
sizeof (
char) )) == NULL )
538 fprintf (stderr, _(
"%s(): malloc failed\n"), __FUNCTION__);
541 sprintf (pkgdatadir,
"%s%s%s", bindir, GERBV_DIR_SEPARATOR_S,
542 BINDIR_TO_PKGDATADIR);
544 scmdatadir = g_strdup_printf (
"%s%s%s", pkgdatadir, GERBV_DIR_SEPARATOR_S, SCMSUBDIR);
546 dprintf (
"%s(): bindir = %s\n", __FUNCTION__, bindir);
547 dprintf (
"%s(): exec_prefix = %s\n", __FUNCTION__, exec_prefix);
548 dprintf (
"%s(): pkgdatadir = %s\n", __FUNCTION__, pkgdatadir);
549 dprintf (
"%s(): scmdatadir = %s\n", __FUNCTION__, scmdatadir);
555 get_value_string(scheme *sc, pointer value)
557 if (!sc->vptr->is_string(value))
560 return sc->vptr->string_value(value);
569 #if defined (__MINGW32__)
575 while ((hit_in_path = strchr(path,
'\\'))) {
580 while ((hit_in_path = strchr(path,
'/'))) {
592 define_layer(scheme *sc, pointer args)
594 pointer car_el, cdr_el, name, value;
595 project_list_t *plist;
599 dprintf(
"--> entering %s: %s\n", __FILE__, __func__);
601 if (!sc->vptr->is_pair(args)) {
602 GERB_MESSAGE(_(
"%s(): too few arguments"), __func__);
607 car_el = sc->vptr->pair_car(args);
608 cdr_el = sc->vptr->pair_cdr(args);
610 if (!sc->vptr->is_integer(car_el) || !sc->vptr->is_number(car_el)) {
611 GERB_MESSAGE(_(
"%s(): layer number missing/incorrect"), __func__);
616 layerno = sc->vptr->ivalue(car_el);
617 dprintf(
" layerno = %d\n", layerno);
619 car_el = sc->vptr->pair_car(cdr_el);
620 cdr_el = sc->vptr->pair_cdr(cdr_el);
622 plist = (project_list_t *)g_malloc(
sizeof(project_list_t));
623 memset(plist, 0,
sizeof(project_list_t));
624 plist->next = project_list_top;
625 project_list_top = plist;
626 plist->layerno = layerno;
629 plist->attr_list = NULL;
630 plist->translate_x = plist->translate_y = 0.0;
631 plist->scale_x = plist->scale_y = 1.0;
632 plist->mirror_x = plist->mirror_y = 0;
635 plist->alpha = alpha_def_value;
637 while (sc->vptr->is_pair(car_el)) {
639 name = sc->vptr->pair_car(car_el);
640 value = sc->vptr->pair_cdr(car_el);
642 if (!sc->vptr->is_symbol(name)) {
643 GERB_MESSAGE(_(
"%s(): non-symbol found, ignoring"), __func__);
644 goto end_name_value_parse;
647 str = sc->vptr->symname(name);
648 if (strcmp(str,
"color") == 0) {
649 get_color(sc, value, plist->rgb);
650 }
else if (strcmp(str,
"alpha") == 0) {
651 get_alpha(sc, value, &plist->alpha);
652 }
else if (strcmp(str,
"translate") == 0) {
653 get_double_pair(sc, value,
"translate",
654 &plist->translate_x, &plist->translate_y, 0.0);
655 }
else if (strcmp(str,
"rotation") == 0) {
656 get_double(sc, value,
"rotation", &plist->rotation, 0.0);
657 }
else if (strcmp(str,
"scale") == 0) {
658 get_double_pair(sc, value,
"scale",
659 &plist->scale_x, &plist->scale_y, 1.0);
660 }
else if (strcmp(str,
"mirror") == 0) {
661 get_bool_pair(sc, value,
"mirror",
662 &plist->mirror_x, &plist->mirror_y, 0);
663 }
else if (strcmp(str,
"filename") == 0) {
664 plist->filename = g_strdup(get_value_string(sc, value));
668 }
else if (strcmp(str,
"pick_and_place") == 0) {
669 plist->filename = g_strdup(get_value_string(sc, value));
673 }
else if (strcmp(str,
"inverted") == 0) {
674 if (value == sc->F) {
676 }
else if (value == sc->T) {
679 GERB_MESSAGE(_(
"Argument to inverted must be #t or #f"));
681 }
else if (strcmp(str,
"visible") == 0) {
682 if (value == sc->F) {
684 }
else if (value == sc->T) {
687 GERB_MESSAGE(_(
"Argument to visible must be #t or #f"));
689 }
else if (strcmp(str,
"attribs") == 0) {
690 pointer attr_car_el, attr_cdr_el;
691 pointer attr_name, attr_type, attr_value;
694 dprintf (
"Parsing file attributes\n");
696 attr_car_el = sc->vptr->pair_car (value);
697 attr_cdr_el = sc->vptr->pair_cdr (value);
698 while (sc->vptr->is_pair(attr_car_el)) {
699 int p = plist->n_attr;
701 plist->attr_list = (gerbv_HID_Attribute *)
702 realloc (plist->attr_list,
703 plist->n_attr * sizeof (gerbv_HID_Attribute));
704 if (plist->attr_list == NULL ) {
705 fprintf (stderr, _(
"%s(): realloc failed\n"), __FUNCTION__);
710 attr_name = sc->vptr->pair_car(attr_car_el);
713 attr_type = sc->vptr->pair_cdr (attr_car_el);
714 attr_type = sc->vptr->pair_car (attr_type);
717 attr_value = sc->vptr->pair_cdr (attr_car_el);
718 attr_value = sc->vptr->pair_cdr (attr_value);
719 attr_value = sc->vptr->pair_car (attr_value);
721 dprintf (
" attribute %s, type is %s, value is ",
722 sc->vptr->symname(attr_name),
723 sc->vptr->symname(attr_type));
725 plist->attr_list[p].name = strdup (sc->vptr->symname (attr_name));
727 type = sc->vptr->symname (attr_type);
729 if (strcmp (type,
"label") == 0) {
730 dprintf (
"%s", sc->vptr->string_value (attr_value));
731 plist->attr_list[p].type = HID_Label;
732 plist->attr_list[p].default_val.str_value =
733 strdup (sc->vptr->string_value (attr_value));
735 }
else if (strcmp (type,
"integer") == 0) {
736 dprintf (
"%ld", sc->vptr->ivalue (attr_value));
737 plist->attr_list[p].type = HID_Integer;
738 plist->attr_list[p].default_val.int_value =
739 sc->vptr->ivalue (attr_value);
741 }
else if (strcmp (type,
"real") == 0) {
742 dprintf (
"%g", sc->vptr->rvalue (attr_value));
743 plist->attr_list[p].type = HID_Real;
744 plist->attr_list[p].default_val.real_value =
745 sc->vptr->rvalue (attr_value);
747 }
else if (strcmp (type,
"string") == 0) {
748 dprintf (
"%s", sc->vptr->string_value (attr_value));
749 plist->attr_list[p].type = HID_String;
750 plist->attr_list[p].default_val.str_value =
751 strdup (sc->vptr->string_value (attr_value));
753 }
else if (strcmp (type,
"boolean") == 0) {
754 dprintf (
"%ld", sc->vptr->ivalue (attr_value));
755 plist->attr_list[p].type = HID_Boolean;
756 plist->attr_list[p].default_val.int_value =
757 sc->vptr->ivalue (attr_value);
759 }
else if (strcmp (type,
"enum") == 0) {
760 dprintf (
"%ld", sc->vptr->ivalue (attr_value));
761 plist->attr_list[p].type = HID_Enum;
762 plist->attr_list[p].default_val.int_value =
763 sc->vptr->ivalue (attr_value);
765 }
else if (strcmp (type,
"mixed") == 0) {
766 plist->attr_list[p].type = HID_Mixed;
767 plist->attr_list[p].default_val.str_value = NULL;
768 fprintf (stderr, _(
"%s(): WARNING: HID_Mixed is not yet supported\n"),
771 }
else if (strcmp (type,
"path") == 0) {
772 dprintf (
"%s", sc->vptr->string_value (attr_value));
773 plist->attr_list[p].type = HID_Path;
774 plist->attr_list[p].default_val.str_value =
775 strdup (sc->vptr->string_value (attr_value));
777 fprintf (stderr, _(
"%s(): Unknown attribute type: \"%s\"\n"),
782 attr_car_el = sc->vptr->pair_car(attr_cdr_el);
783 attr_cdr_el = sc->vptr->pair_cdr(attr_cdr_el);
787 end_name_value_parse:
788 car_el = sc->vptr->pair_car(cdr_el);
789 cdr_el = sc->vptr->pair_cdr(cdr_el);
796 set_render_type(scheme *sc, pointer args)
801 dprintf(
"--> entering project.c:%s()\n", __FUNCTION__);
803 if (!sc->vptr->is_pair(args)){
804 GERB_MESSAGE(_(
"set-render-type!: Too few arguments"));
808 car_el = sc->vptr->pair_car(args);
810 r = sc->vptr->ivalue (car_el);
811 dprintf (
"%s(): Setting render type to %d\n", __FUNCTION__, r);
812 interface_set_render_type (r);
818 gerbv_file_version(scheme *sc, pointer args)
825 dprintf(
"--> entering project.c:%s()\n", __FUNCTION__);
827 if (!sc->vptr->is_pair(args)){
828 GERB_MESSAGE(_(
"gerbv-file-version!: Too few arguments"));
832 car_el = sc->vptr->pair_car(args);
833 vstr = get_value_string(sc, car_el);
836 r = version_str_to_int( vstr );
839 r = version_str_to_int( GERBV_DEFAULT_PROJECT_FILE_VERSION );
840 GERB_MESSAGE(_(
"The project file you are attempting to load has specified that it\n"
841 "uses project file version \"%s\" but this string is not\n"
842 "a valid version. Gerbv will attempt to load the file using\n"
843 "version \"%s\". You may experience unexpected results."),
844 vstr, version_int_to_str( r ));
845 vstr = GERBV_DEFAULT_PROJECT_FILE_VERSION;
848 tmps = version_int_to_str( r );
849 printf (_(
"%s(): Read a project file version of %s (%d)\n"), __FUNCTION__, vstr, r);
850 printf (_(
" Translated back to \"%s\"\n"), tmps);
854 dprintf (
"%s(): Read a project file version of %s (%d)\n", __FUNCTION__, vstr, r);
856 if ( r > version_str_to_int( GERBV_PROJECT_FILE_VERSION )) {
858 GERB_MESSAGE(_(
"The project file you are attempting to load is version \"%s\"\n"
859 "but this copy of gerbv is only capable of loading project files\n"
860 "using version \"%s\" or older. You may experience unexpected results."),
861 vstr, GERBV_PROJECT_FILE_VERSION);
866 while( known_versions[i] != NULL ) {
867 if( strcmp( known_versions[i], vstr) == 0 ) {
877 GERB_MESSAGE(_(
"The project file you are attempting to load is version \"%s\"\n"
878 "which is an unknown version.\n"
879 "You may experience unexpected results."),
890 current_file_version = r;
908 struct stat stat_info;
918 char *initdirs[] = {
"$GERBV_SCHEMEINIT",
"", BACKEND_DIR,
928 initdirs[1] = scmdatadir;
935 while(initdirs[i] != NULL) {
936 printf(
"%s(): initdirs[%d] = \"%s\"\n", __FUNCTION__, i, initdirs[i]);
947 current_file_version =
948 version_str_to_int(GERBV_DEFAULT_PROJECT_FILE_VERSION);
950 if (stat(filename, &stat_info) || !S_ISREG(stat_info.st_mode)) {
951 GERB_MESSAGE(_(
"Failed to read %s"), filename);
956 sc = scheme_init_new();
957 scheme_set_output_port_file(sc, stdout);
960 GERB_FATAL_ERROR(_(
"Couldn't init scheme"));
965 initfile = gerb_find_file(
"init.scm", initdirs);
966 if (initfile == NULL) {
968 GERB_MESSAGE(_(
"Problem loading init.scm (%s)"), strerror(errno));
971 dprintf(
"%s(): initfile = \"%s\"\n", __FUNCTION__, initfile);
973 if ((fd = fopen(initfile,
"r")) == NULL) {
975 GERB_MESSAGE(_(
"Couldn't open %s (%s)"), initfile, strerror(errno));
980 setlocale(LC_NUMERIC,
"C");
982 sc->vptr->load_file(sc, fd);
985 sc->vptr->scheme_define(sc, sc->global_env,
986 sc->vptr->mk_symbol(sc,
"define-layer!"),
987 sc->vptr->mk_foreign_func(sc, define_layer));
989 sc->vptr->scheme_define(sc, sc->global_env,
990 sc->vptr->mk_symbol(sc,
"set-render-type!"),
991 sc->vptr->mk_foreign_func(sc, set_render_type));
993 sc->vptr->scheme_define(sc, sc->global_env,
994 sc->vptr->mk_symbol(sc,
"gerbv-file-version!"),
995 sc->vptr->mk_foreign_func(sc, gerbv_file_version));
997 if ((fd = fopen(filename,
"r")) == NULL) {
998 setlocale(LC_NUMERIC,
"");
1000 GERB_MESSAGE(_(
"Couldn't open project file %s (%s)"), filename,
1006 project_list_top = NULL;
1008 scheme_load_file(sc, fd);
1011 setlocale(LC_NUMERIC,
"");
1014 return project_list_top;
1019 project_destroy_project_list (project_list_t *projectList){
1020 project_list_t *tempP,*tempP2;
1022 for (tempP = projectList; tempP != NULL; ){
1023 tempP2 = tempP->next;
1025 g_free (tempP->filename);
1026 gerbv_attribute_destroy_HID_attribute (tempP->attr_list, tempP->n_attr);
1027 tempP->attr_list = NULL;
1037 write_project_file(
gerbv_project_t *gerbvProject,
char const* filename, project_list_t *project)
1040 project_list_t *p = project;
1042 gerbv_HID_Attribute *attr_list = NULL;
1043 const float min_val = 0.000001;
1046 if ((fd = fopen(filename,
"w")) == NULL) {
1047 GERB_MESSAGE(_(
"Couldn't save project %s"), filename);
1052 setlocale(LC_NUMERIC,
"C");
1054 fprintf(fd,
"(gerbv-file-version! \"%s\")\n", GERBV_PROJECT_FILE_VERSION);
1057 fprintf(fd,
"(define-layer! %d ", p->layerno);
1059 fprintf(fd,
"(cons 'filename \"%s\")\n",
1063 fprintf(fd,
"\t(cons 'inverted #t)\n");
1065 if (p->layerno >= 0) {
1066 fprintf(fd,
"\t(cons 'visible #%c)\n", p->visible?
't':
'f');
1069 fprintf(fd,
"\t(cons 'color #(%d %d %d))\n",
1070 p->rgb[0], p->rgb[1], p->rgb[2]);
1072 if (p->layerno >= 0) {
1073 if (p->alpha != alpha_def_value)
1074 fprintf(fd,
"\t(cons 'alpha #(%d))\n", p->alpha);
1077 if ((fabs(p->translate_x) > min_val)
1078 || (fabs(p->translate_y) > min_val)) {
1079 fprintf(fd,
"\t(cons 'translate #(%f %f))\n",
1080 p->translate_x, p->translate_y);
1082 if (fabs(p->rotation) > min_val) {
1083 fprintf(fd,
"\t(cons 'rotation #(%f))\n", p->rotation);
1085 if ((fabs(p->scale_x - 1.0) > min_val)
1086 || (fabs(p->scale_y - 1.0) > min_val)) {
1087 fprintf(fd,
"\t(cons 'scale #(%f %f))\n",
1088 p->scale_x, p->scale_y);
1090 if (p->mirror_x || p->mirror_y) {
1091 fprintf(fd,
"\t(cons 'mirror #(#%c #%c))\n",
1092 p->mirror_x?
't':
'f', p->mirror_y?
't':
'f');
1098 if (p->layerno < 0) {
1102 attr_list = gerbvProject->
file[p->layerno]->
image->
info->attr_list;
1103 n_attr = gerbvProject->
file[p->layerno]->
image->
info->n_attr;
1107 fprintf(fd,
"\t(cons 'attribs (list\n");
1109 for (i = 0; i < n_attr ; i++) {
1110 switch (attr_list[i].type) {
1112 fprintf(fd,
"\t\t(list '%s 'Label \"%s\")\n", attr_list[i].name,
1113 attr_list[i].default_val.str_value);
1117 fprintf(fd,
"\t\t(list '%s 'Integer %d)\n", attr_list[i].name,
1118 attr_list[i].default_val.int_value);
1122 fprintf(fd,
"\t\t(list '%s 'Real %g)\n", attr_list[i].name,
1123 attr_list[i].default_val.real_value);
1127 fprintf(fd,
"\t\t(list '%s 'String \"%s\")\n", attr_list[i].name,
1128 attr_list[i].default_val.str_value);
1132 fprintf(fd,
"\t\t(list '%s 'Boolean %d)\n", attr_list[i].name,
1133 attr_list[i].default_val.int_value);
1137 fprintf(fd,
"\t\t(list '%s 'Enum %d)\n", attr_list[i].name,
1138 attr_list[i].default_val.int_value);
1142 dprintf (
"HID_Mixed\n");
1143 fprintf (stderr, _(
"%s(): WARNING: HID_Mixed is not yet supported.\n"),
1148 fprintf(fd,
"\t\t(list '%s 'Path \"%s\")\n", attr_list[i].name,
1149 attr_list[i].default_val.str_value);
1153 fprintf (stderr, _(
"%s: unknown type of HID attribute (%d)\n"),
1154 __FUNCTION__, attr_list[i].type);
1159 fprintf (fd,
"\t))\n");
1166 fprintf (fd,
"(set-render-type! %d)\n", screenRenderInfo.
renderType);
1168 setlocale(LC_NUMERIC,
"");