File: module.c

package info (click to toggle)
sc-im 0.8.5%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,972 kB
  • sloc: lisp: 32,533; ansic: 19,618; yacc: 1,489; xml: 518; sh: 410; makefile: 307; sed: 4
file content (34 lines) | stat: -rw-r--r-- 776 bytes parent folder | download | duplicates (2)
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
34
/*
  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.

  Trigger functions return non-zero return value on error.
*/

#include <stdio.h>

#include "sc.h"
#include "macros.h"
#include "utils/dictionary.h"
#include "utils/string.h"
#include "range.h"
#include "color.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);
}