home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / CFLIB-11.LZH / src / comm.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-12  |  1.2 KB  |  60 lines

  1. #include "intern.h"
  2.  
  3. static char        *glob_str = NULL;
  4. static short    msg[8];
  5.  
  6. void send_vastart(int id, char *str)
  7. {
  8.     if (!glob_str)
  9.         glob_str = (char *)cf_malloc(256, "send_vastart", TRUE);
  10.         
  11.     strcpy(glob_str, str);
  12.     msg[0] = 0x4711;        /* VA_START */
  13.     msg[1] = gl_apid;
  14.     msg[2] = 0;
  15.     ol2ts((long)glob_str, &msg[3], &msg[4]);
  16.     msg[5] = 0;
  17.     msg[6] = 0;
  18.     msg[7] = 0;
  19.     appl_write(id, (int)sizeof(msg), msg);
  20. }
  21.  
  22. void send_m_special(int mode, int app)
  23. {
  24.     if (gl_magx)
  25.     {
  26.         int    id;
  27.  
  28.         msg[0] = SM_M_SPECIAL;
  29.         msg[1] = gl_apid;
  30.         msg[2] = 0;
  31.         msg[3] = 0;
  32.         msg[4] = 0x4D41;    /* 'MA' */
  33.         msg[5] = 0x4758;    /* 'GX' */
  34.         msg[6] = mode;
  35.         msg[7] = app;
  36.         id = appl_find("SCRENMGR");
  37.         appl_write(id, (int)sizeof(msg), msg);
  38.     }
  39. }
  40.  
  41. void send_scchanged(void)
  42. {
  43.     int    d, i;
  44.  
  45.     /* gibts Broadcast? */
  46.     if (((appl_xgetinfo(10, &i, &d, &d, &d)) && ((i&0x00FF) >= 7))
  47.          || (gl_magx >= 0x400))
  48.     {
  49.         msg[0] = SC_CHANGED;    /* alle anderen Applikationen */
  50.         msg[1] = gl_apid;
  51.         msg[2] = 0;
  52.         msg[3] = 0x0002;    /* Text */
  53.         msg[4] = 0x2E54;    /* '.T' */
  54.         msg[5] = 0x5845;    /* 'XT' */
  55.         msg[6] = 0;
  56.         msg[7] = 0;
  57.         shel_write(7, 0, 0, (char *)msg, NULL);
  58.     }
  59. }
  60.