diff options
Diffstat (limited to '2.3-1/src/c/string')
-rw-r--r-- | 2.3-1/src/c/string/ascii/dasciia.c | 21 | ||||
-rw-r--r-- | 2.3-1/src/c/string/ascii/gasciia.c | 26 | ||||
-rw-r--r-- | 2.3-1/src/c/string/disp/ddisph.c | 2 | ||||
-rw-r--r-- | 2.3-1/src/c/string/disp/ddisps.c | 2 | ||||
-rw-r--r-- | 2.3-1/src/c/string/disp/zdispa.c | 2 | ||||
-rw-r--r-- | 2.3-1/src/c/string/disp/zdisps.c | 2 | ||||
-rw-r--r-- | 2.3-1/src/c/string/includes/ascii.h | 27 | ||||
-rw-r--r-- | 2.3-1/src/c/string/includes/strchr.h | 25 | ||||
-rw-r--r-- | 2.3-1/src/c/string/includes/strcspn.h | 26 | ||||
-rw-r--r-- | 2.3-1/src/c/string/includes/strncpy.h | 25 | ||||
-rw-r--r-- | 2.3-1/src/c/string/includes/strspn.h | 26 | ||||
-rw-r--r-- | 2.3-1/src/c/string/interfaces/int_ascii.h | 26 | ||||
-rw-r--r-- | 2.3-1/src/c/string/interfaces/int_strchr.h | 25 | ||||
-rw-r--r-- | 2.3-1/src/c/string/interfaces/int_strcspn.h | 25 | ||||
-rw-r--r-- | 2.3-1/src/c/string/interfaces/int_strncpy.h | 26 | ||||
-rw-r--r-- | 2.3-1/src/c/string/interfaces/int_strspn.h | 25 | ||||
-rw-r--r-- | 2.3-1/src/c/string/strchr/gstrchra.c | 33 | ||||
-rw-r--r-- | 2.3-1/src/c/string/strcspn/gstrcspna.c | 32 | ||||
-rw-r--r-- | 2.3-1/src/c/string/strncpy/gstrncpya.c | 25 | ||||
-rw-r--r-- | 2.3-1/src/c/string/strspn/gstrspna.c | 44 |
20 files changed, 4 insertions, 441 deletions
diff --git a/2.3-1/src/c/string/ascii/dasciia.c b/2.3-1/src/c/string/ascii/dasciia.c deleted file mode 100644 index d2452880..00000000 --- a/2.3-1/src/c/string/ascii/dasciia.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2017 - 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 -*/ -#include<stdio.h> -#include "ascii.h" -void dasciia(double* inp,int size,char* oup) -{ - int i; - for(i=0;i<size;i++) - { - oup[i]=(char)inp[i]; - } -} diff --git a/2.3-1/src/c/string/ascii/gasciia.c b/2.3-1/src/c/string/ascii/gasciia.c deleted file mode 100644 index ec11d6e2..00000000 --- a/2.3-1/src/c/string/ascii/gasciia.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2017 - 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 -*/ -#include<stdio.h> -/* This is the "asciiconv" function which converts the given string - into its ascii equivalent. -*/ -#include "ascii.h" -void gasciia(char *str,int size,int* oup) -{ - int i; - for(i=0;i<size;i++) - { - *(oup+i)=(int)str[i]; - } - -} - diff --git a/2.3-1/src/c/string/disp/ddisph.c b/2.3-1/src/c/string/disp/ddisph.c index 71cda9f4..b36ecb80 100644 --- a/2.3-1/src/c/string/disp/ddisph.c +++ b/2.3-1/src/c/string/disp/ddisph.c @@ -22,7 +22,7 @@ double ddisph (double* in, int rows, int columns, int levels){ { for (j=0;j<columns;j++) { - printf (" %1.20f ", in[i+j*rows+k*columns*rows]); + printf (" %e ", in[i+j*rows+k*columns*rows]); } printf("\n"); } diff --git a/2.3-1/src/c/string/disp/ddisps.c b/2.3-1/src/c/string/disp/ddisps.c index d1b4ef80..513f8ee1 100644 --- a/2.3-1/src/c/string/disp/ddisps.c +++ b/2.3-1/src/c/string/disp/ddisps.c @@ -13,6 +13,6 @@ #include "disp.h" double ddisps (double in) { - printf (" %1.20f \n", in); + printf (" %e \n", in); return 0; } diff --git a/2.3-1/src/c/string/disp/zdispa.c b/2.3-1/src/c/string/disp/zdispa.c index bc71de4b..94b24e98 100644 --- a/2.3-1/src/c/string/disp/zdispa.c +++ b/2.3-1/src/c/string/disp/zdispa.c @@ -16,7 +16,7 @@ double zdispa (doubleComplex* in, int rows, int columns){ int i = 0,j = 0; for (i = 0; i < rows; ++i) { - for (j=0;j<columns;j++) printf(" %1.20lf + %1.20lfi " ,zreals(in[i+j*rows]) ,zimags(in[i+j*rows])); + for (j=0;j<columns;j++) printf(" %e + %ei " ,zreals(in[i+j*rows]) ,zimags(in[i+j*rows])); printf("\n"); } return 0; diff --git a/2.3-1/src/c/string/disp/zdisps.c b/2.3-1/src/c/string/disp/zdisps.c index c4ec137f..4a040cd7 100644 --- a/2.3-1/src/c/string/disp/zdisps.c +++ b/2.3-1/src/c/string/disp/zdisps.c @@ -14,6 +14,6 @@ double zdisps (doubleComplex in) { - printf(" %1.20f + %1.20fi \n" ,zreals(in) ,zimags(in)); + printf(" %e + %ei \n" ,zreals(in) ,zimags(in)); return 0; } diff --git a/2.3-1/src/c/string/includes/ascii.h b/2.3-1/src/c/string/includes/ascii.h deleted file mode 100644 index fcf969da..00000000 --- a/2.3-1/src/c/string/includes/ascii.h +++ /dev/null @@ -1,27 +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__ -#include "types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void gasciia(char* str,int size,int* oup); -void dasciia(double* inp,int size,char* oup); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /*___ASCII_H__*/ diff --git a/2.3-1/src/c/string/includes/strchr.h b/2.3-1/src/c/string/includes/strchr.h deleted file mode 100644 index 7e306413..00000000 --- a/2.3-1/src/c/string/includes/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/includes/strcspn.h b/2.3-1/src/c/string/includes/strcspn.h deleted file mode 100644 index aa91fb47..00000000 --- a/2.3-1/src/c/string/includes/strcspn.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 __STRCSPN_H__ -#define __STRCSPN_H__ -#include "types.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/includes/strncpy.h b/2.3-1/src/c/string/includes/strncpy.h deleted file mode 100644 index f2aa705b..00000000 --- a/2.3-1/src/c/string/includes/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 size,double key,char* oup); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /*__STRNCPY_H__*/ diff --git a/2.3-1/src/c/string/includes/strspn.h b/2.3-1/src/c/string/includes/strspn.h deleted file mode 100644 index 427caa4c..00000000 --- a/2.3-1/src/c/string/includes/strspn.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 __STRSPN_H__ -#define __STRSPN_H__ -#include "types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -uint8 gstrspna(char* str1,int size1,char* str2,int size2); - -#ifdef __cplusplus -}/* extern "C" */ -#endif - -#endif /* __STRSPN_H */ diff --git a/2.3-1/src/c/string/interfaces/int_ascii.h b/2.3-1/src/c/string/interfaces/int_ascii.h deleted file mode 100644 index 87b1b125..00000000 --- a/2.3-1/src/c/string/interfaces/int_ascii.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_ASCII_H__ -#define __INT_ASCII_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define g2asciiu82(str,size,oup) gasciia(str,size[1],oup) -#define d2asciig2(inp,size,oup) dasciia(inp,size[1],oup) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*__INT_ASCII_H__*/ diff --git a/2.3-1/src/c/string/interfaces/int_strchr.h b/2.3-1/src/c/string/interfaces/int_strchr.h deleted file mode 100644 index 8747545b..00000000 --- a/2.3-1/src/c/string/interfaces/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/interfaces/int_strcspn.h b/2.3-1/src/c/string/interfaces/int_strcspn.h deleted file mode 100644 index 74c6379f..00000000 --- a/2.3-1/src/c/string/interfaces/int_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 __INT_STRCSPN_H__ -#define __INT_STRCSPN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define g2g2strcspnu80(str1,size1,str2,size2) gstrcspna(str1,size1[1],str2,size2[1]) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __INT_STRCSPN_H__*/ diff --git a/2.3-1/src/c/string/interfaces/int_strncpy.h b/2.3-1/src/c/string/interfaces/int_strncpy.h deleted file mode 100644 index e7ffdb42..00000000 --- a/2.3-1/src/c/string/interfaces/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 g2d0strncpyg2(str,size,key,oup) gstrncpya(str,size[1],key,oup) - -#ifdef __cplusplus -} /* extern "C"*/ -#endif - -#endif /*__INT_STRNCPY_H__*/ - diff --git a/2.3-1/src/c/string/interfaces/int_strspn.h b/2.3-1/src/c/string/interfaces/int_strspn.h deleted file mode 100644 index e4b06f72..00000000 --- a/2.3-1/src/c/string/interfaces/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[1],str2,size2[1]) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* __INT_STRSPN_H__*/ diff --git a/2.3-1/src/c/string/strchr/gstrchra.c b/2.3-1/src/c/string/strchr/gstrchra.c deleted file mode 100644 index f2f54359..00000000 --- a/2.3-1/src/c/string/strchr/gstrchra.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2017 - 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 - Organization: FOSSEE, IIT Bombay - Author: Ankit Raj - Email: toolbox@scilab.in -*/ -#include <stdio.h> -#include <string.h> -#include "strchr.h" - -void gstrchra(char* str,int size,char* key,int size2,char* out) -{ - int ind,i=0,j,k; - for(j=0;j<size;j++) - { - if(str[j]==key[0]) - { - ind=j; - break; - } - } - for(k=ind;k<size;k++) - { - out[i]=str[k]; - i++; - } -} - diff --git a/2.3-1/src/c/string/strcspn/gstrcspna.c b/2.3-1/src/c/string/strcspn/gstrcspna.c deleted file mode 100644 index b611fff8..00000000 --- a/2.3-1/src/c/string/strcspn/gstrcspna.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2017 - 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 - Organization: FOSSEE, IIT Bombay - Author: Ankit Raj - Email: toolbox@scilab.in -*/ -#include<stdio.h> -#include<string.h> -#include "strcspn.h" -uint8 gstrcspna(char *str1,int size1,char *str2,int size2) -{ - int ind,i,j; - - for(i=0;i<=size1;i++) - { - for(j=0;j<=size2;j++) - { - if(str2[j]==str1[i]) - { - ind=j; - break; - } - } - } - return (ind+1); -} - diff --git a/2.3-1/src/c/string/strncpy/gstrncpya.c b/2.3-1/src/c/string/strncpy/gstrncpya.c deleted file mode 100644 index 92801985..00000000 --- a/2.3-1/src/c/string/strncpy/gstrncpya.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2017 - 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 - Organization: FOSSEE, IIT Bombay - Author: Ankit Raj - Email: toolbox@scilab.in -*/ -#include<stdio.h> -#include "strncpy.h" -void gstrncpya(char *str,int size,double key,char *oup) -{ - int j; - char c; - for(j=0;j<key;j++) - { - c=str[j]; - oup[j]=c; - } -} - - diff --git a/2.3-1/src/c/string/strspn/gstrspna.c b/2.3-1/src/c/string/strspn/gstrspna.c deleted file mode 100644 index af1acbb8..00000000 --- a/2.3-1/src/c/string/strspn/gstrspna.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2017 - 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 - Organization: FOSSEE, IIT Bombay - Author: Ankit Raj - Email: toolbox@scilab.in -*/ -#include<stdio.h> -#include "strspn.h" - -int maxg(int a,int b){ - if(a>b) return a; - return b; -} -uint8 gstrspna(char *str1,int size1,char *str2,int size2) -{ - int i,j,ct=0,k=0,m=0; - for(i=0;i<size2;i++) - { - if(str1[0]==str2[i]) - { - k=i; - ct=0; - j=0; - while(str1[j]==str2[k]) - { - ct++; - j++; - k++; - if(j >= size1) break; - } - if(j==size1) - { - ct=ct-1; - } - m = maxg(m,ct); - } - } -return m; -} |