From d81f45d6e4783c4915382390f480442995710546 Mon Sep 17 00:00:00 2001 From: rupak19 Date: Fri, 10 Apr 2020 14:39:58 +0530 Subject: corrected function names --- jar/scilab_en_US_help.jar | Bin 15496 -> 15496 bytes macros/add.bin | Bin 1983 -> 1983 bytes macros/multiply.bin | Bin 1785 -> 1785 bytes sci_gateway/cpp/builder_gateway_cpp.sce | 2 +- sci_gateway/cpp/libtest_toolbox.so | Bin 16712 -> 16712 bytes sci_gateway/cpp/sci_multiply.cpp | 4 ++-- src/Makefile | 8 ++++---- src/add.c | 10 ---------- src/add.h | 1 - src/add.o | Bin 1400 -> 0 bytes src/libadd.so | Bin 15640 -> 0 bytes src/libmul.so | Bin 0 -> 15640 bytes src/main.c | 4 ++-- src/mul.c | 10 ++++++++++ src/mul.h | 1 + src/mul.o | Bin 0 -> 1400 bytes src/run.sh | 8 ++++---- src/testadd | Bin 19344 -> 0 bytes src/testmul | Bin 0 -> 19344 bytes thirdparty/linux/include/add.h | 1 - thirdparty/linux/include/mul.h | 1 + thirdparty/linux/lib/x64/libadd.so | Bin 15640 -> 0 bytes thirdparty/linux/lib/x64/libmul.so | Bin 0 -> 15640 bytes 23 files changed, 25 insertions(+), 25 deletions(-) delete mode 100755 src/add.c delete mode 100755 src/add.h delete mode 100644 src/add.o delete mode 100755 src/libadd.so create mode 100755 src/libmul.so create mode 100755 src/mul.c create mode 100755 src/mul.h create mode 100644 src/mul.o delete mode 100755 src/testadd create mode 100755 src/testmul delete mode 100755 thirdparty/linux/include/add.h create mode 100755 thirdparty/linux/include/mul.h delete mode 100755 thirdparty/linux/lib/x64/libadd.so create mode 100755 thirdparty/linux/lib/x64/libmul.so diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar index 3c9feee..4ab4a7d 100644 Binary files a/jar/scilab_en_US_help.jar and b/jar/scilab_en_US_help.jar differ diff --git a/macros/add.bin b/macros/add.bin index 23b5bbb..60b6406 100644 Binary files a/macros/add.bin and b/macros/add.bin differ diff --git a/macros/multiply.bin b/macros/multiply.bin index 20905f1..1f2876a 100644 Binary files a/macros/multiply.bin and b/macros/multiply.bin differ diff --git a/sci_gateway/cpp/builder_gateway_cpp.sce b/sci_gateway/cpp/builder_gateway_cpp.sce index 32d8db9..44c8410 100755 --- a/sci_gateway/cpp/builder_gateway_cpp.sce +++ b/sci_gateway/cpp/builder_gateway_cpp.sce @@ -56,7 +56,7 @@ else//LINUX C_Flags = ["-I"+inc_base_dir]; - Linker_Flag = ["-L" + lib_base_dir + " -ladd -Wl,-rpath="+lib_base_dir] + Linker_Flag = ["-L" + lib_base_dir + " -lmul -Wl,-rpath="+lib_base_dir] end diff --git a/sci_gateway/cpp/libtest_toolbox.so b/sci_gateway/cpp/libtest_toolbox.so index 582de0f..d92bb2b 100755 Binary files a/sci_gateway/cpp/libtest_toolbox.so and b/sci_gateway/cpp/libtest_toolbox.so differ diff --git a/sci_gateway/cpp/sci_multiply.cpp b/sci_gateway/cpp/sci_multiply.cpp index 4aece25..5447dc7 100755 --- a/sci_gateway/cpp/sci_multiply.cpp +++ b/sci_gateway/cpp/sci_multiply.cpp @@ -14,7 +14,7 @@ extern "C" #include #include #include "localization.h" -#include "add.h" +#include "mul.h" @@ -43,7 +43,7 @@ if (nout != 1) scilab_getDoubleArray(env, in[0], &in1); scilab_getDoubleArray(env, in[1], &in2); - add(ar, in1[0],in2[0]); + mul(ar, in1[0],in2[0]); out[0] = scilab_createDoubleMatrix2d(env, 1, 1, 0); scilab_getDoubleArray(env, out[0], &out1); diff --git a/src/Makefile b/src/Makefile index d4719ac..430a48d 100755 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -LIBNAME = add +LIBNAME = mul all: lib$(LIBNAME).so test$(LIBNAME) @@ -8,12 +8,12 @@ $(LIBNAME).o: $(LIBNAME).h $(LIBNAME).c lib$(LIBNAME).so: $(LIBNAME).o gcc -shared -o lib$(LIBNAME).so $(LIBNAME).o -test$(LIBNAME): lib$(LIBNAME).so main.c add.h +test$(LIBNAME): lib$(LIBNAME).so main.c mul.h gcc -Wall -L$(PWD) -Wl,-rpath=$(PWD) -o $@ main.c -l$(LIBNAME) -g install: - cp add.h ../thirdparty/linux/include/ - cp libadd.so ../thirdparty/linux/lib/x64/ + cp mul.h ../thirdparty/linux/include/ + cp libmul.so ../thirdparty/linux/lib/x64/ .PHONY: clean clean: diff --git a/src/add.c b/src/add.c deleted file mode 100755 index 0fddbac..0000000 --- a/src/add.c +++ /dev/null @@ -1,10 +0,0 @@ -/*This c program multiplies two variable values*/ -#include -#include -#include "add.h" -int add(double* answ, double num1, double num2) -{ - answ[0] = num1*num2; - //printf("Inside add %f \n", answ[0]); - return 0; -} diff --git a/src/add.h b/src/add.h deleted file mode 100755 index db62457..0000000 --- a/src/add.h +++ /dev/null @@ -1 +0,0 @@ -int add(double* answ, double num1, double num2); diff --git a/src/add.o b/src/add.o deleted file mode 100644 index 8ddb9e5..0000000 Binary files a/src/add.o and /dev/null differ diff --git a/src/libadd.so b/src/libadd.so deleted file mode 100755 index 003d417..0000000 Binary files a/src/libadd.so and /dev/null differ diff --git a/src/libmul.so b/src/libmul.so new file mode 100755 index 0000000..ccaf3ba Binary files /dev/null and b/src/libmul.so differ diff --git a/src/main.c b/src/main.c index 6c95040..da08200 100755 --- a/src/main.c +++ b/src/main.c @@ -1,9 +1,9 @@ #include -#include "add.h" +#include "mul.h" int main(void) { double ar[1]; - add(ar, 2,5); + mul(ar, 2,5); printf("Inside main %f \n", ar[0]); return 0; } diff --git a/src/mul.c b/src/mul.c new file mode 100755 index 0000000..237da4b --- /dev/null +++ b/src/mul.c @@ -0,0 +1,10 @@ +/*This c program multiplies two variable values*/ +#include +#include +#include "mul.h" +int mul(double* answ, double num1, double num2) +{ + answ[0] = num1*num2; + //printf("Inside add %f \n", answ[0]); + return 0; +} diff --git a/src/mul.h b/src/mul.h new file mode 100755 index 0000000..8c29db3 --- /dev/null +++ b/src/mul.h @@ -0,0 +1 @@ +int mul(double* answ, double num1, double num2); diff --git a/src/mul.o b/src/mul.o new file mode 100644 index 0000000..e08a1cb Binary files /dev/null and b/src/mul.o differ diff --git a/src/run.sh b/src/run.sh index 729b991..1ac4b33 100755 --- a/src/run.sh +++ b/src/run.sh @@ -1,8 +1,8 @@ rm *.o *.so *.lib test -gcc -fPIC -c add.c -gcc -shared -o libadd.so add.o +gcc -fPIC -c mul.c +gcc -shared -o libadd.so mul.o gcc -L$(pwd) -Wl,-rpath=$(pwd) -o test main.c -ladd -g -cp add.h ../thirdparty/linux/include/ -cp libadd.so ../thirdparty/linux/lib/x64/ +cp mul.h ../thirdparty/linux/include/ +cp libmul.so ../thirdparty/linux/lib/x64/ diff --git a/src/testadd b/src/testadd deleted file mode 100755 index 8990420..0000000 Binary files a/src/testadd and /dev/null differ diff --git a/src/testmul b/src/testmul new file mode 100755 index 0000000..af34920 Binary files /dev/null and b/src/testmul differ diff --git a/thirdparty/linux/include/add.h b/thirdparty/linux/include/add.h deleted file mode 100755 index db62457..0000000 --- a/thirdparty/linux/include/add.h +++ /dev/null @@ -1 +0,0 @@ -int add(double* answ, double num1, double num2); diff --git a/thirdparty/linux/include/mul.h b/thirdparty/linux/include/mul.h new file mode 100755 index 0000000..8c29db3 --- /dev/null +++ b/thirdparty/linux/include/mul.h @@ -0,0 +1 @@ +int mul(double* answ, double num1, double num2); diff --git a/thirdparty/linux/lib/x64/libadd.so b/thirdparty/linux/lib/x64/libadd.so deleted file mode 100755 index 003d417..0000000 Binary files a/thirdparty/linux/lib/x64/libadd.so and /dev/null differ diff --git a/thirdparty/linux/lib/x64/libmul.so b/thirdparty/linux/lib/x64/libmul.so new file mode 100755 index 0000000..ccaf3ba Binary files /dev/null and b/thirdparty/linux/lib/x64/libmul.so differ -- cgit