~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to raster/r.li/r.li.daemon/ipc.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/**
3
 
 * \file IPC.c
4
 
 *
5
 
 * \brief implementation of interprocess communication
6
 
 *      primitives between r.li.daemon and r.li.worker
7
 
 *
8
 
 *
9
 
 * This program is free software under the GPL (>=v2)
10
 
 * Read the COPYING file that comes with GRASS for details.
11
 
 *
12
 
 *
13
 
 * \author Lucio Davide Spano
14
 
 * 
15
 
 * \version 1.0
16
 
 * 
17
 
 */
18
 
 
19
 
 
20
 
#include <unistd.h>
21
 
#include <grass/gis.h>
22
 
#include <grass/glocale.h>
23
 
#include "ipc.h"
24
 
 
25
 
 
26
 
int send(int pipe, msg * m)
27
 
{
28
 
    int check;
29
 
 
30
 
    /* write on pipe */
31
 
    check = write(pipe, m, sizeof(msg));
32
 
    if (check > 0)
33
 
        return 1;
34
 
    else
35
 
        return 0;
36
 
}
37
 
 
38
 
int receive(int pipe, msg * m)
39
 
{
40
 
    return read(pipe, m, sizeof(msg));
41
 
}
42
 
 
43
 
void printMsg(msg m)
44
 
{
45
 
 
46
 
    switch (m.type) {
47
 
    case AREA:{
48
 
            G_message(_("                               AREA MESSAGE: \n \
49
 
                                aid = %i \n \
50
 
                                x = %i \n \
51
 
                                y = %i \n \
52
 
                                rl = %i \n \
53
 
                                cl = %i \n "), m.f.f_a.aid, m.f.f_a.x, m.f.f_a.y, m.f.f_a.rl, m.f.f_a.cl);
54
 
        }
55
 
        break;
56
 
    case MASKEDAREA:{
57
 
            G_message(_("                               MASKEDAREA MESSAGE: \n \
58
 
                                aid = %i \n \
59
 
                                x = %i \n \
60
 
                                y = %i \n \
61
 
                                rl = %i \n \
62
 
                                cl = %i \n \
63
 
                                mask = %s \n "),
64
 
                      m.f.f_ma.aid, m.f.f_ma.x, m.f.f_ma.y, m.f.f_ma.rl, m.f.f_ma.cl, m.f.f_ma.mask);
65
 
        }
66
 
        break;
67
 
    case DONE:{
68
 
            G_message(_("                               DONE MESSAGE: \n \
69
 
                                aid = %i \n \
70
 
                                pid = %i \n \
71
 
                                result = %f \n "), m.f.f_d.aid, m.f.f_d.pid, m.f.f_d.res);
72
 
        }
73
 
        break;
74
 
    case ERROR:{
75
 
            G_message(_("                               ERROR MESSAGE: \n \
76
 
                                aid = %i \n \
77
 
                                pid = %i \n "), m.f.f_e.aid, m.f.f_e.pid);
78
 
        }
79
 
        break;
80
 
    case TERM:{
81
 
            G_message(_("                               TERM MESSAGE: \n \
82
 
                                pid = %i \n "), m.f.f_t.pid);
83
 
        }
84
 
        break;
85
 
    }
86
 
}