-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
54 lines (45 loc) · 1.28 KB
/
main.cpp
File metadata and controls
54 lines (45 loc) · 1.28 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
OFT PHP extension
@ Team: OpenFaceTracker
@ Version: 1.0
*/
#include <phpcpp.h>
#include <iostream>
/* We are using oftlib3 */
#include <oft3/core.h>
#include <oft3/color.h>
/*
* TEST function
*/
void oftInfo(){
ft::FtUtils * oft3 = new ft::FtUtils;
const char * oftversion = "test";
oftversion = oft3->version();
/* show info */
Php::out << "OpenFaceTracker For PHP developers" << std::endl;
Php::out << "Using OFTLIB version " << oftversion << std::endl;
Php::out << "LgplV3" << std::endl;
delete oft3;
}
/**
* tell the compiler that the get_module is a pure C function
*/
extern "C" {
/**
* Function that is called by PHP right after the PHP process
* has started, and that returns an address of an internal PHP
* strucure with all the details and features of your extension
*
* @return void* a pointer to an address that is understood by PHP
*/
PHPCPP_EXPORT void *get_module()
{
// static(!) Php::Extension object that should stay in memory
// for the entire duration of the process (that's why it's static)
static Php::Extension extension("php_oft", "1.0");
/* All functions */
extension.add<oftInfo>("oftInfo");
// return the extension
return extension;
}
}