summaryrefslogtreecommitdiffstats
path: root/files/Module/module.c
blob: ba97fe7e8c76f14abffb33a4450a584d0426eb05 (plain)
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
28
29
30
31
32
33
/*
  R.Pollak
  Trigger example in C
  to compile
  gcc -shared -fPIC -o module.so -g -Wall module.c

  on the trigger the ent structure is passed and whether the trigger was on Write or on Read. Write trigger, when it was written to selected cells,
  or Read from selected cells.
*/

#include <stdio.h>

#include "sc.h"
#include "macros.h"
#include "utils/dictionary.h"
#include "utils/string.h"
#include "range.h"
#include "color.h"
#include "screen.h"
#include "undo.h"
#include "conf.h"
#include "cmds.h"
#include "trigger.h"

extern char * query(char * );

int do_c_call(struct ent *p , int rw) {
    FILE *fd = fopen("/tmp/modul.txt","a+");
    fprintf(fd,"%d %d %g %d\n",p->col,p->row,p->v,rw);
    fclose(fd);

    return(0);
}