From 393e918c637d06c13362885eeaa1b9b61c8978d1 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 8 Apr 2005 20:45:34 +0000 Subject: [PATCH] Update with new lefty, fixing many bugs and supporting new features --- cmd/lefty/cs2l/cs2l.c | 36 ++++++++++---------- cmd/lefty/gfxview.h | 79 ++++++++++++++++++++++--------------------- 2 files changed, 57 insertions(+), 58 deletions(-) diff --git a/cmd/lefty/cs2l/cs2l.c b/cmd/lefty/cs2l/cs2l.c index d5c803afe..b84b2e98e 100644 --- a/cmd/lefty/cs2l/cs2l.c +++ b/cmd/lefty/cs2l/cs2l.c @@ -25,42 +25,40 @@ #include "exec.h" #include "cs2l.h" -int C2Lopen(char *name, char *mode, FILE ** ifp, FILE ** ofp) -{ +int C2Lopen (char *name, char *mode, FILE **ifp, FILE **ofp) { int fd; - if ((fd = csopen(name, CS_OPEN_READ)) == -1) - return -1; - fcntl(fd, F_SETFD, FD_CLOEXEC); - *ifp = fdopen(fd, "r"), *ofp = fdopen(fd, "a+"); + if ((fd = csopen (name, CS_OPEN_READ)) == -1) + return -1; + fcntl (fd, F_SETFD, FD_CLOEXEC); + *ifp = fdopen (fd, "r"), *ofp = fdopen (fd, "a+"); return 0; } /* LEFTY builtin */ -int C2Lreadcsmessage(int argc, lvar_t * argv) -{ +int C2Lreadcsmessage (int argc, lvar_t *argv) { -#if 0 /* not finished yet */ +#if 0 /* not finished yet */ io_t *p; int ioi, n; Msg_call_t msg; Tobj to; int tm; - ioi = Tgetnumber(argv[0].o); + ioi = Tgetnumber (argv[0].o); if (ioi < 0 || ioi >= ion) - return L_FAILURE; + return L_FAILURE; p = &iop[ioi]; - fseek(p->ofp, 0L, 1); - if ((n = msgrecv(fileno(p->ifp), &msg)) <= 0) - return L_FAILURE; - to = Ttable(6); - tm = Mpushmark(to); - Tinss(to, "id", Tinteger(MSG_CHANNEL_USR(msg.channel))); - Tinss(to, "pid", Tinteger(MSG_CHANNEL_SYS(msg.channel))); + fseek (p->ofp, 0L, 1); + if ((n = msgrecv (fileno (p->ifp), &msg)) <= 0) + return L_FAILURE; + to = Ttable (6); + tm = Mpushmark (to); + Tinss (to, "id", Tinteger (MSG_CHANNEL_USR (msg.channel))); + Tinss (to, "pid", Tinteger (MSG_CHANNEL_SYS (msg.channel))); rtno = to; - Mpopmark(tm); + Mpopmark (tm); #endif return L_SUCCESS; diff --git a/cmd/lefty/gfxview.h b/cmd/lefty/gfxview.h index 685e97194..5526b6f68 100644 --- a/cmd/lefty/gfxview.h +++ b/cmd/lefty/gfxview.h @@ -1,6 +1,6 @@ /* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ - + /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * @@ -18,49 +18,50 @@ extern "C" { #endif - -/* Lefteris Koutsofios - AT&T Bell Laboratories */ +/* Lefteris Koutsofios - AT&T Labs Research */ #ifndef _GFXVIEW_H #define _GFXVIEW_H - void GFXinit(void); - void GFXterm(void); - void GFXprune(void); - void GFXlabelcb(Gevent_t *); - void GFXviewcb(Gevent_t *); - void GFXevent(Gevent_t *); - void GFXmove(void); - void GFXredraw(void); - void GFXtextcb(int, char *); - void GFXbuttoncb(int, void *); - void GFXmonitorfile(int); - void GFXidle(void); +void GFXinit (void); +void GFXterm (void); +void GFXprune (void); +void GFXlabelcb (Gevent_t *); +void GFXviewcb (Gevent_t *); +void GFXevent (Gevent_t *); +void GFXmove (void); +void GFXredraw (void); +void GFXtextcb (int, char *); +void GFXbuttoncb (int, void *); +void GFXmonitorfile (int); +void GFXidle (void); - int GFXcreatewidget(int, lvar_t *); - int GFXsetwidgetattr(int, lvar_t *); - int GFXgetwidgetattr(int, lvar_t *); - int GFXdestroywidget(int, lvar_t *); - int GFXclear(int, lvar_t *); - int GFXsetgfxattr(int, lvar_t *); - int GFXgetgfxattr(int, lvar_t *); - int GFXarrow(int, lvar_t *); - int GFXline(int, lvar_t *); - int GFXbox(int, lvar_t *); - int GFXpolygon(int, lvar_t *); - int GFXsplinegon(int, lvar_t *); - int GFXarc(int, lvar_t *); - int GFXtext(int, lvar_t *); - int GFXtextsize(int, lvar_t *); - int GFXcreatebitmap(int, lvar_t *); - int GFXdestroybitmap(int, lvar_t *); - int GFXreadbitmap(int, lvar_t *); - int GFXwritebitmap(int, lvar_t *); - int GFXbitblt(int, lvar_t *); - int GFXclearpick(int, lvar_t *); - int GFXsetpick(int, lvar_t *); - int GFXdisplaymenu(int, lvar_t *); -#endif /* _GFXVIEW_H */ +int GFXcreatewidget (int, lvar_t *); +int GFXsetwidgetattr (int, lvar_t *); +int GFXgetwidgetattr (int, lvar_t *); +int GFXdestroywidget (int, lvar_t *); +int GFXclear (int, lvar_t *); +int GFXsetgfxattr (int, lvar_t *); +int GFXgetgfxattr (int, lvar_t *); +int GFXarrow (int, lvar_t *); +int GFXline (int, lvar_t *); +int GFXbox (int, lvar_t *); +int GFXpolygon (int, lvar_t *); +int GFXsplinegon (int, lvar_t *); +int GFXarc (int, lvar_t *); +int GFXtext (int, lvar_t *); +int GFXtextsize (int, lvar_t *); +int GFXcreatebitmap (int, lvar_t *); +int GFXdestroybitmap (int, lvar_t *); +int GFXreadbitmap (int, lvar_t *); +int GFXwritebitmap (int, lvar_t *); +int GFXbitblt (int, lvar_t *); +int GFXclearpick (int, lvar_t *); +int GFXsetpick (int, lvar_t *); +int GFXdisplaymenu (int, lvar_t *); +int GFXcolormap (int, lvar_t *); +#endif /* _GFXVIEW_H */ #ifdef __cplusplus } #endif + -- 2.40.0