home *** CD-ROM | disk | FTP | other *** search
- From decwrl!wuarchive!cs.utexas.edu!uunet!allbery Tue Nov 7 12:46:16 PST 1989
- Article 1167 of comp.sources.misc:
- Path: decwrl!wuarchive!cs.utexas.edu!uunet!allbery
- From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
- Newsgroups: comp.sources.misc
- Subject: v09i001: Patch 1 for cif2ps (a CIF to PostScript translator)
- Message-ID: <71547@uunet.UU.NET>
- Date: 7 Nov 89 00:29:33 GMT
- Sender: allbery@uunet.UU.NET
- Reply-To: gwr@gomez.mitre.org (Gordon W. Ross)
- Lines: 178
- Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 9, Issue 1
- Submitted-by: gwr@gomez.mitre.org (Gordon W. Ross)
- Archive-name: cif2ps.p1
-
- This is patch number 1 for cif2ps (as modified by Gordon W. Ross).
- The initial version of cif2ps ignored the (optional) "box-direction"
- part of cif box commands, causing incorrect plots for cif files using
- boxes with a "direction" specifier. The code added here only handles
- box directions which are a multiple of 90 degrees (most are).
- Handling arbitrary box directions would require major changes...
- and the parser is a mess...
- Anyone volunteers to replace the parser with the Oct or UW cif parser?
-
- Other changes in this patch include:
- improvements to error messages
- the default plot-cell is now the top level (cell zero).
-
- The changes are attached (you can use patch to apply them).
-
- Gordon W. Ross gwr@gomez.mitre.org (617) 271-3205 (daytime)
- The MITRE Corp. (M/S E025) Burlington Road, Bedford, MA 01730
-
- ------------------------ patch 1 for cif2ps ---------------------
- *** cifgood.old Tue Oct 24 18:16:17 1989
- --- cifgood.c Mon Nov 6 17:02:32 1989
- ***************
- *** 270,276 ****
- {
- if (++last_symbol == MAXSYMBOLS)
- {
- ! fprintf(stderr, "Exceeded the number of allowed symbols\n");
- exit(1);
- }
- temp_index = last_symbol;
- --- 270,276 ----
- {
- if (++last_symbol == MAXSYMBOLS)
- {
- ! fprintf(stderr, "Too many cell definitions\n");
- exit(1);
- }
- temp_index = last_symbol;
- ***************
- *** 375,382 ****
- cif_box(cif)
- char *cif;
- {
- int next_one, i;
- ! int temp[4];
- char token[MAXTOKEN];
- boxtype *box, *allocbox();
-
- --- 375,383 ----
- cif_box(cif)
- char *cif;
- {
- + static char *error = "incorrect box\n";
- int next_one, i;
- ! int temp[4],dirX,dirY;
- char token[MAXTOKEN];
- boxtype *box, *allocbox();
-
- ***************
- *** 392,398 ****
- next_one = get_token(cif, next_one, token);
- if (next_one == -1)
- {
- ! fprintf(stderr, "incomplete box\n");
- cif_output(stderr, cif);
- return;
- }
- --- 393,399 ----
- next_one = get_token(cif, next_one, token);
- if (next_one == -1)
- {
- ! fprintf(stderr, error);
- cif_output(stderr, cif);
- return;
- }
- ***************
- *** 399,404 ****
- --- 400,432 ----
- (void) sscanf(token, "%d", &(temp[i]));
- }
-
- + /* Check for box direction */
- + next_one = get_token(cif, next_one, token);
- + if (0 < next_one) { /* box rotated */
- + (void) sscanf(token, "%d", &dirX);
- + next_one = get_token(cif, next_one, token);
- + if (next_one == -1) {
- + fprintf(stderr, error);
- + cif_output(stderr, cif);
- + return;
- + }
- + (void) sscanf(token, "%d", &dirY);
- + /* fix-up box dimensions */
- + if (dirX==0) {
- + /* rotate this box by 90 degrees */
- + dirX=temp[0];
- + temp[0]=temp[1];
- + temp[1]=dirX;
- + } else { /* dirX != 0 */
- + /* just assert manhattan direction */
- + if (dirY != 0) {
- + fprintf(stderr, "box is non-manhattan\n");
- + cif_output(stderr, cif);
- + return;
- + }
- + }
- + } /* if (0 < next_one)... box rotated */
- +
- /* *temp = width, height, center-x, center-y */
- box->llx = a_over_b * (temp[2] - temp[0]/2);
- box->urx = a_over_b * (temp[2] + temp[0]/2);
- ***************
- *** 481,487 ****
- cif_polygon(cif)
- char *cif;
- {
- - static char *error = "can't read polygon";
- ngontype *ngon;
- int points=0;
- int *pointsArray;
- --- 509,514 ----
- ***************
- *** 555,561 ****
- cif_wire(cif)
- char *cif;
- {
- ! static char *error = "can't read wire";
- static char token[MAXTOKEN];
- static int width;
- int column=1; /* current column in cif line */
- --- 582,588 ----
- cif_wire(cif)
- char *cif;
- {
- ! static char *error = "incorrect wire\n";
- static char token[MAXTOKEN];
- static int width;
- int column=1; /* current column in cif line */
- ***************
- *** 566,572 ****
- /* read the wire width */
- column = get_token(cif, column, token);
- if((column == -1) || (1 != sscanf(token, "%d", &width))) {
- ! fprintf(stderr,error,"width");
- cif_output(stderr,cif);
- return;
- }
- --- 593,599 ----
- /* read the wire width */
- column = get_token(cif, column, token);
- if((column == -1) || (1 != sscanf(token, "%d", &width))) {
- ! fprintf(stderr,error);
- cif_output(stderr,cif);
- return;
- }
-
- *** cif2ps.old Tue Oct 24 18:05:03 1989
- --- cif2ps.c Mon Nov 6 09:40:27 1989
- ***************
- *** 169,174 ****
- } else {
- /* use default choice of symbol */
- ! /* usually want "1" if it exists, else "0" */
- ! sym_index = get_index(1);
- if (sym_index < 0) sym_index = 0;
- }
- --- 169,174 ----
- } else {
- /* use default choice of symbol */
- ! /* cell zero is the top level */
- ! sym_index = get_index(0);
- if (sym_index < 0) sym_index = 0;
- }
- ----------------------------- end of patch 1 --------------------------
-
-
-