File: SendText.c

package info (click to toggle)
fvwm95 2.0.43ba-22
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,904 kB
  • ctags: 4,760
  • sloc: ansic: 46,436; makefile: 1,589; sh: 780; perl: 328
file content (27 lines) | stat: -rw-r--r-- 599 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>

/************************************************************************
 *
 * Sends arbitrary text to fvwm
 *
 ***********************************************************************/
void SendText(int *fd,char *message,unsigned long window)
{
  int w;
  
  if(message != NULL)
    {
      write(fd[0],&window, sizeof(unsigned long));
      
      w=strlen(message);
      write(fd[0],&w,sizeof(int));
      write(fd[0],message,w);
      
      /* keep going */
      w = 1;
      write(fd[0],&w,sizeof(int));
    }
}