Wrapped PH7_VM_CONFIG_IMPORT_PATH
This commit is contained in:
parent
13d3d640ec
commit
2ac1f6bac8
4
cgo.c
4
cgo.c
@ -23,3 +23,7 @@ int vm_config_err_report(ph7_vm *pVm) {
|
|||||||
int vm_output_length(ph7_vm *pVm, unsigned int *pLength) {
|
int vm_output_length(ph7_vm *pVm, unsigned int *pLength) {
|
||||||
return ph7_vm_config(pVm, PH7_VM_OUTPUT_LENGTH, pLength);
|
return ph7_vm_config(pVm, PH7_VM_OUTPUT_LENGTH, pLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int vm_add_import_path(ph7_vm *pVm, const char *zIncludePath) {
|
||||||
|
return ph7_vm_config(pVm, PH7_VM_CONFIG_IMPORT_PATH, zIncludePath);
|
||||||
|
}
|
1
cgo.h
1
cgo.h
@ -5,6 +5,7 @@ int engine_config_err_log(ph7 *pEngine, const char **pzPtr, int *pLen);
|
|||||||
int vm_extract_output(ph7_vm *pVm, const char **pzPtr, int *pLen);
|
int vm_extract_output(ph7_vm *pVm, const char **pzPtr, int *pLen);
|
||||||
int vm_config_err_report(ph7_vm *pVm);
|
int vm_config_err_report(ph7_vm *pVm);
|
||||||
int vm_output_length(ph7_vm *pVm, unsigned int *pLength);
|
int vm_output_length(ph7_vm *pVm, unsigned int *pLength);
|
||||||
|
int vm_add_import_path(ph7_vm *pVm, const char *zIncludePath);
|
||||||
|
|
||||||
extern int write_vm_output(void*, unsigned int, void*);
|
extern int write_vm_output(void*, unsigned int, void*);
|
||||||
int vm_set_output_callback(ph7_vm *pVm, void *pUserData);
|
int vm_set_output_callback(ph7_vm *pVm, void *pUserData);
|
||||||
|
7
ph7.go
7
ph7.go
@ -493,7 +493,12 @@ func (vm *VM) SetOutputWriter(w io.Writer) error {
|
|||||||
return newError(C.vm_set_output_callback(vm.ptr, vm.pointerKey))
|
return newError(C.vm_set_output_callback(vm.ptr, vm.pointerKey))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO PH7_VM_CONFIG_IMPORT_PATH
|
func (vm *VM) AddImportPath(path string) error {
|
||||||
|
cpath := C.CString(path)
|
||||||
|
defer C.free(unsafe.Pointer(cpath))
|
||||||
|
return newError(C.vm_add_import_path(vm.ptr, cpath))
|
||||||
|
}
|
||||||
|
|
||||||
// TODO PH7_VM_CONFIG_RECURSION_DEPTH
|
// TODO PH7_VM_CONFIG_RECURSION_DEPTH
|
||||||
|
|
||||||
func (vm *VM) OutputLength() (uint, error) {
|
func (vm *VM) OutputLength() (uint, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user