Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "common.h"
- #ifndef MODULE1_H_
- #define MODULE1_H_
- int init(int option);
- int open(char* db, char* username, char* password);
- int get(int handler, int date[2], int time[2], int* data, int& rowsize, int& numrows);
- int put(int handler, int* data, int& datasize, int& numrows);
- int close(int handler);
- int finalize();
- #endif /* MODULE1_H_ */
- #include "common.h"
- #ifndef MODULE2_H_
- #define MODULE2_H_
- int get1(int handler, int date, int time, int *data, int& datasize, int& rowsize);
- int put1(int handler, int* data, int datasize);
- #endif /*MODULE2_H_*/
- #include "module1.h"
- int init(int option) { ... }
- int finalize() { ... }
- int get(int handler, int date[2], int time[2], int* data, int& rowsize, int& numrows) {
- ....
- }
- ...
- #include "module1.h"
- #include "module2.h"
- int get1(int handler, int date, int time, int* data, int rowsize) {
- int daterange[2]={date,date};
- int timerange[2]={time,time};
- int rsize, numrows, result;
- result=get(handler, daterange,timerange, data, rsize, numrows);
- rowsize=rsize;
- if(numrows!=1) printf("Uh oh...n");
- return result;
- }
- ...
- g++ -o module1.o -c module1.cpp
- g++ -o module2.o -c module2.cpp
- g++ -fPIC -shared -o library.so module1.o module2.o
- extern "C" {
- #include "my_bits_of_C.h"
- }
Add Comment
Please, Sign In to add comment