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

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

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

  1 /*
  2   tw_iglobal.c
  3 */
  4 
  5 #include <stdio.h>
  6 #include <tina/sys.h>
  7 #include <tcl.h>
  8 #include "tclWt.h"
  9 #include "tclWtPro.h"
 10 
 11 
 12 static void iglobal_call(Tw_callback *twc)
 13 {
 14 }
 15 
 16 static void iglobal_cmnd(Tw_callback * twc, char *args)
 17 {
 18         int  *ptr = (int *)twc->data1;
 19 
 20         (void) sscanf(args, "%*s %d", ptr);
 21 }
 22 
 23 
 24 static void iglobal_prnt(FILE * fp, Tw_callback * twc)
 25 {
 26         int x = *(int *) twc->data1;
 27 
 28         (void) fprintf(fp, "%s %d\n", twc->name, x);
 29 }
 30 
 31 
 32 Tw_callback *tw_iglobal(char *name, int *ptr, int nchars)
 33 {
 34         Tcl_Interp      *interp;
 35         Tw_callback *twc;
 36         char *fullname = tw_extend_fullname(tw_get_toolname(), name);
 37         char *tclname;
 38 
 39         if ((interp = ttcl_get_interp()) == NULL)
 40                 return;
 41 
 42         twc = tw_callback_make(fullname, NULL, iglobal_call, iglobal_cmnd,
 43                                          iglobal_prnt, (void (*)()) NULL, (void *)ptr, NULL);
 44 
 45         tclname = ttcl_mkshellname(fullname, TTCLIGLOBAL);
 46         Tcl_LinkVar(interp, tclname, (char *)ptr, TCL_LINK_INT);
 47 
 48         rfree(tclname);
 49         return (twc);
 50 }
 51 
 52 void tw_iglobal_reset(Tw_callback * twc)
 53 {
 54 }
 55 

~ [ 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.