~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/TCLwidgets/tcl_serialise.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2   tcl_serialise.c
  3 */
  4 
  5 #include <stdio.h>
  6 #include <tina/sys.h>
  7 #include <tina/sysfuncs.h>
  8 #include <tcl.h>
  9 #include "tclWt.h"
 10 #include "tclWtPro.h"
 11 
 12 
 13 static int ttcl_sndfromtos(ClientData clientdata, Tcl_Interp *interp, 
 14                          int argc, char **argv)
 15 {
 16         Imrect  *im;
 17         int      type, fd;
 18 
 19 
 20         if (argc != 2)
 21         {
 22                 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
 23                                                                                  " sock ", (char *) NULL);
 24                 return TCL_ERROR;
 25         }
 26 
 27         if (sscanf(argv[1], "sock%d", &fd) != 1)
 28                 return TCL_ERROR;
 29 
 30         if ((im = (Imrect *) stack_inspect(&type)) == NULL)
 31                 return TCL_ERROR;
 32 
 33         define_all_ts_handlers();
 34         repeatp_checker_off();
 35         ts_swrite(im, fd);
 36         
 37   return TCL_OK;
 38 }
 39 
 40 
 41 static int ttcl_rcvtotos(ClientData clientdata, Tcl_Interp *interp, 
 42                          int argc, char **argv)
 43 {
 44         Imrect  *im;
 45         int      fd;
 46 
 47         if (argc != 2)
 48         {
 49                 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
 50                                                                                  " sock ", (char *) NULL);
 51                 return TCL_ERROR;
 52         }
 53 
 54         if (sscanf(argv[1], "sock%d", &fd) != 1)
 55                 return TCL_ERROR;
 56 
 57         define_all_ts_handlers();
 58         repeatp_checker_off();
 59         ts_sread(&im, fd); 
 60         
 61         stack_push((void *)im, IMRECT, im_free);
 62 
 63   return TCL_OK;
 64 }
 65 
 66 
 67 int    Tcl_SerialiseInit(Tcl_Interp *interp)
 68 {
 69         if (!interp)
 70                 return TCL_ERROR;
 71 
 72   Tcl_CreateCommand(interp, "ts_sndfromtos", ttcl_sndfromtos, (ClientData)NULL, 
 73                         (Tcl_CmdDeleteProc *) NULL);
 74 
 75   Tcl_CreateCommand(interp, "ts_rcvtotos", ttcl_rcvtotos, (ClientData)NULL, 
 76                         (Tcl_CmdDeleteProc *) NULL);
 77 
 78   return TCL_OK;
 79 }
 80 
 81 
 82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.