Applied namespace renaming and formatting to PHP.
%module tinysplinephp
-// std::vector<ts::rational> to php native array
-%typemap(out) std::vector<ts::rational> * {
+// Map std::vector<tinyspline::rational> to PHP native array.
+%typemap(out) std::vector<tinyspline::rational> * {
const int size = $1->size();
array_init_size($result, size);
for (int i = 0; i < size; i++) {
}
}
-// php native array to std::vector<ts::rational>
-%typemap(in) std::vector<ts::rational> * %{
- $1 = new std::vector<ts::rational>();
+// Map PHP native array to std::vector<tinyspline::rational>.
+%typemap(in) std::vector<tinyspline::rational> * %{
+ $1 = new std::vector<tinyspline::rational>();
for (int idx = 0;; idx++) {
zval **value;
- if (zend_hash_index_find(Z_ARRVAL_P(*$input), idx,
- (void**)&value) == SUCCESS) {
+ if (zend_hash_index_find(Z_ARRVAL_P(*$input), idx, (void**)&value) == SUCCESS) {
convert_to_double_ex(value);
$1->push_back(Z_DVAL_PP(value));
} else {
}
%}
-// cleanup memory allocated by typemaps
-%typemap(freearg) std::vector<ts::rational> * {
+// Cleanup memory allocated by typemaps.
+%typemap(freearg) std::vector<tinyspline::rational> * {
delete $1;
}
//* BSpline (PHP) *
//* *
//********************************************************
-%ignore ts::BSpline::operator=;
-%ignore ts::BSpline::operator();
+%ignore tinyspline::BSpline::operator=;
+%ignore tinyspline::BSpline::operator();
//********************************************************
//* *
//* DeBoorNet (PHP) *
//* *
//********************************************************
-%ignore ts::DeBoorNet::operator=;
+%ignore tinyspline::DeBoorNet::operator=;
//********************************************************
//* *
