Annotation of 40BSD/cmd/cifplot/compare.c, revision 1.1.1.1

1.1       root        1: /*******************************************************************
                      2: *                                                                  *
                      3: *    File: CIFPLOT/compare.c                                       *
                      4: *    Written by Dan Fitzpatrick                                    *
                      5: *    copyright 1980 -- Regents of the University of California     *
                      6: *                                                                  *
                      7: ********************************************************************/
                      8: 
                      9: #include <stdio.h>
                     10: #include "defs.h"
                     11: #include "globals.h"
                     12: #include "parser_defs.h"
                     13: #include "structs.h"
                     14: #include "out_structs.h"
                     15: 
                     16: IMPORT MoveQueue();
                     17: IMPORT CatQueue();
                     18: 
                     19: #define GETA   if(p1 != NIL) {a_start= p1->start; a_end= p1->end;\
                     20:                                        p1= p1->Link; }\
                     21:                                else {a_start = a_end = INFINITY;}\
                     22:                if(a_start > a_end) \
                     23:                                Error("a_start > a_end",INTERNAL);
                     24: 
                     25: #define GETB   if(p2 != NIL) {b_start= p2->start; b_end= p2->end;\
                     26:                                        p2= p2->Link; }\
                     27:                                else {b_start = b_end = INFINITY;}\
                     28:                if(b_start > b_end) \
                     29:                                Error("b_start > b_end",INTERNAL);
                     30: 
                     31: AddLine(i,xcurrent)
                     32: int i,xcurrent;
                     33: {
                     34:     nedge *p1,*p2;
                     35:     int a_start,a_end,b_start,b_end;
                     36: 
                     37:     /* Don't run if just finishing buffer */
                     38:     if(!finishBuf) {
                     39:        p2 = (nedge *) NEdgeQueue[i].QStart;
                     40:        if(outline && !(extractor)) {
                     41:            p1 = (nedge *) NecEdgeQueue[i].QStart;
                     42:            GETA; GETB;
                     43:            while(a_start != INFINITY || b_start != INFINITY) {
                     44:                if(a_start <= b_start)
                     45:                    if(a_end < b_start) {
                     46:                        Fill(xcurrent,(int) a_start,(int) a_end,0xFFFFFFFF);
                     47:                        GETA;
                     48:                        continue;
                     49:                        }
                     50:                      else {
                     51:                        Fill(xcurrent,(int) a_start,(int) b_start,0xFFFFFFFF);
                     52:                        a_start = b_start;
                     53:                        }
                     54:                  else
                     55:                    if(b_end < a_start) {
                     56:                        Fill(xcurrent,(int) b_start,(int) b_end,0xFFFFFFFF);
                     57:                        GETB;
                     58:                        continue;
                     59:                        }
                     60:                      else {
                     61:                        Fill(xcurrent,(int) b_start,(int) a_start,0xFFFFFFFF);
                     62:                        b_start = a_start;
                     63:                        }
                     64:                if(a_start == b_start)
                     65:                    if(a_end < b_end) {
                     66:                        b_start = a_end;
                     67:                        GETA;
                     68:                        continue;
                     69:                        }
                     70:                      else {
                     71:                        a_start = b_end;
                     72:                        GETB;
                     73:                        continue;
                     74:                        }
                     75:                }
                     76:            }
                     77:        CatQueue(&FreeHolders,&(NecEdgeQueue[i]));
                     78:        MoveQueue(&(NecEdgeQueue[i]),&(NEdgeQueue[i]));
                     79:        InitQueue(&(NEdgeQueue[i]));
                     80:        }
                     81:     }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.