From 2850725fe94ce038d415c38b595536f53dca0599 Mon Sep 17 00:00:00 2001 From: ellson Date: Thu, 6 Jan 2005 15:01:43 +0000 Subject: [PATCH] add lefty, dotty, lneato to graphviz2 tree --- cmd/lefty/cs2l/Makefile.am | 10 ++++++ cmd/lefty/cs2l/cs2l.c | 67 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 cmd/lefty/cs2l/Makefile.am create mode 100644 cmd/lefty/cs2l/cs2l.c diff --git a/cmd/lefty/cs2l/Makefile.am b/cmd/lefty/cs2l/Makefile.am new file mode 100644 index 000000000..6b3fc257d --- /dev/null +++ b/cmd/lefty/cs2l/Makefile.am @@ -0,0 +1,10 @@ +## Process this file with automake to produce Makefile.in + +AM_CPPFLAGS = -I${top_srcdir}/lefty + +noinst_HEADERS = cs2l.h +# noinst_LTLIBRARIES = libcs2l.la + +# libcs2l_la_SOURCES = cs2l.c + +EXTRA_DIST = cs2l.c diff --git a/cmd/lefty/cs2l/cs2l.c b/cmd/lefty/cs2l/cs2l.c new file mode 100644 index 000000000..d5c803afe --- /dev/null +++ b/cmd/lefty/cs2l/cs2l.c @@ -0,0 +1,67 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + + +#include +#include +#include +#include "common.h" +#include "code.h" +#include "mem.h" +#include "tbl.h" +#include "exec.h" +#include "cs2l.h" + +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+"); + return 0; +} + +/* LEFTY builtin */ +int C2Lreadcsmessage(int argc, lvar_t * argv) +{ + +#if 0 /* not finished yet */ + io_t *p; + int ioi, n; + Msg_call_t msg; + Tobj to; + int tm; + + ioi = Tgetnumber(argv[0].o); + if (ioi < 0 || ioi >= ion) + 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))); + rtno = to; + Mpopmark(tm); +#endif + + return L_SUCCESS; +} -- 2.49.0