From c87326ebc895246541d6641e347c83a4bd3ad3b3 Mon Sep 17 00:00:00 2001 From: sjborley Date: Sun, 29 May 2005 01:05:33 +0000 Subject: [PATCH] Replaced extern references in .c file with #include of suitable headers. --- src/frontend/plotting/graf.c | 38 +++++++-------------------------- src/frontend/plotting/graphdb.c | 4 ++-- src/frontend/plotting/plot5.c | 7 +++--- src/frontend/plotting/x11.c | 31 ++++++++------------------- 4 files changed, 22 insertions(+), 58 deletions(-) diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index 5a9d7ae67..5b4c3090e 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -1,6 +1,7 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1988 Jeffrey M. Hsu +$Id$ **********/ /* @@ -9,7 +10,6 @@ Author: 1988 Jeffrey M. Hsu * */ - #include #include "cpdefs.h" /* for VT_ */ #include "cpextern.h" @@ -23,9 +23,14 @@ Author: 1988 Jeffrey M. Hsu #include "ftedev.h" #include #include -#include "../terminal.h" #include "graf.h" - +#include "graphdb.h" +#include "grid.h" +#include "../terminal.h" +#include "../breakp2.h" +#include "../error.h" +#include "../display.h" +#include "../runcoms.h" /* static declarations */ static void gr_start_internal(struct dvec *dv, bool copyvec); @@ -33,14 +38,6 @@ static int iplot(struct plot *pl, int id); static void set(struct plot *plot, struct dbcomm *db, bool unset, int mode); static char * getitright(char *buf, double num); - -extern struct dbcomm *dbs; /* for iplot */ - -/* note: let's try to get rid of these */ -/* global variables */ -/* Graphics mode in progress, so signal handlers know to call gr_clean */ -/* bool gr_gmode = FALSE; */ - /* for legends, set in gr_start, reset in gr_iplot and gr_init */ static int plotno; static int curcolor = 1; /* for assigning unique colors */ @@ -70,23 +67,6 @@ double *readtics(char *string); * */ -extern void SetGraphContext (int graphid); -extern void internalerror (char *message); -extern int NewViewport (GRAPH *pgraph); -extern void DevClear (void); -extern void gr_redrawgrid (GRAPH *graph); -extern void DatatoScreen (GRAPH *graph, double x, double y, int *screenx, int *screeny); -extern void SetLinestyle (int linestyleid); -extern void SetColor (int colorid); -extern void DrawLine (int x1, int y1, int x2, int y2); -extern void Text (char *text, int x, int y); -extern void SaveText (GRAPH *graph, char *text, int x, int y); -extern void Update (void); -extern void PushGraphContext (GRAPH *graph); -extern void PopGraphContext (void); -extern void Input (REQUEST *request, RESPONSE *response); -extern int DestroyGraph (int id); - int gr_init(double *xlims, double *ylims, /* The size of the screen. */ char *xname, char *plotname, /* What to label things. */ @@ -641,8 +621,6 @@ gr_restoretext(GRAPH *graph) * another reason why we need to pull color and linestyle out of dvec * XXX Or maybe even something more drastic ?? */ -extern bool resumption; - static int iplot(struct plot *pl, int id) { diff --git a/src/frontend/plotting/graphdb.c b/src/frontend/plotting/graphdb.c index e868cace4..0dc9b0596 100644 --- a/src/frontend/plotting/graphdb.c +++ b/src/frontend/plotting/graphdb.c @@ -1,5 +1,6 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. +$Id$ **********/ /* @@ -12,7 +13,7 @@ Copyright 1990 Regents of the University of California. All rights reserved. #include #include "graphdb.h" - +#include "../breakp2.h" /* invariant: currentgraph contains the current graph */ @@ -145,7 +146,6 @@ DestroyGraph(int id) LISTGRAPH *list, *lastlist; struct _keyed *k, *nextk; struct dveclist *d, *nextd; - extern struct dbcomm *dbs; struct dbcomm *db; list = GBucket[id % NUMGBUCKETS].list; diff --git a/src/frontend/plotting/plot5.c b/src/frontend/plotting/plot5.c index 25281c566..d6211dc3f 100644 --- a/src/frontend/plotting/plot5.c +++ b/src/frontend/plotting/plot5.c @@ -1,5 +1,6 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. +$Id$ **********/ #include @@ -7,6 +8,8 @@ Copyright 1990 Regents of the University of California. All rights reserved. #include #include "plot5.h" +#include "graf.h" +#include "../error.h" static FILE *plotfile; @@ -18,10 +21,6 @@ static char *linestyle[] = { "solid", "dotted", "longdashed", "shortdashed", "dotdashed" }; static int currentlinestyle = SOLID; - -extern void gr_relinestyle (GRAPH *graph); -extern void internalerror (char *message); - int Plt5_Init(void) { diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 0a4c97a3a..00cbd39ca 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -1,13 +1,13 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1988 Jeffrey M. Hsu +$Id$ **********/ /* X11 drivers. */ - #include #ifndef X_DISPLAY_MISSING @@ -36,15 +36,15 @@ Author: 1988 Jeffrey M. Hsu # include # include -#include "x11.h" - -static void linear_arc(int x0, int y0, int radius, double theta1, double theta2); - - # ifdef DEBUG -extern int _Xdebug; +# include /* for _Xdebug */ # endif +#include "x11.h" +#include "graphdb.h" +#include "display.h" +#include "graf.h" +#include "../error.h" #define RAD_TO_DEG (180.0 / M_PI) @@ -67,7 +67,6 @@ typedef struct x11info { #define DEVDEP(g) (*((X11devdep *) (g)->devdep)) -static void linear_arc(int x0, int y0, int radius, double theta1, double theta2); static Display *display; static GC xorgc; static char *xlinestyles[NUMLINESTYLES] = { /* test patterns XXX */ @@ -86,23 +85,11 @@ static GRAPH *lasthardcopy; /* graph user selected */ static int X11_Open = 0; static int numdispplanes; - -extern void internalerror (char *message); -extern void externalerror (char *message); +/* static functions */ static void initlinestyles (void); static void initcolors (GRAPH *graph); -extern void PushGraphContext (GRAPH *graph); -extern void SetColor (int colorid); -extern void Text (char *text, int x, int y); -extern void SaveText (GRAPH *graph, char *text, int x, int y); -extern void PopGraphContext (void); -void slopelocation (GRAPH *graph, int x0, int y0); -void zoomin (GRAPH *graph); static void X_ScreentoData (GRAPH *graph, int x, int y, double *fx, double *fy); -extern int DestroyGraph (int id); -extern void gr_redraw (GRAPH *graph); -extern void gr_resize (GRAPH *graph); - +static void linear_arc(int x0, int y0, int radius, double theta1, double theta2); int errorhandler(Display *display, XErrorEvent *errorev)