- /* don't use all, the range is too whith/black. */
- n_colors = 18;
- base_color = 105;
- fprintf(F,
- "colorentry 100: 0 0 0\n"
- "colorentry 101: 20 0 0\n"
- "colorentry 102: 40 0 0\n"
- "colorentry 103: 60 0 0\n"
- "colorentry 104: 80 0 0\n"
- "colorentry 105: 100 0 0\n"
- "colorentry 106: 120 0 0\n"
- "colorentry 107: 140 0 0\n"
- "colorentry 108: 150 0 0\n"
- "colorentry 109: 180 0 0\n"
- "colorentry 110: 200 0 0\n"
- "colorentry 111: 220 0 0\n"
- "colorentry 112: 240 0 0\n"
- "colorentry 113: 255 0 0\n"
- "colorentry 113: 255 20 20\n"
- "colorentry 114: 255 40 40\n"
- "colorentry 115: 255 60 60\n"
- "colorentry 116: 255 80 80\n"
- "colorentry 117: 255 100 100\n"
- "colorentry 118: 255 120 120\n"
- "colorentry 119: 255 140 140\n"
- "colorentry 120: 255 150 150\n"
- "colorentry 121: 255 180 180\n"
- "colorentry 122: 255 200 200\n"
- "colorentry 123: 255 220 220\n"
- "colorentry 124: 255 240 240\n"
- "colorentry 125: 255 250 250\n"
- );
-
- fprintf(F, "\n"); /* a separator */
-}
-
-/**
- * open a vcg file
- *
- * @param irg The graph to be dumped
- * @param suffix1 first filename suffix
- * @param suffix2 second filename suffix
- */
-FILE *vcg_open(ir_graph *irg, const char * suffix1, const char *suffix2) {
- FILE *F;
- const char *nm = get_irg_dump_name(irg);
- int len = strlen(nm), i, j;
- char *fname; /* filename to put the vcg information in */
-
- if (!suffix1) suffix1 = "";
- if (!suffix2) suffix2 = "";
-
- /* open file for vcg graph */
- fname = xmalloc (len * 2 + strlen(suffix1) + strlen(suffix2) + 5);
-
- /* strncpy (fname, nm, len); */ /* copy the filename */
- j = 0;
- for (i = 0; i < len; ++i) { /* replace '/' in the name: escape by @. */
- if (nm[i] == '/') {
- fname[j] = '@'; j++; fname[j] = '1'; j++;
- } else if (nm[i] == '@') {
- fname[j] = '@'; j++; fname[j] = '2'; j++;
- } else {
- fname[j] = nm[i]; j++;
- }
- }
- fname[j] = '\0';
- strcat(fname, suffix1); /* append file suffix */
- strcat(fname, suffix2); /* append file suffix */
- strcat(fname, ".vcg"); /* append the .vcg suffix */
-
- /* vcg really expect only a <CR> at end of line, so
- * the "b"inary mode is what you mean (and even needed for Win32)
- */
- F = fopen(fname, "wb"); /* open file for writing */
- if (!F) {
- perror(fname);
- }
- free(fname);
-
- return F;
-}
-
-/**
- * open a vcg file
- *
- * @param name prefix file name
- * @param suffix filename suffix
- */
-FILE *vcg_open_name(const char *name, const char *suffix) {
- FILE *F;
- char *fname; /* filename to put the vcg information in */
- int i, j, len = strlen(name);
-
- if (!suffix) suffix = "";
-
- /** open file for vcg graph */
- fname = xmalloc(len * 2 + 5 + strlen(suffix));
- /* strcpy (fname, name);*/ /* copy the filename */
- j = 0;
- for (i = 0; i < len; ++i) { /* replace '/' in the name: escape by @. */
- if (name[i] == '/') {
- fname[j] = '@'; j++; fname[j] = '1'; j++;
- } else if (name[i] == '@') {
- fname[j] = '@'; j++; fname[j] = '2'; j++;
- } else {
- fname[j] = name[i]; j++;