diff options
65 files changed, 1154 insertions, 0 deletions
diff --git a/includes/sci2clib.h b/includes/sci2clib.h index 3dc5820..65533aa 100644 --- a/includes/sci2clib.h +++ b/includes/sci2clib.h @@ -187,6 +187,30 @@ #include "int16.h" #include "int_int16.h" +/*interfacing bitand */ +#include "bitand.h" +#include "int_bitand.h" + +/*interfacing bitor */ +#include "bitor.h" +#include "int_bitor.h" + +/*interfacing bitxor */ +#include "bitxor.h" +#include "int_bitxor.h" + +/*interfacing bitcmp */ +#include "bitcmp.h" +#include "int_bitcmp.h" + +/*interfacing bitset */ +#include "bitset.h" +#include "int_bitset.h" + +/*interfacing bitget */ +#include "bitget.h" +#include "int_bitget.h" + /* IMPLICIT LISTS */ /* interfacing implicitList/OpColon */ @@ -329,6 +353,12 @@ #include "types.h" +/* STRING*? +/* interface for String */ +#include "int_string.h" +/*include for string */ +#include "str.h" + /*Scilab-arduino toolbox*/ #ifdef Arduino1 #include "int_cmd_digital_out.h" @@ -344,6 +374,10 @@ #include "cmd_dcmotor_setup.h" #include "int_sleep.h" #include "sleep.h" +#include "cmd_servo_attach.h" +#include "cmd_servo_detach.h" +#include "cmd_servo_move.h" +#include "int_cmd_servo.h" #endif /*AVR*/ diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 55c43ad..e832b83 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -557,6 +557,157 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+// -------------------
+// --- Class bitand. ---
+// -------------------
+ClassName = 'bitand';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+
+
+PrintStringInfo('u80u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u82u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u160u160'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('u162u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'bitand';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'bitor';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'bitxor';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+// -------------------
+// --- Class bitcmp. ---
+// -------------------
+ClassName = 'bitcmp';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+
+
+PrintStringInfo('u80d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u82d0'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u160d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('u162d0'+ArgSeparator+'u162',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'bitcmp';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+// -------------------
+// --- Class bitset. ---
+// -------------------
+ClassName = 'bitset';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+
+
+PrintStringInfo('u80d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u160d0d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'bitset';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+// -------------------
+// --- Class bitget. ---
+// -------------------
+ClassName = 'bitget';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+
+
+PrintStringInfo('u80d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u160d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'bitget';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
// ------------------
// --- Class Sign ---
// ------------------
@@ -976,6 +1127,7 @@ PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y'); PrintStringInfo('c0c0'+ArgSeparator+'c0',ClassFileName,'file','y');
PrintStringInfo('c0s0'+ArgSeparator+'c0',ClassFileName,'file','y');
PrintStringInfo('z0d0'+ArgSeparator+'z0',ClassFileName,'file','y');
+
PrintStringInfo('s2s0'+ArgSeparator+'s0',ClassFileName,'file','y'); //* possible ? */
PrintStringInfo('d2d0'+ArgSeparator+'d0',ClassFileName,'file','y'); //* possible ? */
PrintStringInfo('c2s0'+ArgSeparator+'c0',ClassFileName,'file','y'); //* possible ? */
@@ -2061,6 +2213,7 @@ PrintStringInfo('i162i162'+ArgSeparator+'i162',ClassFileName,'file','y'); // --- Annotation Function And Function List Function. ---
+
FunctionName = 'OpMinus'; // AS : Done AS : Float_Done
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
@@ -3761,6 +3914,7 @@ PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y'); PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('u80u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+
PrintStringInfo('u80u82'+ArgSeparator+'u82',ClassFileName,'file','y');
PrintStringInfo('u82u80'+ArgSeparator+'u82',ClassFileName,'file','y');
PrintStringInfo('u82u82'+ArgSeparator+'u82',ClassFileName,'file','y');
diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 9001005..2678d9e 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -87,6 +87,12 @@ function allHeaders = getAllHeaders(OutFormat) "src/c/elementaryFunctions/includes/lnp1m1.h" "src/c/elementaryFunctions/includes/tanh.h" "src/c/elementaryFunctions/includes/sqrt.h" + "src/c/elementaryFunctions/includes/bitand.h" + "src/c/elementaryFunctions/includes/bitor.h" + "src/c/elementaryFunctions/includes/bitxor.h" + "src/c/elementaryFunctions/includes/bitcmp.h" + "src/c/elementaryFunctions/includes/bitset.h" + "src/c/elementaryFunctions/includes/bitget.h" "src/c/elementaryFunctions/includes/asinh.h" "src/c/elementaryFunctions/includes/atan2.h" "src/c/elementaryFunctions/includes/atanh.h" diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index aa6776c..649210b 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -77,6 +77,12 @@ function allInterfaces = getAllInterfaces(OutFormat) "src/c/elementaryFunctions/interfaces/int_asin.h" "src/c/elementaryFunctions/interfaces/int_atan.h" "src/c/elementaryFunctions/interfaces/int_ceil.h" + "src/c/elementaryFunctions/interfaces/int_bitand.h" + "src/c/elementaryFunctions/interfaces/int_bitor.h" + "src/c/elementaryFunctions/interfaces/int_bitxor.h" + "src/c/elementaryFunctions/interfaces/int_bitcmp.h" + "src/c/elementaryFunctions/interfaces/int_bitset.h" + "src/c/elementaryFunctions/interfaces/int_bitget.h" "src/c/elementaryFunctions/interfaces/int_cosh.h" "src/c/elementaryFunctions/interfaces/int_uint8.h" "src/c/elementaryFunctions/interfaces/int_int8.h" diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index e8b86c4..0dc0fde 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -570,6 +570,26 @@ function allSources = getAllSources(OutFormat) "src/c/elementaryFunctions/int16/i8int16a.c" "src/c/elementaryFunctions/int16/u16int16s.c" "src/c/elementaryFunctions/int16/u16int16a.c" + "src/c/elementaryFunctions/bitand/u8bitands.c" + "src/c/elementaryFunctions/bitand/u8bitanda.c" + "src/c/elementaryFunctions/bitand/u16bitands.c" + "src/c/elementaryFunctions/bitand/u16bitanda.c" + "src/c/elementaryFunctions/bitor/u8bitors.c" + "src/c/elementaryFunctions/bitor/u8bitora.c" + "src/c/elementaryFunctions/bitor/u16bitors.c" + "src/c/elementaryFunctions/bitor/u16bitora.c" + "src/c/elementaryFunctions/bitxor/u8bitxors.c" + "src/c/elementaryFunctions/bitxor/u8bitxora.c" + "src/c/elementaryFunctions/bitxor/u16bitxors.c" + "src/c/elementaryFunctions/bitxor/u16bitxora.c" + "src/c/elementaryFunctions/bitcmp/u8bitcmps.c" + "src/c/elementaryFunctions/bitcmp/u8bitcmpa.c" + "src/c/elementaryFunctions/bitcmp/u16bitcmps.c" + "src/c/elementaryFunctions/bitcmp/u16bitcmpa.c" + "src/c/elementaryFunctions/bitset/u8bitsets.c" + "src/c/elementaryFunctions/bitset/u16bitsets.c" + "src/c/elementaryFunctions/bitget/u8bitgets.c" + "src/c/elementaryFunctions/bitget/u16bitgets.c" "src/c/statisticsFunctions/max/dmaxa.c" "src/c/statisticsFunctions/max/smaxa.c" "src/c/statisticsFunctions/max/srowmaxa.c" diff --git a/src/c/elementaryFunctions/bitand/u16bitanda.c b/src/c/elementaryFunctions/bitand/u16bitanda.c new file mode 100644 index 0000000..743161e --- /dev/null +++ b/src/c/elementaryFunctions/bitand/u16bitanda.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u16bitanda(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitand/u16bitands.c b/src/c/elementaryFunctions/bitand/u16bitands.c new file mode 100644 index 0000000..7ba73c1 --- /dev/null +++ b/src/c/elementaryFunctions/bitand/u16bitands.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint16 u16bitands(uint16 x,uint16 y) +{ + return (x & y); + +} diff --git a/src/c/elementaryFunctions/bitand/u8bitanda.c b/src/c/elementaryFunctions/bitand/u8bitanda.c new file mode 100644 index 0000000..e1260a7 --- /dev/null +++ b/src/c/elementaryFunctions/bitand/u8bitanda.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u8bitanda(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitand/u8bitands.c b/src/c/elementaryFunctions/bitand/u8bitands.c new file mode 100644 index 0000000..eda3ccc --- /dev/null +++ b/src/c/elementaryFunctions/bitand/u8bitands.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint8 u8bitands(uint8 x,uint8 y) +{ + return (x & y); + +} diff --git a/src/c/elementaryFunctions/bitcmp/u16bitcmpa.c b/src/c/elementaryFunctions/bitcmp/u16bitcmpa.c new file mode 100644 index 0000000..5581371 --- /dev/null +++ b/src/c/elementaryFunctions/bitcmp/u16bitcmpa.c @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +void u16bitcmpa(uint16 *x,uint16 y,int size,uint16* out) +{ + int i=0; + for(i=0;i<size;i++) + { + out[i] = u16bitcmps(x[i],y); + + } + + +} + + diff --git a/src/c/elementaryFunctions/bitcmp/u16bitcmps.c b/src/c/elementaryFunctions/bitcmp/u16bitcmps.c new file mode 100644 index 0000000..1981690 --- /dev/null +++ b/src/c/elementaryFunctions/bitcmp/u16bitcmps.c @@ -0,0 +1,11 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +uint16 u16bitcmps(uint16 x,uint16 y) +{ + unsigned char temp = x; + return (~x); + +} + + diff --git a/src/c/elementaryFunctions/bitcmp/u8bitcmpa.c b/src/c/elementaryFunctions/bitcmp/u8bitcmpa.c new file mode 100644 index 0000000..67bde28 --- /dev/null +++ b/src/c/elementaryFunctions/bitcmp/u8bitcmpa.c @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +void u8bitcmpa(uint8 *x,uint8 y,int size,uint8* out) +{ + int i=0; + for(i=0;i<size;i++) + { + out[i] = u8bitcmps(x[i],y); + + } + + +} + + diff --git a/src/c/elementaryFunctions/bitcmp/u8bitcmps.c b/src/c/elementaryFunctions/bitcmp/u8bitcmps.c new file mode 100644 index 0000000..2a030d9 --- /dev/null +++ b/src/c/elementaryFunctions/bitcmp/u8bitcmps.c @@ -0,0 +1,11 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +uint8 u8bitcmps(uint8 x,uint8 y) +{ + unsigned char temp = x; + return (~x); + +} + + diff --git a/src/c/elementaryFunctions/bitget/u16bitgets.c b/src/c/elementaryFunctions/bitget/u16bitgets.c new file mode 100644 index 0000000..20593bf --- /dev/null +++ b/src/c/elementaryFunctions/bitget/u16bitgets.c @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint16 u16bitgets(uint16 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint16 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/src/c/elementaryFunctions/bitget/u16bitgets.c~ b/src/c/elementaryFunctions/bitget/u16bitgets.c~ new file mode 100644 index 0000000..20593bf --- /dev/null +++ b/src/c/elementaryFunctions/bitget/u16bitgets.c~ @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint16 u16bitgets(uint16 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint16 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/src/c/elementaryFunctions/bitget/u8bitgets.c b/src/c/elementaryFunctions/bitget/u8bitgets.c new file mode 100644 index 0000000..130bff8 --- /dev/null +++ b/src/c/elementaryFunctions/bitget/u8bitgets.c @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint8 u8bitgets(uint8 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint8 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/src/c/elementaryFunctions/bitget/u8bitgets.c~ b/src/c/elementaryFunctions/bitget/u8bitgets.c~ new file mode 100644 index 0000000..130bff8 --- /dev/null +++ b/src/c/elementaryFunctions/bitget/u8bitgets.c~ @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint8 u8bitgets(uint8 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint8 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/src/c/elementaryFunctions/bitor/dbitanda.c~ b/src/c/elementaryFunctions/bitor/dbitanda.c~ new file mode 100644 index 0000000..d411e6e --- /dev/null +++ b/src/c/elementaryFunctions/bitor/dbitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void dbitanda(double* x,double* y,int size,double* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = dbitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitor/dbitands.c~ b/src/c/elementaryFunctions/bitor/dbitands.c~ new file mode 100644 index 0000000..a66e3c1 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/dbitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +double dbitands(double x,double y) +{ + return ((int)x & (int)y); + +} diff --git a/src/c/elementaryFunctions/bitor/u16bitanda.c~ b/src/c/elementaryFunctions/bitor/u16bitanda.c~ new file mode 100644 index 0000000..743161e --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u16bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u16bitanda(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitor/u16bitands.c~ b/src/c/elementaryFunctions/bitor/u16bitands.c~ new file mode 100644 index 0000000..7ba73c1 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u16bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint16 u16bitands(uint16 x,uint16 y) +{ + return (x & y); + +} diff --git a/src/c/elementaryFunctions/bitor/u16bitora.c b/src/c/elementaryFunctions/bitor/u16bitora.c new file mode 100644 index 0000000..84722e1 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u16bitora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u16bitora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitor/u16bitora.c~ b/src/c/elementaryFunctions/bitor/u16bitora.c~ new file mode 100644 index 0000000..84722e1 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u16bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u16bitora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitor/u16bitors.c b/src/c/elementaryFunctions/bitor/u16bitors.c new file mode 100644 index 0000000..e48e300 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u16bitors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint16 u16bitors(uint16 x,uint16 y) +{ + return (x | y); + +} diff --git a/src/c/elementaryFunctions/bitor/u16bitors.c~ b/src/c/elementaryFunctions/bitor/u16bitors.c~ new file mode 100644 index 0000000..e48e300 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u16bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint16 u16bitors(uint16 x,uint16 y) +{ + return (x | y); + +} diff --git a/src/c/elementaryFunctions/bitor/u8bitanda.c~ b/src/c/elementaryFunctions/bitor/u8bitanda.c~ new file mode 100644 index 0000000..e1260a7 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u8bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u8bitanda(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitor/u8bitands.c~ b/src/c/elementaryFunctions/bitor/u8bitands.c~ new file mode 100644 index 0000000..eda3ccc --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u8bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint8 u8bitands(uint8 x,uint8 y) +{ + return (x & y); + +} diff --git a/src/c/elementaryFunctions/bitor/u8bitora.c b/src/c/elementaryFunctions/bitor/u8bitora.c new file mode 100644 index 0000000..edda9bb --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u8bitora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u8bitora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitor/u8bitora.c~ b/src/c/elementaryFunctions/bitor/u8bitora.c~ new file mode 100644 index 0000000..edda9bb --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u8bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u8bitora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitor/u8bitors.c b/src/c/elementaryFunctions/bitor/u8bitors.c new file mode 100644 index 0000000..56d3540 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u8bitors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint8 u8bitors(uint8 x,uint8 y) +{ + return (x | y); + +} diff --git a/src/c/elementaryFunctions/bitor/u8bitors.c~ b/src/c/elementaryFunctions/bitor/u8bitors.c~ new file mode 100644 index 0000000..56d3540 --- /dev/null +++ b/src/c/elementaryFunctions/bitor/u8bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint8 u8bitors(uint8 x,uint8 y) +{ + return (x | y); + +} diff --git a/src/c/elementaryFunctions/bitset/u16bitsets.c b/src/c/elementaryFunctions/bitset/u16bitsets.c new file mode 100644 index 0000000..953e46c --- /dev/null +++ b/src/c/elementaryFunctions/bitset/u16bitsets.c @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint16 u16bitsets(uint16 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/src/c/elementaryFunctions/bitset/u16bitsets.c~ b/src/c/elementaryFunctions/bitset/u16bitsets.c~ new file mode 100644 index 0000000..953e46c --- /dev/null +++ b/src/c/elementaryFunctions/bitset/u16bitsets.c~ @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint16 u16bitsets(uint16 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/src/c/elementaryFunctions/bitset/u8bitsets.c b/src/c/elementaryFunctions/bitset/u8bitsets.c new file mode 100644 index 0000000..5f44dcd --- /dev/null +++ b/src/c/elementaryFunctions/bitset/u8bitsets.c @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint8 u8bitsets(uint8 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/src/c/elementaryFunctions/bitset/u8bitsets.c~ b/src/c/elementaryFunctions/bitset/u8bitsets.c~ new file mode 100644 index 0000000..5f44dcd --- /dev/null +++ b/src/c/elementaryFunctions/bitset/u8bitsets.c~ @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint8 u8bitsets(uint8 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/src/c/elementaryFunctions/bitxor/dbitanda.c~ b/src/c/elementaryFunctions/bitxor/dbitanda.c~ new file mode 100644 index 0000000..d411e6e --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/dbitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void dbitanda(double* x,double* y,int size,double* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = dbitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/dbitands.c~ b/src/c/elementaryFunctions/bitxor/dbitands.c~ new file mode 100644 index 0000000..a66e3c1 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/dbitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +double dbitands(double x,double y) +{ + return ((int)x & (int)y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u16bitanda.c~ b/src/c/elementaryFunctions/bitxor/u16bitanda.c~ new file mode 100644 index 0000000..743161e --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u16bitanda(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u16bitands.c~ b/src/c/elementaryFunctions/bitxor/u16bitands.c~ new file mode 100644 index 0000000..7ba73c1 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint16 u16bitands(uint16 x,uint16 y) +{ + return (x & y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u16bitora.c~ b/src/c/elementaryFunctions/bitxor/u16bitora.c~ new file mode 100644 index 0000000..84722e1 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u16bitora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u16bitors.c~ b/src/c/elementaryFunctions/bitxor/u16bitors.c~ new file mode 100644 index 0000000..e48e300 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint16 u16bitors(uint16 x,uint16 y) +{ + return (x | y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u16bitxora.c b/src/c/elementaryFunctions/bitxor/u16bitxora.c new file mode 100644 index 0000000..6f50f06 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitxora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u16bitxora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitxors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u16bitxora.c~ b/src/c/elementaryFunctions/bitxor/u16bitxora.c~ new file mode 100644 index 0000000..6f50f06 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitxora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u16bitxora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitxors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u16bitxors.c b/src/c/elementaryFunctions/bitxor/u16bitxors.c new file mode 100644 index 0000000..03ca8f8 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitxors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint16 u16bitxors(uint16 x,uint16 y) +{ + return (x ^ y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u16bitxors.c~ b/src/c/elementaryFunctions/bitxor/u16bitxors.c~ new file mode 100644 index 0000000..03ca8f8 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u16bitxors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint16 u16bitxors(uint16 x,uint16 y) +{ + return (x ^ y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u8bitanda.c~ b/src/c/elementaryFunctions/bitxor/u8bitanda.c~ new file mode 100644 index 0000000..e1260a7 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u8bitanda(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitands(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u8bitands.c~ b/src/c/elementaryFunctions/bitxor/u8bitands.c~ new file mode 100644 index 0000000..eda3ccc --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint8 u8bitands(uint8 x,uint8 y) +{ + return (x & y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u8bitora.c~ b/src/c/elementaryFunctions/bitxor/u8bitora.c~ new file mode 100644 index 0000000..edda9bb --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u8bitora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u8bitors.c~ b/src/c/elementaryFunctions/bitxor/u8bitors.c~ new file mode 100644 index 0000000..56d3540 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint8 u8bitors(uint8 x,uint8 y) +{ + return (x | y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u8bitxora.c b/src/c/elementaryFunctions/bitxor/u8bitxora.c new file mode 100644 index 0000000..ad7cc24 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitxora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u8bitxora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitxors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u8bitxora.c~ b/src/c/elementaryFunctions/bitxor/u8bitxora.c~ new file mode 100644 index 0000000..ad7cc24 --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitxora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u8bitxora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitxors(x[i],y[i]); + } + + +} + diff --git a/src/c/elementaryFunctions/bitxor/u8bitxors.c b/src/c/elementaryFunctions/bitxor/u8bitxors.c new file mode 100644 index 0000000..9a346ee --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitxors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint8 u8bitxors(uint8 x,uint8 y) +{ + return (x ^ y); + +} diff --git a/src/c/elementaryFunctions/bitxor/u8bitxors.c~ b/src/c/elementaryFunctions/bitxor/u8bitxors.c~ new file mode 100644 index 0000000..9a346ee --- /dev/null +++ b/src/c/elementaryFunctions/bitxor/u8bitxors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint8 u8bitxors(uint8 x,uint8 y) +{ + return (x ^ y); + +} diff --git a/src/c/elementaryFunctions/includes/bitand.h b/src/c/elementaryFunctions/includes/bitand.h new file mode 100644 index 0000000..8d98d9b --- /dev/null +++ b/src/c/elementaryFunctions/includes/bitand.h @@ -0,0 +1,39 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITAND_H__ +#define __BITAND_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitand returns the logical AND operation + 12 = 00001100 (In Binary) + 25 = 00011001 (In Binary) + +Bit Operation of 12 and 25 + 00001100 +& 00011001 + ________ + 00001000 = 8 (In decimal) +*/ + +EXTERN_ELEMFUNCT uint8 u8bitands(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitanda(uint8* in1,uint8* in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitands(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitanda(uint16* in1,uint16* in2,int size,uint16* out); + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITAND_H__ */ diff --git a/src/c/elementaryFunctions/includes/bitcmp.h b/src/c/elementaryFunctions/includes/bitcmp.h new file mode 100644 index 0000000..8176681 --- /dev/null +++ b/src/c/elementaryFunctions/includes/bitcmp.h @@ -0,0 +1,38 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITCMP_H__ +#define __BITCMP_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitcmp returns the complement +35=00100011 (In Binary) + +Bitwise complement Operation of 35 +~ 00100011 + ________ + 11011100 = 220 (In decimal) +*/ + +EXTERN_ELEMFUNCT uint8 u8bitcmps(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitcmpa(uint8* in1,uint8 in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitcmps(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitcmpa(uint16* in1,uint16 in2,int size,uint16* out); + + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITCMP_H__ */ diff --git a/src/c/elementaryFunctions/includes/bitget.h b/src/c/elementaryFunctions/includes/bitget.h new file mode 100644 index 0000000..0eaf57e --- /dev/null +++ b/src/c/elementaryFunctions/includes/bitget.h @@ -0,0 +1,25 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITGET_H__ +#define __BITGET_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif + + +EXTERN_ELEMFUNCT uint8 u8bitgets(uint8 value,int position); + +EXTERN_ELEMFUNCT uint16 u16bitgets(uint16 value,int position); + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITGET_H__ */ diff --git a/src/c/elementaryFunctions/includes/bitor.h b/src/c/elementaryFunctions/includes/bitor.h new file mode 100644 index 0000000..16a6a3d --- /dev/null +++ b/src/c/elementaryFunctions/includes/bitor.h @@ -0,0 +1,38 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITOR_H__ +#define __BITOR_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitor returns the logical OR operation + 12 = 00001100 (In Binary) +25 = 00011001 (In Binary) + +Bitwise OR Operation of 12 and 25 + 00001100 +| 00011001 + ________ + 00011101 = 29 (In decimal) */ + +EXTERN_ELEMFUNCT uint8 u8bitors(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitora(uint8* in1,uint8* in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitors(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitora(uint16* in1,uint16* in2,int size,uint16* out); + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITOR_H__ */ diff --git a/src/c/elementaryFunctions/includes/bitset.h b/src/c/elementaryFunctions/includes/bitset.h new file mode 100644 index 0000000..862a4c8 --- /dev/null +++ b/src/c/elementaryFunctions/includes/bitset.h @@ -0,0 +1,25 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITSET_H__ +#define __BITSET_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif + + +EXTERN_ELEMFUNCT uint8 u8bitsets(uint8 value,int position,int bit_value); + +EXTERN_ELEMFUNCT uint16 u16bitsets(uint16 value,int position,int bit_value); + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITSET_H__ */ diff --git a/src/c/elementaryFunctions/includes/bitxor.h b/src/c/elementaryFunctions/includes/bitxor.h new file mode 100644 index 0000000..4e27635 --- /dev/null +++ b/src/c/elementaryFunctions/includes/bitxor.h @@ -0,0 +1,38 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITXOR_H__ +#define __BITXOR_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitxor returns the logical OR operation + 12 = 00001100 (In Binary) +25 = 00011001 (In Binary) + +Bitwise XOR Operation of 12 and 25 + 00001100 +^ 00011001 + ________ + 00010101 = 21 (In decimal) */ + +EXTERN_ELEMFUNCT uint8 u8bitxors(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitxora(uint8* in1,uint8* in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitxors(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitxora(uint16* in1,uint16* in2,int size,uint16* out); + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITXOR_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_bitand.h b/src/c/elementaryFunctions/interfaces/int_bitand.h new file mode 100644 index 0000000..26031ad --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_bitand.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITAND_H__ +#define __INT_BITAND_H__ + + +#define u80u80bitandu80(in1,in2) u8bitands(in1,in2) + +#define u82u82bitandu82(in1,size1,in2,size2,out) u8bitanda(in1,in2,size1[0]*size1[1],out) + +#define u160u160bitandu160(in1,in2) u16bitands(in1,in2) + +#define u162u162bitandu162(in1,size1,in2,size2,out) u16bitanda(in1,in2,size1[0]*size1[1],out) + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_bitcmp.h b/src/c/elementaryFunctions/interfaces/int_bitcmp.h new file mode 100644 index 0000000..d72eb2e --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_bitcmp.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITCMP_H__ +#define __INT_BITCMP_H__ + + +#define u80d0bitcmpu80(in1,in2) u8bitcmps(in1,in2) + +#define u82d0bitcmpu82(in1,size1,in2,out) u8bitcmpa(in1,in2,size1[0]*size1[1],out) + +#define u160d0bitcmpu160(in1,in2) u16bitcmps(in1,in2) + +#define u162d0bitcmpu162(in1,size1,in2,out) u16bitcmpa(in1,in2,size1[0]*size1[1],out) + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_bitget.h b/src/c/elementaryFunctions/interfaces/int_bitget.h new file mode 100644 index 0000000..7b6b8e9 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_bitget.h @@ -0,0 +1,10 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITGET_H__ +#define __INT_BITGET_H__ + +#define u80d0bitgetu80(in1,in2) u8bitgets(in1,in2) + +#define u160d0bitgetu160(in1,in2) u16bitgets(in1,in2) + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_bitor.h b/src/c/elementaryFunctions/interfaces/int_bitor.h new file mode 100644 index 0000000..6a65c9f --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_bitor.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITOR_H__ +#define __INT_BITOR_H__ + + +#define u80u80bitoru80(in1,in2) u8bitors(in1,in2) + +#define u82u82bitoru82(in1,size1,in2,size2,out) u8bitora(in1,in2,size1[0]*size1[1],out) + +#define u160u160bitoru160(in1,in2) u16bitors(in1,in2) + +#define u162u162bitoru162(in1,size1,in2,size2,out) u16bitora(in1,in2,size1[0]*size1[1],out) + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_bitset.h b/src/c/elementaryFunctions/interfaces/int_bitset.h new file mode 100644 index 0000000..e864325 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_bitset.h @@ -0,0 +1,13 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITSET_H__ +#define __INT_BITSET_H__ + +#define u80d0d0bitsetu80(in1,in2,in3) u8bitsets(in1,in2,in3) + +#define u160d0d0bitsetu160(in1,in2,in3) u16bitsets(in1,in2,in3) + + + + +#endif diff --git a/src/c/elementaryFunctions/interfaces/int_bitxor.h b/src/c/elementaryFunctions/interfaces/int_bitxor.h new file mode 100644 index 0000000..30aea6c --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_bitxor.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITXOR_H__ +#define __INT_BITXOR_H__ + + +#define u80u80bitxoru80(in1,in2) u8bitxors(in1,in2) + +#define u82u82bitxoru82(in1,size1,in2,size2,out) u8bitxora(in1,in2,size1[0]*size1[1],out) + +#define u160u160bitxoru160(in1,in2) u16bitxors(in1,in2) + +#define u162u162bitxoru162(in1,size1,in2,size2,out) u16bitxora(in1,in2,size1[0]*size1[1],out) + + +#endif |