return sp;
}
+/*
+ * post a close handler for this connection, to do special things
+ * in the event of this cnum closing, the default is just to close
+ */
+
+void sel_closehandler(sel_t *sp, void (*handler)())
+{
+ sp->closehandler = handler;
+}
+
/*
* close (and thus clear down) a slot, it is assumed that you have done whatever
* you need to do to close the actual device already
void sel_close(sel_t *sp)
{
if (sp->sort) {
+ if (sp->closehandler) {
+ (sp->closehandler)(sp);
+ } else {
+ close(sp->cnum);
+ }
chain_flush(sp->msgbase);
free(sp->msgbase);
free(sp->name);
int r = sp->err;
if (err >= 0)
sp->err = err;
- return err;
+ return r;
}
/*
* $Log$
- * Revision 1.1 2000-03-26 00:03:30 djk
- * first cut of client
+ * Revision 1.5 2002-01-27 15:35:33 minima
+ * try to fix EOF on standard input problems
*
- * Revision 1.3 1998/01/02 19:39:59 djk
- * made various changes to cope with glibc
- * fixed problem with extended status in etsi_router
+ * Revision 1.4 2000/07/20 14:16:00 minima
+ * can use Sourceforge now!
+ * added user->qra cleaning
+ * added 4 digit qra to user broadcast dxspots if available
*
- * Revision 1.2 1997/06/18 18:44:31 djk
- * A working hayes implementation!
+ * Revision 1.3 2000/03/30 22:51:14 djk
+ * fixed connect code in client.pl so it doesn't falsely recognise /spider
+ * /src/client as a 'client' directive.
+ * Tidied up the C client a bit
*
- * Revision 1.1 1997/01/28 16:14:38 djk
- * moved these into lib as general routines to use with sel
+ * Revision 1.2 2000/03/26 14:22:59 djk
+ * removed some irrelevant log info
*
- * Revision 1.3 1997/01/15 21:23:26 djk
- * fixed a few minor svlp problems and added the router logging system
- *
- * Revision 1.2 1997/01/13 23:34:56 djk
- * The first working test version of smsd
+ * Revision 1.1 2000/03/26 00:03:30 djk
+ * first cut of client
*
* Revision 1.1 1997/01/03 23:44:31 djk
* initial workings