From d1b9c27a403fb2ac9e69e82ebea32722c6795daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Fri, 16 Jul 2021 10:55:51 +0800 Subject: SWIG files, therefore deprecating Pikul-XS --- pikul.i | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pikul.i (limited to 'pikul.i') diff --git a/pikul.i b/pikul.i new file mode 100644 index 0000000..b00709e --- /dev/null +++ b/pikul.i @@ -0,0 +1,28 @@ +%module Pikul +%{ +#include "pikul.h" +%} + +%typemap(in) char *[] { + AV *tempav = (AV *)SvRV($input); + I32 len = av_len(tempav); + $1 = (char **)malloc((len + 2) * sizeof(char *)); + int i; + for (i = 0; i <= len; i++) { + SV **tv = av_fetch(tempav, i, 0); + $1[i] = (char *)SvPV(*tv, PL_na); + } + $1[i] = NULL; +}; +%typemap(freearg) char *[] { + free($1); +} + +%rename("%(strip:[pikul_])s") ""; +void pikul_init(enum pikul_company company, char *provisions[]); +double pikul_cost(const char *origin, const char *destination, double weight, const char *service); +char *pikul_order(const char *trx_id, const char *service, const char *sender_name, + const char *sender_phone, const char *origin, const char *sender_address, + const char *receiver_name, const char *receiver_phone, const char *destination, + const char *receiver_address, int nitems, char **items[], double value); +void pikul_cleanup(); -- cgit v1.2.3