comparison quick-test.cpp @ 45:124f6d2fbaa2

Update native-code example for Piper
author Chris Cannam
date Thu, 13 Oct 2016 14:37:15 +0100
parents 873ce3bfa776
children
comparison
equal deleted inserted replaced
44:ae292da1cabe 45:124f6d2fbaa2
13 cerr << "failed to open " + example + ": " << dlerror() << endl; 13 cerr << "failed to open " + example + ": " << dlerror() << endl;
14 return 1; 14 return 1;
15 } 15 }
16 16
17 typedef const char *(*RequestFn)(const char *); 17 typedef const char *(*RequestFn)(const char *);
18 RequestFn reqFn = (RequestFn)dlsym(lib, "vampipeRequestJson"); 18 RequestFn reqFn = (RequestFn)dlsym(lib, "piperRequestJson");
19 if (!reqFn) { 19 if (!reqFn) {
20 cerr << "failed to find request function in " + 20 cerr << "failed to find request function in " +
21 example + ": " << dlerror() << endl; 21 example + ": " << dlerror() << endl;
22 return 1; 22 return 1;
23 } 23 }
24 24
25 typedef void (*FreeFn)(const char *); 25 typedef void (*FreeFn)(const char *);
26 FreeFn freeFn = (FreeFn)dlsym(lib, "vampipeFreeJson"); 26 FreeFn freeFn = (FreeFn)dlsym(lib, "piperFreeJson");
27 if (!freeFn) { 27 if (!freeFn) {
28 cerr << "failed to find free function in " + 28 cerr << "failed to find free function in " +
29 example + ": " << dlerror() << endl; 29 example + ": " << dlerror() << endl;
30 return 1; 30 return 1;
31 } 31 }