|
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 c
Length: 2917 (0xb65) Types: TextFile Names: »conn.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« └─⟦d3ac74d73⟧ └─⟦this⟧ »isode-5.0/quipu/conn.c«
/* conn.c - */ #ifndef lint static char *rcsid = "$Header: /f/osi/quipu/RCS/conn.c,v 6.0 89/03/18 23:41:09 mrose Rel $"; #endif /* * $Header: /f/osi/quipu/RCS/conn.c,v 6.0 89/03/18 23:41:09 mrose Rel $ * * * $Log: conn.c,v $ * Revision 6.0 89/03/18 23:41:09 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. * */ #include "rosap.h" #include "quipu/util.h" #include "quipu/connection.h" extern LLog * log_dsap; Conn conn_alloc() { Conn conn_ret; conn_ret = (Conn) malloc(sizeof(struct connection)); conn_ret->cn_ad = 0; conn_ret->cn_what = NULLDN; conn_ret->cn_who = NULLDN; conn_ret->cn_tasklist = NULLACTIVITY; conn_ret->cn_operlist = NULLACTIVITY; conn_ret->cn_next = NULLCONN; conn_ret->cn_op_id = 1; return(conn_ret); } conn_free(conn) Conn conn; { if(conn->cn_what != NULLDN) dn_free(conn->cn_what); if(conn->cn_who != NULLDN) dn_free(conn->cn_who); free((char *)conn); } conn_extract(conn) Conn conn; { /* * Extract all the operations made on this connection, and all * the tasks (and their derivative operations) made on the connection; * then remove the connection from the list of active connections. */ struct activity *on; struct activity *tk; DLOG (log_dsap,LLOG_TRACE, ("conn_extract")); for(on=conn->cn_operlist; on!=NULLACTIVITY; on=on->on_next_conn) { oper_conn_extract(on); if(on->on_task == NULLACTIVITY) act_free(on); } for(tk=conn->cn_tasklist; tk!=NULLACTIVITY; tk=tk->tk_next) { task_extract(tk); } conn_free(conn); } conn_log(conn) struct connection * conn; { struct activity * oper; struct activity * task; if(conn == NULLCONN) { LLOG (log_dsap,LLOG_NOTICE, ("Connection: NULLCONN")); return; } DLOG (log_dsap,LLOG_NOTICE, ("Connection [%x], ad = %d", conn, conn->cn_ad)); switch(conn->cn_state) { case CN_STATE_INIT: DLOG (log_dsap,LLOG_DEBUG, ("State: INIT")); break; case CN_STATE_OPEN: DLOG (log_dsap,LLOG_DEBUG, ("State: OPEN")); DLOG (log_dsap,LLOG_DEBUG, ("Tasks:")); for(task=conn->cn_tasklist; task!=NULLACTIVITY; task=task->tk_next) task_log(task); DLOG (log_dsap,LLOG_DEBUG, ("Opers:")); for(oper=conn->cn_operlist; oper!=NULLACTIVITY; oper=oper->on_next_conn) oper_log(oper); break; case CN_STATE_EXIT: DLOG (log_dsap,LLOG_DEBUG, ("State: EXIT")); break; case CN_STATE_FAIL: DLOG (log_dsap,LLOG_DEBUG, ("State: FAIL")); break; default: DLOG (log_dsap,LLOG_DEBUG, ("State: Erroneous")); break; } DLOG (log_dsap,LLOG_DEBUG, ("!")); }