http://www.cnblogs.com/hicjiajia/archive/2011/01/20/1940154.html
方式一:mkfifo("myfifo","rw");
方式二:mknod myfifo p
生成了有名管道后,就可以使用一般的文件I/O函数如open、close、read、write等来对它进行操作。下面即是一个简单的例子,假设我们已经创建了一个名为myfifo的有名管道。
1/* 进程一:读有名管道*/
2#include <stdio.h>
3#include <unistd.h>
4void main() {
5 FILE * in_file;
6 int count = 1;
7 char buf[80];
8 in_file = fopen("mypipe", "r");
9 if (in_file == NULL) {
10 printf("Error in fdopen.\n");
11 exit(1);
12 }
13 while ((count = fread(buf, 1, 80, in_file)) > 0)
14 printf("received from pipe: %s\n", buf);
15 fclose(in_file);
16}
17/* 进程二:写有名管道*/
18#include <stdio.h>
19#include <unistd.h>
20void main() {
21 FILE * out_file;
22 int count = 1;
23 char buf[80];
24 out_file = fopen("mypipe", "w");
25 if (out_file == NULL) {
26 printf("Error opening pipe.");
27 exit(1);
28 }
29 sprintf(buf,"this is test data for the named pipe example\n");
30 fwrite(buf, 1, 80, out_file);
31 fclose(out_file);
32}
33
gtk_window_set_opacity
void gtk_window_set_opacity (GtkWindow *self, gdouble opacity);
Request the windowing system to make @window partially transparent,with opacity 0 being fully transparent and 1 fully opaque. (Valuesof the opacity parameter are clamped to the [0,1] range.) On X11this has any effect only on X screens with a compositing managerrunning. See gtk_widget_is_composited(). On Windows it should workalways.Note that setting a window's opacity after the window has beenshown causes it to flicker once on Windows.