45 #ifdef HAVE_SYS_TYPES_H
46 #include <sys/types.h>
49 #ifdef HAVE_SYS_STAT_H
63 #include "lrealpath.h"
85 #define GERBV_PROJECT_FILE_VERSION "2.0A"
90 #define GERBV_DEFAULT_PROJECT_FILE_VERSION "1.9A"
96 static const char* known_versions[] = {
"1.9A",
"2.0A", NULL };
103 static project_list_t* project_list_top = NULL;
105 static const int alpha_def_value = 177 * 257;
111 static int current_file_version = 0;
118 version_str_to_int(
const char* str) {
120 gchar *dup, *tmps, *ptr;
125 dprintf(
"%s(\"%s\")\n", __FUNCTION__, str);
131 tmps = g_strdup(str);
133 while (*ptr !=
'\0' && *ptr !=
'.') {
142 r = 10000 * atoi(tmps);
143 dprintf(
"%s(): Converted \"%s\" to r = %d\n", __FUNCTION__, tmps, r);
155 while (*ptr !=
'\0' && *ptr !=
'.') {
165 while (*ptr !=
'\0' && isdigit((
int)*ptr)) {
174 r += 100 * atoi(tmps);
175 dprintf(
"%s(): Converted \"%s\" to r = %d\n", __FUNCTION__, tmps, r);
188 while (*ptr !=
'\0' && (isdigit((
int)*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;
226 version_int_to_str(
int ver) {
227 int major, minor, teeny;
236 minor = (ver - 10000 * major) / 100;
237 teeny = (ver - 10000 * major - 100 * minor);
238 if (teeny >= 1 && teeny <= 26) {
239 l[0] =
'A' + teeny - 1;
240 }
else if (teeny > 26 && teeny <= 52) {
242 l[1] =
'A' + teeny - 26 - 1;
245 str = g_strdup_printf(
"%d.%d%s", major, minor, l);
250 check_vector_and_length(scheme* sc, pointer value,
unsigned int length,
const char* item) {
251 if (!sc->vptr->is_vector(value)) {
252 GERB_MESSAGE(_(
"'%s' parameter not a vector"), item);
257 if (sc->vptr->vector_length(value) != length) {
258 GERB_MESSAGE(_(
"'%s' vector of incorrect length"), item);
267 get_color(scheme* sc, pointer value,
int* color) {
271 if (check_vector_and_length(sc, value, 3,
"color"))
274 for (i = 0; i < 3; i++) {
275 elem = sc->vptr->vector_elem(value, i);
276 if (sc->vptr->is_integer(elem) && sc->vptr->is_number(elem))
277 color[i] = sc->vptr->ivalue(elem);
280 GERB_MESSAGE(_(
"Illegal color in projectfile"));
288 get_alpha(scheme* sc, pointer value,
int* alpha) {
291 if (check_vector_and_length(sc, value, 1,
"alpha"))
294 elem = sc->vptr->vector_elem(value, 0);
295 if (sc->vptr->is_integer(elem) && sc->vptr->is_number(elem)) {
296 *alpha = sc->vptr->ivalue(elem);
300 GERB_MESSAGE(_(
"Illegal alpha value in projectfile"));
304 get_double(scheme* sc, pointer value,
char* item,
double* x,
double def) {
307 if (check_vector_and_length(sc, value, 1, item))
310 elem = sc->vptr->vector_elem(value, 0);
311 if (sc->vptr->is_real(elem) && sc->vptr->is_number(elem)) {
312 *x = sc->vptr->rvalue(elem);
315 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
320 get_double_pair(scheme* sc, pointer value,
char* item,
double* x,
double* y,
double def) {
323 if (check_vector_and_length(sc, value, 2, item))
326 elem = sc->vptr->vector_elem(value, 0);
327 if (sc->vptr->is_real(elem) && sc->vptr->is_number(elem)) {
328 *x = sc->vptr->rvalue(elem);
331 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
334 elem = sc->vptr->vector_elem(value, 1);
335 if (sc->vptr->is_real(elem) && sc->vptr->is_number(elem)) {
336 *y = sc->vptr->rvalue(elem);
339 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
344 get_bool_pair(scheme* sc, pointer value,
char* item,
char* x,
char* y,
char def) {
347 if (check_vector_and_length(sc, value, 2, item))
350 elem = sc->vptr->vector_elem(value, 0);
353 }
else if (elem == sc->T) {
357 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
360 elem = sc->vptr->vector_elem(value, 1);
363 }
else if (elem == sc->T) {
367 GERB_MESSAGE(_(
"Illegal %s in projectfile"), item);
376 static char* bindir = NULL;
377 static char* exec_prefix = NULL;
378 static char* pkgdatadir = NULL;
379 static gchar* scmdatadir = NULL;
391 if (bindir != NULL) {
396 if (exec_prefix != NULL) {
401 if (pkgdatadir != NULL) {
406 if (scmdatadir != NULL) {
416 init_paths(
char* argv0) {
420 int found_bindir = 0;
434 for (
unsigned int i = 0; i < strlen(argv0); i++) {
435 if (argv0[i] == GERBV_DIR_SEPARATOR_C)
439 dprintf(
"%s (%s): haspath = %d\n", __FUNCTION__, argv0, haspath);
441 bindir = strdup(lrealpath(argv0));
444 char * path, *p, *tmps;
448 tmps = getenv(
"PATH");
454 for (p = strtok(path, GERBV_PATH_DELIMETER); p && *p; p = strtok(NULL, GERBV_PATH_DELIMETER)) {
455 dprintf(
"Looking for %s in %s\n", argv0, p);
456 if ((tmps = malloc((strlen(argv0) + strlen(p) + 2) *
sizeof(
char))) == NULL) {
457 fprintf(stderr,
"malloc failed in %s()\n", __FUNCTION__);
460 sprintf(tmps,
"%s%s%s", p, GERBV_DIR_SEPARATOR_S, argv0);
463 dprintf(
"Found it: \"%s\"\n", tmps);
464 bindir = lrealpath(tmps);
474 dprintf(
"%s(): bindir = \"%s\"\n", __FUNCTION__, bindir);
479 t1 = strchr(bindir, GERBV_DIR_SEPARATOR_C);
480 while (t1 != NULL && *t1 !=
'\0') {
482 t1 = strchr(t2 + 1, GERBV_DIR_SEPARATOR_C);
486 dprintf(
"After stripping off the executible name, we found\n");
487 dprintf(
"bindir = \"%s\"\n", bindir);
493 bindir = strdup(BINDIR);
497 l = strlen(bindir) + 1 + strlen(BINDIR_TO_EXECPREFIX) + 1;
498 if ((exec_prefix = (
char*)malloc(l *
sizeof(
char))) == NULL) {
499 fprintf(stderr,
"malloc failed in %s()\n", __FUNCTION__);
502 sprintf(exec_prefix,
"%s%s%s", bindir, GERBV_DIR_SEPARATOR_S, BINDIR_TO_EXECPREFIX);
505 l = strlen(bindir) + 1 + strlen(BINDIR_TO_PKGDATADIR) + 1;
506 if ((pkgdatadir = (
char*)malloc(l *
sizeof(
char))) == NULL) {
507 fprintf(stderr,
"malloc failed in %s()\n", __FUNCTION__);
510 sprintf(pkgdatadir,
"%s%s%s", bindir, GERBV_DIR_SEPARATOR_S, BINDIR_TO_PKGDATADIR);
512 scmdatadir = g_strdup_printf(
"%s%s%s", pkgdatadir, GERBV_DIR_SEPARATOR_S, SCMSUBDIR);
514 dprintf(
"%s(): bindir = %s\n", __FUNCTION__, bindir);
515 dprintf(
"%s(): exec_prefix = %s\n", __FUNCTION__, exec_prefix);
516 dprintf(
"%s(): pkgdatadir = %s\n", __FUNCTION__, pkgdatadir);
517 dprintf(
"%s(): scmdatadir = %s\n", __FUNCTION__, scmdatadir);
521 get_value_string(scheme* sc, pointer value) {
522 if (!sc->vptr->is_string(value))
525 return sc->vptr->string_value(value);
535 #if defined(__MINGW32__)
541 while ((hit_in_path = strchr(path,
'\\'))) {
546 while ((hit_in_path = strchr(path,
'/'))) {
557 define_layer(scheme* sc, pointer args) {
558 pointer car_el, cdr_el, name, value;
559 project_list_t* plist;
563 dprintf(
"--> entering %s: %s\n", __FILE__, __func__);
565 if (!sc->vptr->is_pair(args)) {
566 GERB_MESSAGE(_(
"%s(): too few arguments"), __func__);
571 car_el = sc->vptr->pair_car(args);
572 cdr_el = sc->vptr->pair_cdr(args);
574 if (!sc->vptr->is_integer(car_el) || !sc->vptr->is_number(car_el)) {
575 GERB_MESSAGE(_(
"%s(): layer number missing/incorrect"), __func__);
580 layerno = sc->vptr->ivalue(car_el);
581 dprintf(
" layerno = %d\n", layerno);
583 car_el = sc->vptr->pair_car(cdr_el);
584 cdr_el = sc->vptr->pair_cdr(cdr_el);
586 plist = g_new0(project_list_t, 1);
587 plist->next = project_list_top;
588 project_list_top = plist;
589 plist->layerno = layerno;
592 plist->attr_list = NULL;
593 plist->translate_x = plist->translate_y = 0.0;
594 plist->scale_x = plist->scale_y = 1.0;
595 plist->mirror_x = plist->mirror_y = 0;
598 plist->alpha = alpha_def_value;
600 while (sc->vptr->is_pair(car_el)) {
602 name = sc->vptr->pair_car(car_el);
603 value = sc->vptr->pair_cdr(car_el);
605 if (!sc->vptr->is_symbol(name)) {
606 GERB_MESSAGE(_(
"%s(): non-symbol found, ignoring"), __func__);
607 goto end_name_value_parse;
610 str = sc->vptr->symname(name);
611 if (strcmp(str,
"color") == 0) {
612 get_color(sc, value, plist->rgb);
613 }
else if (strcmp(str,
"alpha") == 0) {
614 get_alpha(sc, value, &plist->alpha);
615 }
else if (strcmp(str,
"translate") == 0) {
616 get_double_pair(sc, value,
"translate", &plist->translate_x, &plist->translate_y, 0.0);
617 }
else if (strcmp(str,
"rotation") == 0) {
618 get_double(sc, value,
"rotation", &plist->rotation, 0.0);
619 }
else if (strcmp(str,
"scale") == 0) {
620 get_double_pair(sc, value,
"scale", &plist->scale_x, &plist->scale_y, 1.0);
621 }
else if (strcmp(str,
"mirror") == 0) {
622 get_bool_pair(sc, value,
"mirror", &plist->mirror_x, &plist->mirror_y, 0);
623 }
else if (strcmp(str,
"filename") == 0) {
624 plist->filename = g_strdup(get_value_string(sc, value));
627 }
else if (strcmp(str,
"pick_and_place") == 0) {
628 plist->filename = g_strdup(get_value_string(sc, value));
631 }
else if (strcmp(str,
"inverted") == 0) {
632 if (value == sc->F) {
634 }
else if (value == sc->T) {
637 GERB_MESSAGE(_(
"Argument to inverted must be #t or #f"));
639 }
else if (strcmp(str,
"visible") == 0) {
640 if (value == sc->F) {
642 }
else if (value == sc->T) {
645 GERB_MESSAGE(_(
"Argument to visible must be #t or #f"));
647 }
else if (strcmp(str,
"attribs") == 0) {
648 pointer attr_car_el, attr_cdr_el;
649 pointer attr_name, attr_type, attr_value;
652 dprintf(
"Parsing file attributes\n");
654 attr_car_el = sc->vptr->pair_car(value);
655 attr_cdr_el = sc->vptr->pair_cdr(value);
656 while (sc->vptr->is_pair(attr_car_el)) {
657 int p = plist->n_attr;
660 (gerbv_HID_Attribute*)realloc(plist->attr_list, plist->n_attr *
sizeof(gerbv_HID_Attribute));
661 if (plist->attr_list == NULL) {
662 fprintf(stderr, _(
"%s(): realloc failed\n"), __FUNCTION__);
667 attr_name = sc->vptr->pair_car(attr_car_el);
670 attr_type = sc->vptr->pair_cdr(attr_car_el);
671 attr_type = sc->vptr->pair_car(attr_type);
674 attr_value = sc->vptr->pair_cdr(attr_car_el);
675 attr_value = sc->vptr->pair_cdr(attr_value);
676 attr_value = sc->vptr->pair_car(attr_value);
679 " attribute %s, type is %s, value is ", sc->vptr->symname(attr_name), sc->vptr->symname(attr_type)
682 plist->attr_list[p].name = strdup(sc->vptr->symname(attr_name));
684 type = sc->vptr->symname(attr_type);
686 plist->attr_list[p].default_val.str_value = NULL;
687 if (strcmp(type,
"label") == 0) {
688 dprintf(
"%s", sc->vptr->string_value(attr_value));
689 plist->attr_list[p].type = HID_Label;
690 plist->attr_list[p].default_val.str_value = strdup(sc->vptr->string_value(attr_value));
692 }
else if (strcmp(type,
"integer") == 0) {
693 dprintf(
"%ld", sc->vptr->ivalue(attr_value));
694 plist->attr_list[p].type = HID_Integer;
695 plist->attr_list[p].default_val.int_value = sc->vptr->ivalue(attr_value);
697 }
else if (strcmp(type,
"real") == 0) {
698 dprintf(
"%g", sc->vptr->rvalue(attr_value));
699 plist->attr_list[p].type = HID_Real;
700 plist->attr_list[p].default_val.real_value = sc->vptr->rvalue(attr_value);
702 }
else if (strcmp(type,
"string") == 0) {
703 dprintf(
"%s", sc->vptr->string_value(attr_value));
704 plist->attr_list[p].type = HID_String;
705 plist->attr_list[p].default_val.str_value = strdup(sc->vptr->string_value(attr_value));
707 }
else if (strcmp(type,
"boolean") == 0) {
708 dprintf(
"%ld", sc->vptr->ivalue(attr_value));
709 plist->attr_list[p].type = HID_Boolean;
710 plist->attr_list[p].default_val.int_value = sc->vptr->ivalue(attr_value);
712 }
else if (strcmp(type,
"enum") == 0) {
713 dprintf(
"%ld", sc->vptr->ivalue(attr_value));
714 plist->attr_list[p].type = HID_Enum;
715 plist->attr_list[p].default_val.int_value = sc->vptr->ivalue(attr_value);
717 }
else if (strcmp(type,
"mixed") == 0) {
718 plist->attr_list[p].type = HID_Mixed;
719 plist->attr_list[p].default_val.str_value = NULL;
720 fprintf(stderr, _(
"%s(): WARNING: HID_Mixed is not yet supported\n"), __FUNCTION__);
722 }
else if (strcmp(type,
"path") == 0) {
723 dprintf(
"%s", sc->vptr->string_value(attr_value));
724 plist->attr_list[p].type = HID_Path;
725 plist->attr_list[p].default_val.str_value = strdup(sc->vptr->string_value(attr_value));
727 fprintf(stderr, _(
"%s(): Unknown attribute type: \"%s\"\n"), __FUNCTION__, type);
731 attr_car_el = sc->vptr->pair_car(attr_cdr_el);
732 attr_cdr_el = sc->vptr->pair_cdr(attr_cdr_el);
735 GERB_MESSAGE(_(
"Ignoring \"%s\" in project file"), str);
738 end_name_value_parse:
739 car_el = sc->vptr->pair_car(cdr_el);
740 cdr_el = sc->vptr->pair_cdr(cdr_el);
747 set_render_type(scheme* sc, pointer args) {
751 dprintf(
"--> entering project.c:%s()\n", __FUNCTION__);
753 if (!sc->vptr->is_pair(args)) {
754 GERB_MESSAGE(_(
"set-render-type!: Too few arguments"));
758 car_el = sc->vptr->pair_car(args);
760 r = sc->vptr->ivalue(car_el);
761 dprintf(
"%s(): Setting render type to %d\n", __FUNCTION__, r);
762 interface_set_render_type(r);
768 gerbv_file_version(scheme* sc, pointer args) {
774 dprintf(
"--> entering project.c:%s()\n", __FUNCTION__);
776 if (!sc->vptr->is_pair(args)) {
777 GERB_MESSAGE(_(
"gerbv-file-version!: Too few arguments"));
781 car_el = sc->vptr->pair_car(args);
782 vstr = get_value_string(sc, car_el);
785 r = version_str_to_int(vstr);
788 r = version_str_to_int(GERBV_DEFAULT_PROJECT_FILE_VERSION);
790 _(
"The project file you are attempting to load has specified that it\n"
791 "uses project file version \"%s\" but this string is not\n"
792 "a valid version. Gerbv will attempt to load the file using\n"
793 "version \"%s\". You may experience unexpected results."),
794 vstr, version_int_to_str(r)
796 vstr = GERBV_DEFAULT_PROJECT_FILE_VERSION;
799 tmps = version_int_to_str(r);
800 printf(_(
"%s(): Read a project file version of %s (%d)\n"), __FUNCTION__, vstr, r);
801 printf(_(
" Translated back to \"%s\"\n"), tmps);
805 dprintf(
"%s(): Read a project file version of %s (%d)\n", __FUNCTION__, vstr, r);
807 if (r > version_str_to_int(GERBV_PROJECT_FILE_VERSION)) {
810 _(
"The project file you are attempting to load is version \"%s\"\n"
811 "but this copy of gerbv is only capable of loading project files\n"
812 "using version \"%s\" or older. You may experience unexpected results."),
813 vstr, GERBV_PROJECT_FILE_VERSION
819 while (known_versions[i] != NULL) {
820 if (strcmp(known_versions[i], vstr) == 0) {
831 _(
"The project file you are attempting to load is version \"%s\"\n"
832 "which is an unknown version.\n"
833 "You may experience unexpected results."),
844 current_file_version = r;
859 const gsize buf_size = 200;
861 fd = fopen(filename,
"rb");
863 GERB_MESSAGE(_(
"Failed to open \"%s\" for reading: %s"), filename, strerror(errno));
867 buf = (
char*)g_malloc(buf_size);
870 "malloc buf failed while checking for "
871 "Gerbv project in %s()",
875 if (fgets(buf, buf_size, fd) != NULL)
876 *ret = (g_strrstr(buf,
"gerbv-file-version") != NULL);
895 struct stat stat_info;
905 char* initdirs[] = {
"$GERBV_SCHEMEINIT",
"", BACKEND_DIR,
mainProject->
execpath,
".", NULL };
912 initdirs[1] = scmdatadir;
918 while (initdirs[i] != NULL) {
919 printf(
"%s(): initdirs[%d] = \"%s\"\n", __FUNCTION__, i, initdirs[i]);
930 current_file_version = version_str_to_int(GERBV_DEFAULT_PROJECT_FILE_VERSION);
932 if (stat(filename, &stat_info) || !S_ISREG(stat_info.st_mode)) {
933 GERB_MESSAGE(_(
"Failed to read %s"), filename);
938 sc = scheme_init_new();
939 scheme_set_output_port_file(sc, stdout);
942 GERB_FATAL_ERROR(_(
"Couldn't init scheme"));
948 if (initfile == NULL) {
950 GERB_MESSAGE(_(
"Problem loading init.scm (%s)"), strerror(errno));
953 dprintf(
"%s(): initfile = \"%s\"\n", __FUNCTION__, initfile);
955 if ((fd = fopen(initfile,
"r")) == NULL) {
957 GERB_MESSAGE(_(
"Couldn't open %s (%s)"), initfile, strerror(errno));
962 setlocale(LC_NUMERIC,
"C");
964 sc->vptr->load_file(sc, fd);
967 sc->vptr->scheme_define(
968 sc, sc->global_env, sc->vptr->mk_symbol(sc,
"define-layer!"), sc->vptr->mk_foreign_func(sc, define_layer)
971 sc->vptr->scheme_define(
972 sc, sc->global_env, sc->vptr->mk_symbol(sc,
"set-render-type!"), sc->vptr->mk_foreign_func(sc, set_render_type)
975 sc->vptr->scheme_define(
976 sc, sc->global_env, sc->vptr->mk_symbol(sc,
"gerbv-file-version!"),
977 sc->vptr->mk_foreign_func(sc, gerbv_file_version)
980 if ((fd = fopen(filename,
"r")) == NULL) {
981 setlocale(LC_NUMERIC,
"");
983 GERB_MESSAGE(_(
"Couldn't open project file %s (%s)"), filename, strerror(errno));
988 project_list_top = NULL;
990 scheme_load_file(sc, fd);
993 setlocale(LC_NUMERIC,
"");
996 return project_list_top;
1000 project_destroy_project_list(project_list_t* projectList) {
1001 project_list_t *tempP, *tempP2;
1003 for (tempP = projectList; tempP != NULL;) {
1004 tempP2 = tempP->next;
1006 g_free(tempP->filename);
1007 gerbv_attribute_destroy_HID_attribute(tempP->attr_list, tempP->n_attr);
1008 tempP->attr_list = NULL;
1018 write_project_file(
gerbv_project_t* gerbvProject,
const char* filename, project_list_t* project) {
1020 project_list_t* p = project;
1022 gerbv_HID_Attribute* attr_list = NULL;
1023 const float min_val = GERBV_PRECISION_LINEAR_INCH;
1026 if ((fd = fopen(filename,
"w")) == NULL) {
1027 GERB_MESSAGE(_(
"Couldn't save project %s"), filename);
1032 setlocale(LC_NUMERIC,
"C");
1034 fprintf(fd,
"(gerbv-file-version! \"%s\")\n", GERBV_PROJECT_FILE_VERSION);
1037 fprintf(fd,
"(define-layer! %d ", p->layerno);
1042 fprintf(fd,
"\t(cons 'inverted #t)\n");
1044 if (p->layerno >= 0) {
1045 fprintf(fd,
"\t(cons 'visible #%c)\n", p->visible ?
't' :
'f');
1048 fprintf(fd,
"\t(cons 'color #(%d %d %d))\n", p->rgb[0], p->rgb[1], p->rgb[2]);
1050 if (p->layerno >= 0) {
1051 if (p->alpha != alpha_def_value)
1052 fprintf(fd,
"\t(cons 'alpha #(%d))\n", p->alpha);
1055 if ((fabs(p->translate_x) > min_val) || (fabs(p->translate_y) > min_val)) {
1056 fprintf(fd,
"\t(cons 'translate #(%f %f))\n", p->translate_x, p->translate_y);
1058 if (fabs(p->rotation) > GERBV_PRECISION_ANGLE_RAD) {
1059 fprintf(fd,
"\t(cons 'rotation #(%f))\n", p->rotation);
1061 if ((fabs(p->scale_x - 1.0) > min_val) || (fabs(p->scale_y - 1.0) > min_val)) {
1062 fprintf(fd,
"\t(cons 'scale #(%f %f))\n", p->scale_x, p->scale_y);
1064 if (p->mirror_x || p->mirror_y) {
1065 fprintf(fd,
"\t(cons 'mirror #(#%c #%c))\n", p->mirror_x ?
't' :
'f', p->mirror_y ?
't' :
'f');
1071 if (p->layerno < 0) {
1075 attr_list = gerbvProject->
file[p->layerno]->
image->
info->attr_list;
1076 n_attr = gerbvProject->
file[p->layerno]->
image->
info->n_attr;
1080 fprintf(fd,
"\t(cons 'attribs (list\n");
1082 for (i = 0; i < n_attr; i++) {
1083 switch (attr_list[i].type) {
1086 fd,
"\t\t(list '%s 'Label \"%s\")\n", attr_list[i].name, attr_list[i].default_val.str_value
1091 fprintf(fd,
"\t\t(list '%s 'Integer %d)\n", attr_list[i].name, attr_list[i].default_val.int_value);
1095 fprintf(fd,
"\t\t(list '%s 'Real %g)\n", attr_list[i].name, attr_list[i].default_val.real_value);
1100 fd,
"\t\t(list '%s 'String \"%s\")\n", attr_list[i].name, attr_list[i].default_val.str_value
1105 fprintf(fd,
"\t\t(list '%s 'Boolean %d)\n", attr_list[i].name, attr_list[i].default_val.int_value);
1109 fprintf(fd,
"\t\t(list '%s 'Enum %d)\n", attr_list[i].name, attr_list[i].default_val.int_value);
1113 dprintf(
"HID_Mixed\n");
1114 fprintf(stderr, _(
"%s(): WARNING: HID_Mixed is not yet supported.\n"), __FUNCTION__);
1118 fprintf(fd,
"\t\t(list '%s 'Path \"%s\")\n", attr_list[i].name, attr_list[i].default_val.str_value);
1122 fprintf(stderr, _(
"%s: unknown type of HID attribute (%d)\n"), __FUNCTION__, attr_list[i].type);
1127 fprintf(fd,
"\t))\n");
1134 fprintf(fd,
"(set-render-type! %d)\n", screenRenderInfo.
renderType);
1136 setlocale(LC_NUMERIC,
"");
char * gerb_find_file(const char *filename, char **paths)
Search for files in directories pointed out by paths, a NULL terminated list of directories to search...
Header info for the file parsing support functions.
The main header file for the libgerbv library.
Header info for the GUI building functions for Gerber Viewer.
gerbv_project_t * mainProject
Global state variable to keep track of what's happening on the screen.
Header info for common structs and functions used for the GUI application.
static char * convert_path_separators(char *path, int conv_flag)
Conversion of '\' into '/' and vice versa for compatibility under WIN32 platforms.
project_list_t * read_project_file(const char *filename)
Reads the content of a project file.
int project_is_gerbv_project(const char *filename, gboolean *ret)
Checks whether the supplied file look like a gerbv project by reading the first line and checking if ...
Header info for loading and saving project files.
Header info for the rendering support functions for gerbv.
Private data for the TinyScheme compiler.
gerbv_image_info_t * info
gerbv_render_types_t renderType