diff options
author | siddhu8990 | 2017-06-30 11:35:55 +0530 |
---|---|---|
committer | siddhu8990 | 2017-06-30 11:35:55 +0530 |
commit | f805bc9553b3d88d7c9e7dbf59486c5da490231e (patch) | |
tree | 62a423b9fcf758c4ec4caf0a537ce3a3038fc368 /2.3-1/src/c | |
parent | 55f0ed8567f3dd7a248925591a161ee1beb46df0 (diff) | |
parent | 4eedf3e9d6ae3cc4120b230b3ecd59799e919dee (diff) | |
download | Scilab2C-f805bc9553b3d88d7c9e7dbf59486c5da490231e.tar.gz Scilab2C-f805bc9553b3d88d7c9e7dbf59486c5da490231e.tar.bz2 Scilab2C-f805bc9553b3d88d7c9e7dbf59486c5da490231e.zip |
Matrix declaration modified
Diffstat (limited to '2.3-1/src/c')
24 files changed, 427 insertions, 275 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/includes/linspace.h b/2.3-1/src/c/elementaryFunctions/includes/linspace.h index 92fe10e5..62d45015 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/linspace.h +++ b/2.3-1/src/c/elementaryFunctions/includes/linspace.h @@ -21,8 +21,11 @@ extern "C" { EXTERN_ELEMFUNCT void dlinspaces(double low_limit,double up_limit,double range_num, double* out); +EXTERN_ELEMFUNCT void slinspaces(float low_limit,float up_limit,float range_num, float* out); + EXTERN_ELEMFUNCT void dlinspacea(double *low_limit,int row,double *up_limit,double range_num, double* out); +EXTERN_ELEMFUNCT void slinspacea(float *low_limit,int row,float *up_limit,float range_num, float* out); diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h index f8af947a..15ea2696 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h @@ -15,6 +15,10 @@ #define d0d0d0linspaced2(in1,in2,in3,out) dlinspaces(in1,in2,in3,out) +#define s0s0s0linspaces2(in1,in2,in3,out) slinspaces(in1,in2,in3,out) + #define d2d2d0linspaced2(in1,size1,in2,size2,in3,out) dlinspacea(in1,size1[0],in2,in3,out) +#define s2s2s0linspaces2(in1,size1,in2,size2,in3,out) slinspacea(in1,size1[0],in2,in3,out) + #endif diff --git a/2.3-1/src/c/elementaryFunctions/linspace/slinspacea.c b/2.3-1/src/c/elementaryFunctions/linspace/slinspacea.c new file mode 100644 index 00000000..38af3942 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/linspace/slinspacea.c @@ -0,0 +1,49 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ukasha Noor + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <stdlib.h> +#include "linspace.h" + +void slinspacea(float *low_limit,int _row,float *up_limit,float range_num,float *out) +{ + int i,j,k; + float temp; + float *step_iterate; /* for each row the spacing between two values is different.*/ + step_iterate = (float*) malloc((float)_row*sizeof(float)); + for(i=0;i<_row;i++) + { + + step_iterate[i] = (up_limit[i]-low_limit[i])/(range_num-1); + + } + for(j=0;j < _row;j++) + { + out[j] = low_limit[j]; /* For every row first element is the first value of low_limit array*/ + temp = low_limit[j]; + for(k=1;k < (float)range_num;k++ ) + { + out[(_row*k)+j] = temp + step_iterate[j]; /* Output matrix positions for 3 X 5 matrix are [0 3 6 9 12;1 4 7 10 13;2 5 8 11 14] so (_row*k)+j) used*/ + temp = out[(_row*k)+j]; + if(k == (float)range_num-1 ) + { + out[(_row*k)+j] = (float)up_limit[j]; /* Last value of output is equal to first value of up_limit array*/ + } + + } + + + } + + + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/linspace/slinspaces.c b/2.3-1/src/c/elementaryFunctions/linspace/slinspaces.c new file mode 100644 index 00000000..2404f4de --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/linspace/slinspaces.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ukasha Noor + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "linspace.h" +void slinspaces(float low_limit,float up_limit,float range_num,float *out) +{ + int j; + float temp = low_limit; + float step_iterate = (up_limit-low_limit)/(range_num-1); + out[0] = low_limit; /*First value of output is equal to low_limit value*/ + for(j=1; j<(float)range_num; j++) + { + out[j] = temp + step_iterate; + temp = out[j]; + if(j == (float)range_num-1 ) + { + out[j] = (float)up_limit; /* Last value of output is equal to up_limit value*/ + } + } + + + +} + diff --git a/2.3-1/src/c/interpolation/includes/interp1.h b/2.3-1/src/c/interpolation/includes/interp1.h index 1c01417e..738bfe67 100644 --- a/2.3-1/src/c/interpolation/includes/interp1.h +++ b/2.3-1/src/c/interpolation/includes/interp1.h @@ -23,6 +23,8 @@ extern "C" { //void dinterp13a(double *x,double *fx,double *q,int size,double *out); void dinterp13a(double *x,int size1,double *fx,int size2,double *q,int size3,char *a,int size4,double *out); +void sinterp13a(float *x,int size1,float *fx,int size2,float *q,int size3,char *a,int size4,float *out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/interpolation/interfaces/int_interp1.h b/2.3-1/src/c/interpolation/interfaces/int_interp1.h index 6d579e10..07d8ece4 100644 --- a/2.3-1/src/c/interpolation/interfaces/int_interp1.h +++ b/2.3-1/src/c/interpolation/interfaces/int_interp1.h @@ -19,9 +19,13 @@ #include "interp1.h" #include <string.h> -#define d2d2d2interp1d2(x,size1,fx,size2,q,size3,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size1[1],q,size3[0]*size3[1],"linear",6,out) +#define d2d2d2interp1d2(x,size1,fx,size2,q,size3,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],"linear",6,out) -#define d2d2d2g2interp1d2(x,size1,fx,size2,q,size3,ch,size4,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size1[1],q,size3[0]*size3[1],ch,size4[0]*size4[1],out) +#define d2d2d2g2interp1d2(x,size1,fx,size2,q,size3,ch,size4,out) dinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],ch,size4[0]*size4[1],out) + +#define s2s2s2interp1s2(x,size1,fx,size2,q,size3,out) sinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],"linear",6,out) + +#define s2s2s2g2interp1s2(x,size1,fx,size2,q,size3,ch,size4,out) sinterp13a(x,size1[0]*size1[1],fx,size2[0]*size2[1],q,size3[0]*size3[1],ch,size4[0]*size4[1],out) #endif diff --git a/2.3-1/src/c/interpolation/interp1/sinterp13a.c b/2.3-1/src/c/interpolation/interp1/sinterp13a.c new file mode 100644 index 00000000..b8cb0851 --- /dev/null +++ b/2.3-1/src/c/interpolation/interp1/sinterp13a.c @@ -0,0 +1,75 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ukasha Noor + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "interp1.h" +#include <string.h> + +void sinterp13a(float *x,int size1,float *fx,int size2,float *q,int size3,char *ch,int size4,float *out) +{ + int i,j,k,f; + float a,b; + if(strcmp(ch,"linear")==0) + { + for(i=0;i<size3;i++) + { + f=0; + for(j=0;j<size1;j++) + { + if(q[i]==x[j]) + { + out[i]=fx[j]; + f=1; + break; + } + } + if(f==0) + { + j=0; + while(q[i]>x[j]) + { + j++; + } + a=x[j-1]; + b=x[j]; + out[i]=fx[j-1]+(q[i]-a)*((fx[j]-fx[j-1])/(b-a)); + } + } + } + else if(strcmp(ch,"nearest")==0) + { + for(i=0;i<size3;i++) + { + f=0; + for(j=0;j<size1;j++) + { + if(q[i]==x[j]) + { + out[i]=fx[j]; + f=1; + break; + } + } + if(f==0) + { + j=0; + while(q[i]>x[j]) + { + j++; + } + out[i]=fx[j]; + } + } + } +} + + diff --git a/2.3-1/src/c/signalProcessing/includes/dct.h b/2.3-1/src/c/signalProcessing/includes/dct.h index 5255241e..80668ffa 100644 --- a/2.3-1/src/c/signalProcessing/includes/dct.h +++ b/2.3-1/src/c/signalProcessing/includes/dct.h @@ -25,6 +25,8 @@ extern "C" { void ddcta(double *in,int row,int col,int sign,double *out); +void sdcta(float *in,int row,int col,int sign,float *out); + void zdcta(doubleComplex *in,int row,int col,int sign,doubleComplex *out); void cdcta(floatComplex *in,int row,int col,int sign,floatComplex *out); diff --git a/2.3-1/src/c/signalProcessing/includes/idct.h b/2.3-1/src/c/signalProcessing/includes/idct.h index 13458b7d..1e7b85b3 100644 --- a/2.3-1/src/c/signalProcessing/includes/idct.h +++ b/2.3-1/src/c/signalProcessing/includes/idct.h @@ -25,6 +25,8 @@ extern "C" { void didcta(double *in,int row,int col,double *out); +void sidcta(float *in,int row,int col,float *out); + void zidcta(doubleComplex *in,int row,int col,doubleComplex *out); void cidcta(floatComplex *in,int row,int col,floatComplex *out); diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_dct.h b/2.3-1/src/c/signalProcessing/interfaces/int_dct.h index 6cfb21c7..3481c4d5 100644 --- a/2.3-1/src/c/signalProcessing/interfaces/int_dct.h +++ b/2.3-1/src/c/signalProcessing/interfaces/int_dct.h @@ -21,6 +21,10 @@ #define d2d0dctd2(in,size,sign,out) ddcta(in,size[0],size[1],sign,out) +#define s2dcts2(in,size,out) sdcta(in,size[0],size[1],-1,out) + +#define s2s0dcts2(in,size,sign,out) sdcta(in,size[0],size[1],sign,out) + #define z2dctz2(in,size,out) zdcta(in,size[0],size[1],-1,out) #define z2d0dctz2(in,size,sign,out) zdcta(in,size[0],size[1],sign,out) diff --git a/2.3-1/src/c/signalProcessing/interfaces/int_idct.h b/2.3-1/src/c/signalProcessing/interfaces/int_idct.h index c3a174ac..f705fe2d 100644 --- a/2.3-1/src/c/signalProcessing/interfaces/int_idct.h +++ b/2.3-1/src/c/signalProcessing/interfaces/int_idct.h @@ -19,6 +19,8 @@ #define d2idctd2(in,size,out) didcta(in,size[0],size[1],out) +#define s2idcts2(in,size,out) sidcta(in,size[0],size[1],out) + #define z2idctz2(in,size,out) zidcta(in,size[0],size[1],out) #define c2idctc2(in,size,out) cidcta(in,size[0],size[1],out) diff --git a/2.3-1/src/c/signalProcessing/transforms/dct/sdcta.c b/2.3-1/src/c/signalProcessing/transforms/dct/sdcta.c new file mode 100644 index 00000000..9f380e8b --- /dev/null +++ b/2.3-1/src/c/signalProcessing/transforms/dct/sdcta.c @@ -0,0 +1,160 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ukasha Noor + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "dct.h" +/*#include <fftw3.h>*/ +#include <math.h> + +void sdcta(float *in,int row,int col,int sign,float *out) +{ + int i,j,k,u,v; + int n; + int x,y; + float res,ress; + float re,z,q,m; + if(sign==-1) + { + if(row==1) + { + n=col; + for(u=0;u<row;u++) + { + for(v=0;v<col;v++) + { + x=v*row+u; + out[x]=0; + for(i=0;i<row;i++) + { + for(j=0;j<col;j++) + { + y=row*j+i; + out[x]+=in[y]*(cos(((M_PI)*(y+1-1./2.)*(x))/n)); + } + } + if(x==0) + out[x]*=1./(sqrt(n)); + else + { + float res=2./n; + out[x]*=sqrt(res); + } + } + } + } + else + { + n=col*row; + for(u=0;u<row;u++) + { + for(v=0;v<col;v++) + { + x=v*row+u; + out[x]=0; + for(i=0;i<row;i++) + { + re=0; + for(j=0;j<col;j++) + { + m=(float)in[j*row+i]; + z=(float)(((float)j+1.0/2.0)*(float)v); + q=(float)(M_PI/(float)col); + re+=m*(cos(q*z)); + } + z=(float)(((float)i+1.0/2.0)*(float)u); + q=(float)(M_PI/(float)row); + out[x]+=re*(cos(q*z)); + } + if(u==0) + { + out[x]/=sqrt((float)row); + if(v==0) + out[x]/=sqrt((float)col); + else + out[x]*=sqrt(2./col); + } + else + { + out[x]*=sqrt(2./row); + if(v==0) + out[x]/=sqrt((float)col); + else + out[x]*=sqrt(2./col); + } + } + } + + } + } + else if(sign==1) + { + n=col; + if(row==1) + { + res=1./sqrt(n); + ress=sqrt(2./n); + for(u=0;u<row;u++) + { + for(v=0;v<col;v++) + { + x=v*row+u; + out[x]=0; + for(i=0;i<row;i++) + { + for(j=0;j<col;j++) + { + y=row*j+i; + if(y==0) + out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n)); + else + out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n)); + } + } + } + + } + } + else + { + for(u=0;u<row;u++) + { + for(v=0;v<col;v++) + { + x=v*row+u; + out[x]=0; + for(i=0;i<row;i++) + { + re=0; + for(j=0;j<col;j++) + { + y=row*j+i; + m=(float)in[j*row+i]; + z=(float)(((float)v+1.0/2.0)*(float)j); + q=(float)(M_PI/(float)col); + m=m*(cos(q*z)); + if(j==0) + re+=m/sqrt((float)col); + else + re+=m*sqrt(2./col); + } + z=(float)(((float)u+1.0/2.0)*(float)i); + q=(float)(M_PI/(float)row); + if(i==0) + out[x]+=(re*(cos(z*q)))/sqrt((float)row); + else + out[x]+=(re*(cos(z*q))*sqrt(2./row)); + } + } + } + } + } +} diff --git a/2.3-1/src/c/signalProcessing/transforms/idct/sidcta.c b/2.3-1/src/c/signalProcessing/transforms/idct/sidcta.c new file mode 100644 index 00000000..62f85da0 --- /dev/null +++ b/2.3-1/src/c/signalProcessing/transforms/idct/sidcta.c @@ -0,0 +1,83 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Ukasha Noor + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "idct.h" +/*#include <fftw3.h>*/ +#include <math.h> + +void sidcta(float *in,int row,int col,float *out) +{ + int i,j,k,u,v; + int n=col; + int x,y; + float res,ress; + float re,z,q,m; + if(row==1) + { + res=1./sqrt(n); + ress=sqrt(2./n); + for(u=0;u<row;u++) + { + for(v=0;v<col;v++) + { + x=v*row+u; + out[x]=0; + for(i=0;i<row;i++) + { + for(j=0;j<col;j++) + { + y=row*j+i; + if(y==0) + out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n)); + else + out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n)); + } + } + } + + } + } + else + { + for(u=0;u<row;u++) + { + for(v=0;v<col;v++) + { + x=v*row+u; + out[x]=0; + for(i=0;i<row;i++) + { + re=0; + for(j=0;j<col;j++) + { + y=row*j+i; + m=(float)in[j*row+i]; + z=(float)(((float)v+1.0/2.0)*(float)j); + q=(float)(M_PI/(float)col); + m=m*(cos(q*z)); + if(j==0) + re+=m/sqrt((float)col); + else + re+=m*sqrt(2./col); + } + z=(float)(((float)u+1.0/2.0)*(float)i); + q=(float)(M_PI/(float)row); + if(i==0) + out[x]+=(re*(cos(z*q)))/sqrt((float)row); + else + out[x]+=(re*(cos(z*q))*sqrt(2./row)); + } + } + } + } +} diff --git a/2.3-1/src/c/string/ascii/ascii.h b/2.3-1/src/c/string/ascii/ascii.h deleted file mode 100644 index 2d46b740..00000000 --- a/2.3-1/src/c/string/ascii/ascii.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __ASCII_H__ -#define __ASCII_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -void gasciia(char* str,int size, int* out); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /*___ASCII_H__*/ diff --git a/2.3-1/src/c/string/ascii/int_ascii.h b/2.3-1/src/c/string/ascii/int_ascii.h deleted file mode 100644 index 36d83f8e..00000000 --- a/2.3-1/src/c/string/ascii/int_ascii.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __INT_ASCII_H__ -#define __INT_ASCII_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define g2asciiu82(str,size,oup) gasciia(str,size,oup) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*__INT_ASCII_H__*/ diff --git a/2.3-1/src/c/string/strchr/int_strchr.h b/2.3-1/src/c/string/strchr/int_strchr.h deleted file mode 100644 index 8747545b..00000000 --- a/2.3-1/src/c/string/strchr/int_strchr.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __INT_STRCHR_H__ -#define __INT_STRCHR_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define g2g2strchrg2(str,size,key,size2,out) gstrchra(str,size[1],key,size2[1],out) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*__INT_STRCHR_H__*/ diff --git a/2.3-1/src/c/string/strchr/strchr.h b/2.3-1/src/c/string/strchr/strchr.h deleted file mode 100644 index 7e306413..00000000 --- a/2.3-1/src/c/string/strchr/strchr.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __STRCHR_H__ -#define __STRCHR_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -void gstrchra(char* str,int size, char* key,int size2, char* out); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /*__STRCHR_H__*/ diff --git a/2.3-1/src/c/string/strcspn/int_strcspn b/2.3-1/src/c/string/strcspn/int_strcspn deleted file mode 100644 index f2da3e45..00000000 --- a/2.3-1/src/c/string/strcspn/int_strcspn +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __INT_STRCSPN_H__ -#define __INT_STRCSPN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define g2g2strcspnu80(str1,size1,str2,size2) gstrcspna(str1,size1,str2,size2) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __INT_STRCSPN_H__*/ diff --git a/2.3-1/src/c/string/strcspn/strcspn.h b/2.3-1/src/c/string/strcspn/strcspn.h deleted file mode 100644 index 6170afa2..00000000 --- a/2.3-1/src/c/string/strcspn/strcspn.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __STRCSPN_H__ -#define __STRCSPN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -uint8 gstrcspna(char* str1,int size1,char* str2,int size2); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /* __STRCSPN_H */ diff --git a/2.3-1/src/c/string/strncpy/int_strncpy.h b/2.3-1/src/c/string/strncpy/int_strncpy.h deleted file mode 100644 index fcf245e3..00000000 --- a/2.3-1/src/c/string/strncpy/int_strncpy.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __INT_STRNCPY_H__ -#define __INT_STRNCPY_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define g2strncpyg2(str,key,oup) gstrncpya(str,key,oup) - -#ifdef __cplusplus -} /* extern "C"*/ -#endif - -#endif /*__INT_STRNCPY_H__*/ - diff --git a/2.3-1/src/c/string/strncpy/strncpy.h b/2.3-1/src/c/string/strncpy/strncpy.h deleted file mode 100644 index 38855504..00000000 --- a/2.3-1/src/c/string/strncpy/strncpy.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __STRNCPY_H__ -#define __STRNCPY_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -void gstrncpya(char* str,int key,char* oup); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /*__STRNCPY_H__*/ diff --git a/2.3-1/src/c/string/strspn/gstrspna.c b/2.3-1/src/c/string/strspn/gstrspna.c index 94a5181e..af1acbb8 100644 --- a/2.3-1/src/c/string/strspn/gstrspna.c +++ b/2.3-1/src/c/string/strspn/gstrspna.c @@ -12,7 +12,7 @@ #include<stdio.h> #include "strspn.h" -int max(int a,int b){ +int maxg(int a,int b){ if(a>b) return a; return b; } @@ -37,28 +37,8 @@ uint8 gstrspna(char *str1,int size1,char *str2,int size2) { ct=ct-1; } - m = max(m,ct); + m = maxg(m,ct); } } return m; } -/* -int main() -{ - int n1,n2; - char inp1[100000],inp2[100000]; - printf("Enter the length of the first string"); - scanf("%d",&n1); - for(int i=0;i<=(n1+1);i++) - { - scanf("%c",&inp1[i]); - } - printf("Enter the length of the second string"); - scanf("%d",&n2 ); - for(int j=0;j<=(n2+1);j++) - { - scanf("%c",&inp2[j]); - } - strcspnfn(inp1,n1+1,inp2,n2+1); -} -*/ diff --git a/2.3-1/src/c/string/strspn/int_strspn.h b/2.3-1/src/c/string/strspn/int_strspn.h deleted file mode 100644 index 506b311d..00000000 --- a/2.3-1/src/c/string/strspn/int_strspn.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __INT_STRSPN_H__ -#define __INT_STRSPN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define g2g2strspnu80(str1,size1,str2,size2) gstrspna(str1,size1,str2,size2) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __INT_STRSPN_H__*/ diff --git a/2.3-1/src/c/string/strspn/strspn.h b/2.3-1/src/c/string/strspn/strspn.h deleted file mode 100644 index f7c2a3cb..00000000 --- a/2.3-1/src/c/string/strspn/strspn.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2016 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Ankit Raj - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in - */ -#ifndef __STRSPN_H__ -#define __STRSPN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -uint8 gstrspna(char* str1,int size1,char* str2,int size2); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /* __STRSPN_H */ |