|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 2037 (0x7f5) Types: TextFile Names: »ts2ps.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« └─⟦d3ac74d73⟧ └─⟦this⟧ »isode-5.0/psap/ts2ps.c«
/* ts2ps.c - TSDU-backed abstraction for PStreams (really just a refinement of datagram-backed PStreams) */ #ifndef lint static char *rcsid = "$Header: /f/osi/psap/RCS/ts2ps.c,v 6.0 89/03/18 23:39:37 mrose Rel $"; #endif /* * $Header: /f/osi/psap/RCS/ts2ps.c,v 6.0 89/03/18 23:39:37 mrose Rel $ * * * $Log: ts2ps.c,v $ * Revision 6.0 89/03/18 23:39:37 mrose * Release 5.0 * */ /* * NOTICE * * Acquisition, use, and distribution of this module and related * materials are subject to the restrictions of a license agreement. * Consult the Preface in the User's Manual for the full terms of * this agreement. * */ /* LINTLIBRARY */ #include <stdio.h> #include "psap.h" #include "tsap.h" #include "tailor.h" /* \f */ int ts_read (fd, q) int fd; struct qbuf **q; { register struct qbuf *qb; struct TSAPdata txs; register struct TSAPdata *tx = &txs; struct TSAPdisconnect tds; register struct TSAPdisconnect *td = &tds; if (TReadRequest (fd, tx, NOTOK, td) == NOTOK) { SLOG (psap_log, LLOG_EXCEPTIONS, NULLCP, (td -> td_cc > 0 ? "ts_read: [%s] %*.*s" : "ts_read: [%s]", TErrString (td -> td_reason), td -> td_cc, td -> td_cc, td -> td_data)); return NOTOK; } qb = &tx -> tx_qbuf; if (qb -> qb_forw -> qb_forw != qb && qb_pullup (qb) == NOTOK) { SLOG (psap_log, LLOG_EXCEPTIONS, NULLCP, ("ts_read: qb_pullup fails")); TXFREE (tx); return NOTOK; } remque (qb = tx -> tx_qbuf.qb_forw); *q = qb; TXFREE (tx); return qb -> qb_len; } int ts_write (fd, qb) int fd; register struct qbuf *qb; { struct TSAPdisconnect tds; register struct TSAPdisconnect *td = &tds; if (TDataRequest (fd, qb -> qb_data, qb -> qb_len, td) == NOTOK) { SLOG (psap_log, LLOG_EXCEPTIONS, NULLCP, (td -> td_cc > 0 ? "ts_write: [%s] %*.*s" : "ts_write: [%s]", TErrString (td -> td_reason), td -> td_cc, td -> td_cc, td -> td_data)); return NOTOK; } return qb -> qb_len; }