]> git.sesse.net Git - nms/blob - web/ext/graph.i
Update make-switches.pl for TG07.
[nms] / web / ext / graph.i
1 %module mygraph
2 %{
3 #include "graph.c"
4 %}
5
6 %inline
7 %{
8   // Add some helper functions for C arrays
9   int *int_array(int size) {
10     return (int *) malloc(sizeof(int)*size);
11   }
12   void int_destroy(int *a) {
13     free(a);
14   }
15   void int_set(int *a, int i, int val) {
16     a[i] = val;
17   }
18   int int_get(int *a, int i) {
19     return a[i];
20   }
21 %}
22
23 graph *mygraph_new (int width, int height);
24 graph *mygraph_make_graph (graph *mygraph, float min_x,
25                            float max_x, float min_y, float max_y, int tickgran);
26 void mygraph_cleanup (graph *mygraph);
27 void mygraph_to_file (graph *mygraph, char *filename);
28 void mygraph_plot_series (graph *mygraph, int *xvals, int *yvals, int n_vals,
29                           float r, float g, float b);