summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--macros/ASTManagement/%funcall_string.sci9
-rw-r--r--macros/ASTManagement/%operatio_string.sci9
-rw-r--r--macros/ASTManagement/%operation_string.sci2
-rw-r--r--macros/ASTManagement/AST2Ccode.sci46
-rw-r--r--macros/ASTManagement/AST_HandleCC.sci69
-rw-r--r--macros/ASTManagement/AST_HandleEndGenFun.sci11
-rw-r--r--macros/ASTManagement/AST_HandleFunCC.sci176
-rw-r--r--macros/ASTManagement/AST_HandleFunRC.sci105
-rw-r--r--macros/ASTManagement/AST_HandleRC.sci23
-rw-r--r--macros/ASTManagement/AST_ParseIfExprStruct.sci9
-rw-r--r--macros/ASTManagement/_funcall_string.sci9
-rw-r--r--macros/ASTManagement/_operatio_string.sci2
-rw-r--r--macros/ASTManagement/_operation_string.sci2
-rw-r--r--macros/ASTManagement/libbin2263 -> 2136 bytes
-rw-r--r--macros/ASTManagement/names4
-rw-r--r--macros/CCodeGeneration/C_GenDeclarations_Dup.sci187
-rw-r--r--macros/CCodeGeneration/C_IfExpression.sci2
-rw-r--r--macros/CCodeGeneration/C_WhileExpression.sci2
-rw-r--r--macros/CCodeGeneration/libbin2449 -> 1232 bytes
-rw-r--r--macros/CCodeGeneration/names2
-rw-r--r--macros/ErrorMessages/libbin379 -> 696 bytes
-rw-r--r--macros/FunctionAnnotation/FA_SZ_U_SVA.sci4
-rw-r--r--macros/FunctionAnnotation/libbin3678 -> 2540 bytes
-rw-r--r--macros/FunctionAnnotation/names2
-rw-r--r--macros/FunctionList/libbin728 -> 764 bytes
-rw-r--r--macros/GeneralFunctions/libbin2809 -> 1308 bytes
-rw-r--r--macros/Hardware/AVR/libbin2265 -> 1148 bytes
-rw-r--r--macros/Hardware/RasberryPi/libbin2037 -> 1152 bytes
-rw-r--r--macros/ImageProcessing/core/libbin293 -> 700 bytes
-rw-r--r--macros/ImageProcessing/highgui/libbin471 -> 760 bytes
-rw-r--r--macros/ImageProcessing/imgproc/libbin1145 -> 928 bytes
-rw-r--r--macros/Scilab-Arduino/libbin759 -> 892 bytes
-rw-r--r--macros/SymbolTable/ST_InsOutArg_Dup.sci195
-rw-r--r--macros/SymbolTable/libbin1199 -> 928 bytes
-rw-r--r--macros/SymbolTable/names1
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci7
-rw-r--r--macros/ToolInitialization/libbin1543 -> 980 bytes
-rw-r--r--macros/findDeps/getAllHeaders.sci13
-rw-r--r--macros/findDeps/getAllSources.sci5
-rw-r--r--macros/findDeps/libbin603 -> 772 bytes
-rw-r--r--macros/libbin649 -> 712 bytes
-rw-r--r--macros/runsci2c.sci4
-rw-r--r--macros/scilab2c.sci2
-rw-r--r--src/c/elementaryFunctions/includes/linspace.h3
-rw-r--r--src/c/elementaryFunctions/interfaces/int_linspace.h4
-rw-r--r--src/c/elementaryFunctions/linspace/slinspacea.c49
-rw-r--r--src/c/elementaryFunctions/linspace/slinspaces.c33
-rw-r--r--src/c/interpolation/includes/interp1.h2
-rw-r--r--src/c/interpolation/interfaces/int_interp1.h8
-rw-r--r--src/c/interpolation/interp1/sinterp13a.c75
-rw-r--r--src/c/signalProcessing/includes/dct.h2
-rw-r--r--src/c/signalProcessing/includes/idct.h2
-rw-r--r--src/c/signalProcessing/interfaces/int_dct.h4
-rw-r--r--src/c/signalProcessing/interfaces/int_idct.h2
-rw-r--r--src/c/signalProcessing/transforms/dct/sdcta.c160
-rw-r--r--src/c/signalProcessing/transforms/idct/sidcta.c83
-rw-r--r--src/c/string/ascii/ascii.h25
-rw-r--r--src/c/string/ascii/int_ascii.h25
-rw-r--r--src/c/string/strchr/int_strchr.h25
-rw-r--r--src/c/string/strchr/strchr.h25
-rw-r--r--src/c/string/strcspn/int_strcspn25
-rw-r--r--src/c/string/strcspn/strcspn.h25
-rw-r--r--src/c/string/strncpy/int_strncpy.h26
-rw-r--r--src/c/string/strncpy/strncpy.h25
-rw-r--r--src/c/string/strspn/gstrspna.c24
-rw-r--r--src/c/string/strspn/int_strspn.h25
-rw-r--r--src/c/string/strspn/strspn.h25
67 files changed, 1241 insertions, 363 deletions
diff --git a/macros/ASTManagement/%funcall_string.sci b/macros/ASTManagement/%funcall_string.sci
index faeb81d..0ee9701 100644
--- a/macros/ASTManagement/%funcall_string.sci
+++ b/macros/ASTManagement/%funcall_string.sci
@@ -6,10 +6,19 @@ function txt=%funcall_string(F)
// name : string, the name of the function
// lhsnb: number, the number of function lhs
+if F.name <> 'disp'
txt=['Funcall : '+F.name
' #lhs : '+string(F.lhsnb)
' Rhs : '
' '+objectlist2string(F.rhs)
'EndFuncall'
]
+else
+txt=['Funcall : '+F.name
+ ' #lhs : '+'0'
+ ' Rhs : '
+ ' '+objectlist2string(F.rhs)
+ 'EndFuncall'
+ ]
+end
endfunction
diff --git a/macros/ASTManagement/%operatio_string.sci b/macros/ASTManagement/%operatio_string.sci
index c0ecb47..cc18e91 100644
--- a/macros/ASTManagement/%operatio_string.sci
+++ b/macros/ASTManagement/%operatio_string.sci
@@ -4,17 +4,22 @@ function txt=%operatio_string(O)
//fields:
// operands: a list
// operator: a string
-if O.operator <> 'rc'
+if O.operator <> 'rc' & O.operator <> 'cc'
txt=['Operation'
' Operands:'
' '+objectlist2string(O.operands)
' Operator: '+O.operator
'EndOperation'
]
-else
+elseif O.operator == 'rc'
txt=[' Operands:'
' '+objectlist2string(O.operands)
'Endrc'
]
+elseif O.operator == 'cc'
+ txt=[' Begin:'
+ ' '+objectlist2string(O.operands)
+ 'Endcc'
+ ]
end
endfunction
diff --git a/macros/ASTManagement/%operation_string.sci b/macros/ASTManagement/%operation_string.sci
index 84f5ce3..c9282f6 100644
--- a/macros/ASTManagement/%operation_string.sci
+++ b/macros/ASTManagement/%operation_string.sci
@@ -10,4 +10,4 @@ function txt=%operation_string(O)
' Operator: '+O.operator
'EndOperation'
]
-endfunction \ No newline at end of file
+endfunction
diff --git a/macros/ASTManagement/AST2Ccode.sci b/macros/ASTManagement/AST2Ccode.sci
index 19cf00c..563f313 100644
--- a/macros/ASTManagement/AST2Ccode.sci
+++ b/macros/ASTManagement/AST2Ccode.sci
@@ -46,6 +46,10 @@ ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
// ---------------------------------
// --- Parameter Initialization. ---
// ---------------------------------
+
+global cc_count
+cc_count = 0;
+
global rc_count
rc_count = 0;
@@ -57,6 +61,9 @@ StackPosition = 1;
global STACKDEDUG
STACKDEDUG = 0; // 1 -> Every Pop and Push operation on the stack, the stack content will be printed on screen.
+
+global disp_isthere
+disp_isthere = 0;
// -------------------------------------
// --- End parameter Initialization. ---
// -------------------------------------
@@ -135,9 +142,10 @@ while ~meof(fidAST)
//NUT: qui puoi anche aggiunger piu' case per specificare meglio la struttura della funcall
//NUT: i case aggiunti ovviamente faranno solo il push della treeline.
case 'EndOperation' then
- [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,'Operation');
+ [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Operation');
case 'EndFuncall' then
- [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,'Funcall');
+ [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Funcall');
+ disp(disp_isthere);
// --------------
// --- Equal. ---
@@ -147,29 +155,43 @@ while ~meof(fidAST)
//NUT: per fare in modo di coprire le ins, anche se ci puo' essere qualche rischio quando
//NUT: ho miste ins e variabili, per esempio [c(1,1), a] = twooutfun();
//NUT: in questo caso solo una delle due equal va scartata.
- if rc_count > 0
+ if rc_count > 0 & cc_count == 0
[FileInfo,SharedInfo] = AST_HandleFunRC(FileInfo,SharedInfo);
+ rc_count = 0;
+ elseif cc_count > 0
+ [FileInfo,SharedInfo] = AST_HandleFunCC(cc_count,FileInfo,SharedInfo);
+ rc_count = 0;
+ cc_count = 0;
else
- [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,'Equal');
+ if disp_isthere == 0
+ [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Equal');
SharedInfo = INIT_SharedInfoEqual(SharedInfo);
+ end
end
+ disp_isthere = 0;
+
case 'Equal' then
SharedInfo.Equal.Enabled = 1; // 1 means enabled -> we are inside an equal AST block.
AST_PushASTStack(treeline);
case 'Lhs :' then
- disp(rc_count);
- if rc_count > 0
+ disp(disp_isthere);
+ if rc_count > 0 & cc_count == 0
SharedInfo.Equal.Lhs = 1;
[EqualInArgName,EqualInArgScope,EqualNInArg] = AST_HandleRC(FileInfo,SharedInfo);
- SharedInfo.Equal.NInArg = EqualNInArg;
+ SharedInfo.Equal.NInArg = EqualNInArg - rc_count -1;
AST_PushASTStack(treeline);
for tmpcnt = 1:SharedInfo.Equal.NInArg
SharedInfo.Equal.InArg(tmpcnt).Name = EqualInArgName(tmpcnt);
SharedInfo.Equal.InArg(tmpcnt).Scope = EqualInArgScope(tmpcnt);
- end
+ end
+ elseif cc_count > 0
+ SharedInfo.Equal.Lhs = 1;
+ [EqualInArgName,EqualInArgScope,EqualNInArg] = AST_HandleCC(FileInfo,SharedInfo);
+ AST_PushASTStack(treeline);
else
SharedInfo.Equal.Lhs = 1; // 1 means that we are inside the Lhs block of the Equal
//if SharedInfo.Equal.NOutArg > 0
+ if disp_isthere == 0
[EqualInArgName,EqualInArgScope,EqualNInArg] = AST_ReadEqualRhsNames(FileInfo,SharedInfo);
SharedInfo.Equal.NInArg = EqualNInArg;
//end
@@ -184,6 +206,7 @@ while ~meof(fidAST)
SharedInfo.Equal.InArg(tmpcnt).Scope = EqualInArgScope(tmpcnt);
end
//end
+ end
AST_PushASTStack(treeline);
end
@@ -219,6 +242,7 @@ while ~meof(fidAST)
// -----------------
case 'EndProgram'
SharedInfo = AST_HandleEndProgram(FileInfo,SharedInfo);
+ disp_isthere = 0;
//NUT: per essere precisi si puo' pensare di mettere un check
//NUT: alla fine dell'albero per accertarsi che c'e' end program li' dove ce lo aspettiamo
@@ -254,7 +278,11 @@ while ~meof(fidAST)
case 'Endrc' then
- rc_count = rc_count + 1;
+ rc_count = rc_count + 1;
+
+ case 'Endcc' then
+ cc_count = cc_count + 1;
+
//[FileInfo,SharedInfo] = AST_HandleRC(FileInfo,SharedInfo);
// ----------------
diff --git a/macros/ASTManagement/AST_HandleCC.sci b/macros/ASTManagement/AST_HandleCC.sci
new file mode 100644
index 0000000..cc41154
--- /dev/null
+++ b/macros/ASTManagement/AST_HandleCC.sci
@@ -0,0 +1,69 @@
+// 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: Ukasha Noor
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [RhsNames,RhsScope,NRhs] = AST_HandleCC(FileInfo,SharedInfo)
+
+SCI2CNInArgCheck(argn(2),2,2)
+
+ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+
+
+global SCI2CSTACK
+global StackPosition;
+global STACKDEDUG
+// ---------------------------
+// --- End Initialization. ---
+// ---------------------------
+
+
+// ------------------------------
+// --- Read input parameters. ---
+// ------------------------------
+cntpop = 1;
+NRhs = 0;
+RhsField(cntpop) = AST_PopASTStack();
+RhsNames = [];
+while (RhsField(cntpop) ~= 'Expression:')
+ if RhsField(cntpop) <> 'Operands:' & RhsField(cntpop) <> 'Begin:'
+ NRhs = NRhs + 1;
+
+ [RhsNames(NRhs),RhsScope(NRhs)] = AST_ExtractNameAndScope(RhsField(cntpop));
+ end
+ cntpop = cntpop + 1;
+ RhsField(cntpop) = AST_PopASTStack();
+end
+RhsNames = SCI2Cflipud(RhsNames);
+RhsScope = SCI2Cflipud(RhsScope);
+
+// --- Repush everything into the stack. ---
+for cntpush = cntpop:-1:1
+ if RhsField(cntpush) <> 'Operands:' & RhsField(cntpush) <> 'Begin:'
+ PrintStringInfo(' ' + RhsField(cntpush),ReportFileName,'file','y');
+ AST_PushASTStack(RhsField(cntpush));
+ end
+end
+
+
+//for counterinputargs = 1:NRhs
+ //#RNU_RES_B
+ //disp(counterinputargs);
+ //PrintStringInfo('Input Argument Number '+string(counterinputargs)+': '+RhsNames(counterinputargs).Name,...
+ // ReportFileName,'file','y');
+ //PrintStringInfo(' Scope: '+RhsNames(counterinputargs).Scope,...
+ // ReportFileName,'file','y');
+ //#RNU_RES_E
+//end
+
+endfunction
diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci
index 32685de..807b8ba 100644
--- a/macros/ASTManagement/AST_HandleEndGenFun.sci
+++ b/macros/ASTManagement/AST_HandleEndGenFun.sci
@@ -1,5 +1,5 @@
-function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
+function [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,ASTFunType)
// function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
// -----------------------------------------------------------------
// #RNU_RES_B
@@ -36,7 +36,7 @@ function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunT
// ------------------------------
// --- Check input arguments. ---
// ------------------------------
-SCI2CNInArgCheck(argn(2),3,3);
+SCI2CNInArgCheck(argn(2),4,4);
// -----------------------
// --- Initialization. ---
@@ -61,6 +61,8 @@ PrintStepInfo('Handling Funcall/Operation/Equal',FileInfo.Funct(nxtscifunnumber)
global SCI2CSTACK
global StackPosition;
global STACKDEDUG
+
+disp_isthere = 0;
// ---------------------------
// --- End Initialization. ---
// ---------------------------
@@ -81,6 +83,11 @@ NOutArg_mod = NOutArg
AST_PushASTStack('||');
return;
end
+
+ if ASTFunName == 'disp'
+ disp_isthere = 1;
+ end
+
if(mtlb_strcmp(part(ASTFunName,1:2),'CV') == %T)
SharedInfo.OpenCVUsed = %T;
end
diff --git a/macros/ASTManagement/AST_HandleFunCC.sci b/macros/ASTManagement/AST_HandleFunCC.sci
new file mode 100644
index 0000000..1942c74
--- /dev/null
+++ b/macros/ASTManagement/AST_HandleFunCC.sci
@@ -0,0 +1,176 @@
+// 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: Ukasha Noor
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+
+function [FileInfo,SharedInfo] = AST_HandleFunCC(NCol,FileInfo,SharedInfo)
+
+SCI2CNInArgCheck(argn(2),3,3)
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+
+// -----------------------
+// --- Initialization. ---
+// -----------------------
+nxtscifunname = SharedInfo.NextSCIFunName;
+nxtscifunnumber = SharedInfo.NextSCIFunNumber;
+ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
+
+global SCI2CSTACK
+global StackPosition;
+global STACKDEDUG
+// ---------------------------
+// --- End Initialization. ---
+// ---------------------------
+
+// ------------------------------
+// --- Read output parameters. --
+// ------------------------------
+LhsField = AST_PopASTStack();
+NOutArg = 0;
+OutputArgumentNames = [];
+OutputArgumentScope = [];
+while (LhsField ~= 'Lhs :')
+ NOutArg = NOutArg + 1;
+ [OutputArgumentNames(NOutArg),OutputArgumentScope(NOutArg)] = AST_ExtractNameAndScope(LhsField);
+ LhsField = AST_PopASTStack();
+ if (LhsField == 'Expression:')
+ error(9999, 'Found Expression: before Lhs');
+ elseif (LhsField == 'Equal')
+ error(9999, 'Found Equal before Lhs');
+ end
+end
+
+// ------------------------------
+// --- Read input parameters. ---
+// ------------------------------
+
+
+RhsField = AST_PopASTStack();
+InputArgumentNames = [];
+InputArgumentScope = [];
+NInArg = 0;
+InArg = [];
+while (RhsField ~= 'Expression:')
+ NInArg = NInArg + 1;
+ if RhsField <> 'Operands:'
+ [InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(RhsField);
+ end
+ //InArg(NInArg) = RhsField;
+ RhsField = AST_PopASTStack();
+end
+InputArgumentNames = SCI2Cflipud(InputArgumentNames);
+InputArgumentScope = SCI2Cflipud(InputArgumentScope);
+
+
+// -------------------------------------
+// --- Generate the InArg structure. ---
+// -------------------------------------
+//#RNU_RES_E
+for counterinputargs = 1:NInArg
+ InArg(counterinputargs).Name=InputArgumentNames(counterinputargs);
+ InArg(counterinputargs).Scope=InputArgumentScope(counterinputargs);
+end
+
+//#RNU_RES_B
+// -------------------------------------
+// --- Generate the InArg structure. ---
+// -------------------------------------
+//#RNU_RES_E
+OutArg = [];
+for counteroutputargs = 1:NOutArg
+ OutArg(counteroutputargs).Name=OutputArgumentNames(counteroutputargs);
+ OutArg(counteroutputargs).Scope=OutputArgumentScope(counteroutputargs);
+end
+
+// ------------------------
+// --- Print Some Info. ---
+// ------------------------
+
+PrintStringInfo('N Input Arguments: '+string(NInArg),ReportFileName,'file','y','n');
+PrintStringInfo('N Output Arguments: '+string(NOutArg),ReportFileName,'file','y');
+ //#RNU_RES_E
+ for counterinputargs = 1:NInArg
+ //#RNU_RES_B
+ PrintStringInfo('Input Argument Number '+string(counterinputargs)+': '+InArg(counterinputargs).Name,...
+ ReportFileName,'file','y','n');
+ PrintStringInfo(' Scope: '+InArg(counterinputargs).Scope,...
+ ReportFileName,'file','y','n');
+ //#RNU_RES_E
+ end
+ for counteroutputargs = 1:NOutArg
+ //#RNU_RES_B
+ PrintStringInfo('Output Argument Number '+string(counteroutputargs)+': '+OutArg(counteroutputargs).Name,...
+ ReportFileName,'file','y','n');
+ //PrintStringInfo(' Scope: '+ OutArg(counterinputargs).Scope,ReportFileName,'file','y','n');
+ //#RNU_RES_E
+ end
+
+NOutArg_mod = NOutArg;
+
+FunTypeAnnot = '';
+FunSizeAnnot = '';
+NLhsArg = 0;
+LhsArg = [];
+PrintStringInfo('...Equal not found.',ReportFileName,'file','y');
+
+PrintStringInfo('***Analyzing Input Arguments***',ReportFileName,'file','y');
+UpdatedInArg = InArg;
+[InArg,SharedInfo] = ST_GetInArgInfo(InArg,NInArg,FileInfo,SharedInfo,'OpEqual');
+
+NCol = NCol + 1;
+NRow = NInArg/NCol;
+
+com_type = 0;
+for i = 1:NInArg
+ if InArg(i).Type == 'z'
+ com_type = 1;
+ elseif InArg(i).Type == 'c'
+ com_type = 2;
+ end
+end
+
+
+if com_type == 0
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = InArg(1).Type;
+ OutArg(1).Size(1) = string(NCol);
+ OutArg(1).Size(2) = string(NRow);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+elseif com_type == 1
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = 'z';
+ OutArg(1).Size(1) = string(NCol);
+ OutArg(1).Size(2) = string(NRow);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+else
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = 'c';
+ OutArg(1).Size(1) = string(NCol);
+ OutArg(1).Size(2) = string(NRow);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+end
+
+//--- Check for output Argument in symbol table ---//
+OutArg = ST_AnalyzeScope(OutArg,NOutArg,FileInfo,SharedInfo);
+
+//--- Put the output Argument in symbol table ---//
+ST_InsOutArg_Dup(InArg,NInArg,OutArg,NOutArg,com_type,FileInfo,SharedInfo,'all');
+
+
+endfunction
diff --git a/macros/ASTManagement/AST_HandleFunRC.sci b/macros/ASTManagement/AST_HandleFunRC.sci
index a70155a..d316924 100644
--- a/macros/ASTManagement/AST_HandleFunRC.sci
+++ b/macros/ASTManagement/AST_HandleFunRC.sci
@@ -1,36 +1,17 @@
-function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo)
-// function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// Handles the EndFuncall, EndOperation and EndEqual tags of the AST.
-// ASTFunType can be 'Funcall', 'Operation', 'Equal'
-// Structure of Funcall:
-// overloading function for "funcall" type tlist string function
-// this is a node of the AST
-// fields:
-// rhs : a list
-// name : string, the name of the function
-// lhsnb: number, the number of function lhs
-// txt=['Funcall : '+F.name
-// ' #lhs : '+string(F.lhsnb)
-// ' Rhs : '
-// ' '+objectlist2string(F.rhs)
-// 'EndFuncall'
-// ]
-// #RNU_RES_E
-//
-// Input data:
-// //NUT: add description here
-//
-// Output data:
-// //NUT: add description here
-//
-// Status:
-// 11-Apr-2007 -- Raffaele Nutricato: Author.
-//
-// Copyright 2007 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
+// 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: Ukasha Noor
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [FileInfo,SharedInfo] = AST_HandleFunRC(FileInfo,SharedInfo)
+
+SCI2CNInArgCheck(argn(2),2,2)
// ------------------------------
// --- Check input arguments. ---
@@ -74,11 +55,16 @@ end
RhsField = AST_PopASTStack();
+InputArgumentNames = [];
+InputArgumentScope = [];
NInArg = 0;
InArg = [];
while (RhsField ~= 'Expression:')
NInArg = NInArg + 1;
- InArg(NInArg) = RhsField;
+ if RhsField <> 'Operands:'
+ [InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(RhsField);
+ end
+ //InArg(NInArg) = RhsField;
RhsField = AST_PopASTStack();
end
InputArgumentNames = SCI2Cflipud(InputArgumentNames);
@@ -89,7 +75,6 @@ InputArgumentScope = SCI2Cflipud(InputArgumentScope);
// --- Generate the InArg structure. ---
// -------------------------------------
//#RNU_RES_E
-InArg = [];
for counterinputargs = 1:NInArg
InArg(counterinputargs).Name=InputArgumentNames(counterinputargs);
InArg(counterinputargs).Scope=InputArgumentScope(counterinputargs);
@@ -106,6 +91,7 @@ for counteroutputargs = 1:NOutArg
OutArg(counteroutputargs).Scope=OutputArgumentScope(counteroutputargs);
end
+
// ------------------------
// --- Print Some Info. ---
// ------------------------
@@ -125,8 +111,7 @@ PrintStringInfo('N Output Arguments: '+string(NOutArg),ReportFileName,'file','y'
//#RNU_RES_B
PrintStringInfo('Output Argument Number '+string(counteroutputargs)+': '+OutArg(counteroutputargs).Name,...
ReportFileName,'file','y','n');
- PrintStringInfo(' Scope: '+OutArg(counterinputargs).Scope,...
- ReportFileName,'file','y','n');
+ //PrintStringInfo(' Scope: '+ OutArg(counterinputargs).Scope,ReportFileName,'file','y','n');
//#RNU_RES_E
end
@@ -144,22 +129,50 @@ UpdatedInArg = InArg;
size_count = 0;
for i = 1:NInArg
- size_count = size_count + InArg(i).Size(2);
+ size_count = size_count + eval(InArg(i).Size(2));
end
-PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
-OutArg(1).Type = InArg(1).Type;
-OutArg(1).Size(1) = '1'
-OutArg(1).Size(2) = string(size_count);
-OutArg(1).Dimension = InArg(1).Dimension;
-OutArg(1).Value = InArg(1).Value;
-OutArg(1).FindLike = InArg(1).FindLike;
+com_type = 0;
+for i = 1:NInArg
+ if InArg(i).Type == 'z'
+ com_type = 1;
+ elseif InArg(i).Type == 'c'
+ com_type = 2;
+ end
+end
+
+
+if com_type == 0
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = InArg(1).Type;
+ OutArg(1).Size(1) = '1'
+ OutArg(1).Size(2) = string(size_count);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+elseif com_type == 1
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = 'z';
+ OutArg(1).Size(1) = '1'
+ OutArg(1).Size(2) = string(size_count);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+else
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = 'c';
+ OutArg(1).Size(1) = '1'
+ OutArg(1).Size(2) = string(size_count);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+end
//--- Check for output Argument in symbol table ---//
OutArg = ST_AnalyzeScope(OutArg,NOutArg,FileInfo,SharedInfo);
//--- Put the output Argument in symbol table ---//
-ST_InsOutArg(OutArg,NOutArg,FileInfo,SharedInfo,'all');
+ST_InsOutArg_Dup(InArg,NInArg,OutArg,NOutArg,com_type,FileInfo,SharedInfo,'all');
endfunction
diff --git a/macros/ASTManagement/AST_HandleRC.sci b/macros/ASTManagement/AST_HandleRC.sci
index b1a1003..2a6cbc3 100644
--- a/macros/ASTManagement/AST_HandleRC.sci
+++ b/macros/ASTManagement/AST_HandleRC.sci
@@ -1,4 +1,4 @@
-function [RhsNames,RhsScope,NRhs] = AST_ReadEqualRhsNames(FileInfo,SharedInfo)
+function [RhsNames,RhsScope,NRhs] = AST_HandleRC(FileInfo,SharedInfo)
// function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
// -----------------------------------------------------------------
// #RNU_RES_B
@@ -32,6 +32,8 @@ function [RhsNames,RhsScope,NRhs] = AST_ReadEqualRhsNames(FileInfo,SharedInfo)
// Contact: raffaele.nutricato@tiscali.it
// -----------------------------------------------------------------
+SCI2CNInArgCheck(argn(2),2,2)
+
ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
// ------------------------------
@@ -54,9 +56,11 @@ cntpop = 1;
NRhs = 0;
RhsField(cntpop) = AST_PopASTStack();
RhsNames = [];
-while (RhsField(cntpop) ~= 'Operands:')
+while (RhsField(cntpop) ~= 'Expression:')
NRhs = NRhs + 1;
+ if RhsField(cntpop) <> 'Operands:'
[RhsNames(NRhs),RhsScope(NRhs)] = AST_ExtractNameAndScope(RhsField(cntpop));
+ end
cntpop = cntpop + 1;
RhsField(cntpop) = AST_PopASTStack();
end
@@ -65,17 +69,20 @@ RhsScope = SCI2Cflipud(RhsScope);
// --- Repush everything into the stack. ---
for cntpush = cntpop:-1:1
+ if RhsField(cntpush) <> 'Operands:'
AST_PushASTStack(RhsField(cntpush));
+ end
end
-for counterinputargs = 1:NRhs
+//for counterinputargs = 1:NRhs
//#RNU_RES_B
- PrintStringInfo('Input Argument Number '+string(counterinputargs)+': '+InArg(counterinputargs).Name,...
- ReportFileName,'file','y');
- PrintStringInfo(' Scope: '+InArg(counterinputargs).Scope,...
- ReportFileName,'file','y');
+ //disp(counterinputargs);
+ // PrintStringInfo('Input Argument Number '+string(counterinputargs)+': '+RhsNames(counterinputargs).Name,...
+ // ReportFileName,'file','y');
+ //PrintStringInfo(' Scope: '+RhsNames(counterinputargs).Scope,...
+ // ReportFileName,'file','y');
//#RNU_RES_E
-end
+//end
endfunction
diff --git a/macros/ASTManagement/AST_ParseIfExprStruct.sci b/macros/ASTManagement/AST_ParseIfExprStruct.sci
index 3ed1b5b..2bfb08d 100644
--- a/macros/ASTManagement/AST_ParseIfExprStruct.sci
+++ b/macros/ASTManagement/AST_ParseIfExprStruct.sci
@@ -98,6 +98,7 @@ while (flagendpop == 0)
if (ASTIfExpType=='if')
if (IfExprField=='Expression:')
flagendpop = 1;
+ //PrintStringInfo('hello dere '+IfExprField,ReportFileName,'file','y');
// Pop Again the If tag from the AST.
IfExprField = AST_PopASTStack();
elseif (IfExprField=='Operands:')
@@ -117,10 +118,14 @@ while (flagendpop == 0)
elseif (ASTIfExpType=='elseif')
if (IfExprField=='Else If Expression')
flagendpop = 1;
+ //IfExprField = AST_PopASTStack();
else
- if (IfExprField=='&&')
+ if (IfExprField=='&&' | IfExprField=='||')
NOp = NOp + 1;
Op(NOp) = IfExprField;
+ elseif (IfExprField=='Operands:')
+ flagendpop = 0;
+ g = AST_PopASTStack();
else
NIfCondArg = NIfCondArg + 1;
IfCondArg(NIfCondArg) = IfExprField;
@@ -129,7 +134,9 @@ while (flagendpop == 0)
end
end
end
+ if flagendpop == 0
IfExprField = AST_PopASTStack();
+ end
PrintStringInfo('operators are '+IfExprField,ReportFileName,'file','y');
end
diff --git a/macros/ASTManagement/_funcall_string.sci b/macros/ASTManagement/_funcall_string.sci
index faeb81d..0ee9701 100644
--- a/macros/ASTManagement/_funcall_string.sci
+++ b/macros/ASTManagement/_funcall_string.sci
@@ -6,10 +6,19 @@ function txt=%funcall_string(F)
// name : string, the name of the function
// lhsnb: number, the number of function lhs
+if F.name <> 'disp'
txt=['Funcall : '+F.name
' #lhs : '+string(F.lhsnb)
' Rhs : '
' '+objectlist2string(F.rhs)
'EndFuncall'
]
+else
+txt=['Funcall : '+F.name
+ ' #lhs : '+'0'
+ ' Rhs : '
+ ' '+objectlist2string(F.rhs)
+ 'EndFuncall'
+ ]
+end
endfunction
diff --git a/macros/ASTManagement/_operatio_string.sci b/macros/ASTManagement/_operatio_string.sci
index 8421a3f..e933233 100644
--- a/macros/ASTManagement/_operatio_string.sci
+++ b/macros/ASTManagement/_operatio_string.sci
@@ -10,4 +10,4 @@ function txt=%operatio_string(O)
' Operator: '+O.operator
'EndOperation'
]
-endfunction \ No newline at end of file
+endfunction
diff --git a/macros/ASTManagement/_operation_string.sci b/macros/ASTManagement/_operation_string.sci
index 84f5ce3..c9282f6 100644
--- a/macros/ASTManagement/_operation_string.sci
+++ b/macros/ASTManagement/_operation_string.sci
@@ -10,4 +10,4 @@ function txt=%operation_string(O)
' Operator: '+O.operator
'EndOperation'
]
-endfunction \ No newline at end of file
+endfunction
diff --git a/macros/ASTManagement/lib b/macros/ASTManagement/lib
index 7b6a162..4e309a2 100644
--- a/macros/ASTManagement/lib
+++ b/macros/ASTManagement/lib
Binary files differ
diff --git a/macros/ASTManagement/names b/macros/ASTManagement/names
index 26edaf7..6deb883 100644
--- a/macros/ASTManagement/names
+++ b/macros/ASTManagement/names
@@ -21,6 +21,7 @@ AST_ExtractNameAndScope
AST_GetASTFile
AST_GetFuncallPrm
AST_GetPrecAndLhsArg
+AST_HandleCC
AST_HandleEOL
AST_HandleEndFor
AST_HandleEndGenFun
@@ -28,6 +29,7 @@ AST_HandleEndProgram
AST_HandleEndWhile
AST_HandleFor
AST_HandleForStatem
+AST_HandleFunCC
AST_HandleFunRC
AST_HandleHeader
AST_HandleIfElse
@@ -59,5 +61,3 @@ _program_string
_variable_string
_while_string
objectlist2string
-AST_HandleRC
-AST_HandleFunRC
diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci
new file mode 100644
index 0000000..475e2e0
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci
@@ -0,0 +1,187 @@
+function Cdeclaration = C_GenDeclarations_Dup(InArg,NInArg,com_type,ArgStruct,CDeclarationFileName,IndentLevel,ReportFileName,FlagExt,ResizeApproach)
+// function Cdeclaration = C_GenDeclarations(ArgStruct,CDeclarationFileName,IndentLevel,ReportFileName,FlagExt,ResizeApproach)
+// -----------------------------------------------------------------
+// //NUT: add description here
+//
+// Input data:
+// //NUT: add description here
+//
+// Output data:
+// //NUT: add description here
+//
+// Status:
+// 27-Oct-2007 -- Raffaele Nutricato: Author.
+// 10-Jun-2008 -- Raffaele Nutricato: adapted to work with realloc function.
+//
+// Copyright 2007 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// Generate C corresponding declaration given some information in ArgStruct
+//
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),9,9);
+// #RNU_RES_B
+//NUT: ilnome di questa funzione va cambiato perche' le dichiarazioni le fanno anche i for e i while.
+
+PrintStringInfo(' ',ReportFileName,'file','y');
+PrintStringInfo('***Generating C declaration***',ReportFileName,'file','y');
+// #RNU_RES_E
+
+Cdeclaration = '';
+if (ArgStruct.Dimension > 0)
+ if (FlagExt == 1)
+ Cdeclaration(1) = 'extern ';
+ Cdeclaration(2) = 'extern ';
+ else
+ Cdeclaration(1) = '';
+ Cdeclaration(2) = '';
+ end
+// #RNU_RES_B
+//NUT: vedi Mem_Alloc_Out per maggiori info sulla rimozione della temp nella if
+// if ((ArgStruct.Scope=='Temp') | (ArgStruct.FindLike == -1) | (isnum(ArgStruct.Size(1))==%F) | (isnum(ArgStruct.Size(2))==%F))
+// #RNU_RES_E
+ if (ArgStruct.Type=='g')
+// if (isnan(ArgStruct.Value) )
+ if ((isnum(ArgStruct.Size(1))==%F) | (isnum(ArgStruct.Size(2))==%F) )
+ Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+...
+ ' * '+ArgStruct.Name+';';
+ else
+ if ((FlagExt == 1) | (isnan(ArgStruct.Value)))
+ Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+...
+ ' '+ArgStruct.Name+'['+ArgStruct.Size(1)+'*'+ArgStruct.Size(2)+'];';
+ else
+ Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+...
+ ' '+ArgStruct.Name+'['+ArgStruct.Size(1)+'*'+ArgStruct.Size(2)+'] = {'+ArgStruct.Value+'};';
+ end
+ end
+ Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size[2] = {'+ArgStruct.Size(1)+','+ArgStruct.Size(2)+'};';
+ elseif ((ArgStruct.FindLike == -1) | ...
+ (isnum(ArgStruct.Size(1))==%F) | (isnum(ArgStruct.Size(2))==%F) | ...
+ (ResizeApproach=='REALLOC_ALL_RESIZE_ALL' & ArgStruct.Type~='g'))
+// #RNU_RES_B
+//RNU sulle stringhe non ho ancora deciso se applicare la realloc.
+// Generate only the pointer that will be used by the malloc function.
+// #RNU_RES_E
+ if (FlagExt == 1)
+ Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+'* '+...
+ ArgStruct.Name+';';
+ else
+ Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+'* '+...
+ ArgStruct.Name+' = NULL;';
+ end
+// Declare the Size array
+ Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size[2];';
+ else
+// Declare the array with its size.
+ computedSize = ArgStruct.Size(1);
+ computedSizeLength = size(ArgStruct.Size, '*');
+ computedSizeField = ArgStruct.Size(1);
+ for sizeIterator = 2:computedSizeLength;
+ computedSize = computedSize + ' * ' + ArgStruct.Size(sizeIterator);
+ computedSizeField = computedSizeField + ', ' + ArgStruct.Size(sizeIterator);
+ end
+ Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+' '+ArgStruct.Name+'['+computedSize+']={';
+ row = eval(ArgStruct.Size(1))
+ col = eval(ArgStruct.Size(2))
+ if row == 1
+ if com_type == 0
+ for i = 1:NInArg-1
+ Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',';
+ end
+ Cdeclaration(1) = Cdeclaration(1)+InArg(NInArg).Name+'};';
+ else
+ for i=1:NInArg-1
+ if InArg(i).Type <> 'z' & InArg(i).Type <> 'c'
+ Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',0,';
+ else
+ Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',';
+ end
+ end
+ if InArg(NInArg).Type <> 'z' & InArg(NInArg).Type <> 'c'
+ Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};'
+ else
+ Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};'
+ end
+ end
+ else
+ if com_type == 0
+ for i = 1:col
+ for j = 0:row-1
+ if (j*col)+i ~= row*col
+ Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ',';
+ end
+ end
+ end
+ Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};';
+ else
+ for i = 1:col
+ for j = 0:row-1
+ if (j*col)+i ~= row*col
+ if InArg(((j*col)+i)).Type <> 'z' & InArg(((j*col)+i)).Type <> 'c'
+ Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ',0,';
+ else
+ Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ',';
+ end
+ end
+ end
+ end
+ if InArg(NInArg).Type <> 'z' & InArg(NInArg).Type <> 'c'
+ Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};';
+ else
+ Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};';
+ end
+ end
+ end
+ Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size['+string(computedSizeLength)+']';
+ if (FlagExt <> 1)
+ Cdeclaration(2) = Cdeclaration(2)+' = {'+computedSizeField+'}';
+ end
+ Cdeclaration(2) = Cdeclaration(2)+';';
+ end
+else
+ if (ArgStruct.Type == 'fn')
+ //do nothing. This is a function name. Will be declared in header file.
+ else
+ if (FlagExt == 1)
+ Cdeclaration(1) = 'extern ';
+ else
+ Cdeclaration(1) = '';
+ end
+ Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+' '+ArgStruct.Name;
+ if (~isnan(ArgStruct.Value) & (FlagExt == 0))
+ if isreal(ArgStruct.Value)
+ Cdeclaration(1) = Cdeclaration(1)+' = '+SCI2Cstring(ArgStruct.Value);
+ else
+ if (ArgStruct.Type == 'z')
+ Cdeclaration(1) = Cdeclaration(1)+' = DoubleComplex('+SCI2Cstring(real(ArgStruct.Value))+','+SCI2Cstring(imag(ArgStruct.Value))+')';
+ else
+ Cdeclaration(1) = Cdeclaration(1)+' = FloatComplex('+SCI2Cstring(real(ArgStruct.Value))+','+SCI2Cstring(imag(ArgStruct.Value))+')';
+ end
+ end
+ end
+ Cdeclaration(1) = Cdeclaration(1)+';';
+ end
+end
+
+
+// --------------------------------------------
+// --- Write C declaration into the C file. ---
+// --------------------------------------------
+PrintStringInfo(' ',CDeclarationFileName,'file','y');
+for cntdecl = 1:size(Cdeclaration, '*')
+ PrintStringInfo(' '+Cdeclaration(cntdecl),ReportFileName,'file','y');
+ PrintStringInfo(C_IndentBlanks(IndentLevel)+Cdeclaration(cntdecl),CDeclarationFileName,'file','y');
+end
+
+PrintStringInfo(' Writing C declaration in: '+CDeclarationFileName,ReportFileName,'file','y');
+PrintStringInfo(' ',CDeclarationFileName,'file','y');
+
+endfunction
+// #RNU_RES_B
+//NUT: dove sta il controllo che verifica se dopo aver dichiarato una local A[10] essa viene utilizzata
+//NUT: per memorizzare un A = sin(B) dove B[11]??
+// #RNU_RES_E
diff --git a/macros/CCodeGeneration/C_IfExpression.sci b/macros/CCodeGeneration/C_IfExpression.sci
index c723d95..359b788 100644
--- a/macros/CCodeGeneration/C_IfExpression.sci
+++ b/macros/CCodeGeneration/C_IfExpression.sci
@@ -19,7 +19,7 @@ function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,Fi
// ------------------------------
// --- Check input arguments. ---
// ------------------------------
-//SCI2CNInArgCheck(argn(4),7,7);
+SCI2CNInArgCheck(argn(2),7,7);
//global SCI2CSTACK
//global StackPosition;
diff --git a/macros/CCodeGeneration/C_WhileExpression.sci b/macros/CCodeGeneration/C_WhileExpression.sci
index d7cf70e..368ccff 100644
--- a/macros/CCodeGeneration/C_WhileExpression.sci
+++ b/macros/CCodeGeneration/C_WhileExpression.sci
@@ -19,7 +19,7 @@ function SharedInfo = C_WhileExpression(IfCondArg,NIfCondArg,Op,NOp,FileInfo,Sha
// ------------------------------
// --- Check input arguments. ---
// ------------------------------
-//SCI2CNInArgCheck(argn(2),2,2);
+SCI2CNInArgCheck(argn(2),6,6);
// -----------------------
// --- Initialization. ---
diff --git a/macros/CCodeGeneration/lib b/macros/CCodeGeneration/lib
index 2db4b8c..96294d0 100644
--- a/macros/CCodeGeneration/lib
+++ b/macros/CCodeGeneration/lib
Binary files differ
diff --git a/macros/CCodeGeneration/names b/macros/CCodeGeneration/names
index 4d76299..56caa81 100644
--- a/macros/CCodeGeneration/names
+++ b/macros/CCodeGeneration/names
@@ -2,6 +2,7 @@ C_FinalizeCode
C_ForExpression
C_Funcall
C_GenDeclarations
+C_GenDeclarations_Dup
C_GenerateFunName
C_GenerateLaunchScript
C_GenerateMakefile
@@ -13,7 +14,6 @@ C_IfExpression
C_IndentBlanks
C_InitHeader
C_MemAllocOutTempVars
-C_RCOperator
C_SCI2CHeader
C_Type
C_WhileExpression
diff --git a/macros/ErrorMessages/lib b/macros/ErrorMessages/lib
index 0a9f891..2b3ee2f 100644
--- a/macros/ErrorMessages/lib
+++ b/macros/ErrorMessages/lib
Binary files differ
diff --git a/macros/FunctionAnnotation/FA_SZ_U_SVA.sci b/macros/FunctionAnnotation/FA_SZ_U_SVA.sci
index 695bef0..3b8b25c 100644
--- a/macros/FunctionAnnotation/FA_SZ_U_SVA.sci
+++ b/macros/FunctionAnnotation/FA_SZ_U_SVA.sci
@@ -26,8 +26,8 @@ function opout = FA_SZ_U_SVA(in1,in2)
// -----------------------------------------------------------------
//in1 = string(in1);
-disp(in1)
-disp(in2)
+// disp(in1)
+// disp(in2)
//in1 = eval(in1);
//in2 = string(in2);
//in2 = eval(in2);
diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib
index 2e23020..0091f72 100644
--- a/macros/FunctionAnnotation/lib
+++ b/macros/FunctionAnnotation/lib
Binary files differ
diff --git a/macros/FunctionAnnotation/names b/macros/FunctionAnnotation/names
index 83941f8..94b37ef 100644
--- a/macros/FunctionAnnotation/names
+++ b/macros/FunctionAnnotation/names
@@ -59,8 +59,8 @@ FA_SZ_ROW_DIAG
FA_SZ_ROW_DIAG_INS_EXT
FA_SZ_SEL1
FA_SZ_SEL2
-FA_TP_ASCII
FA_SZ_U_SVA
+FA_TP_ASCII
FA_TP_C
FA_TP_COMPLEX
FA_TP_CVIMAGE
diff --git a/macros/FunctionList/lib b/macros/FunctionList/lib
index 3979486..32c92be 100644
--- a/macros/FunctionList/lib
+++ b/macros/FunctionList/lib
Binary files differ
diff --git a/macros/GeneralFunctions/lib b/macros/GeneralFunctions/lib
index e1d6f0f..a3af87e 100644
--- a/macros/GeneralFunctions/lib
+++ b/macros/GeneralFunctions/lib
Binary files differ
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 5c8f0da..170d321 100644
--- a/macros/Hardware/AVR/lib
+++ b/macros/Hardware/AVR/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 9afd77d..d25d944 100644
--- a/macros/Hardware/RasberryPi/lib
+++ b/macros/Hardware/RasberryPi/lib
Binary files differ
diff --git a/macros/ImageProcessing/core/lib b/macros/ImageProcessing/core/lib
index 5605351..8d5e5c7 100644
--- a/macros/ImageProcessing/core/lib
+++ b/macros/ImageProcessing/core/lib
Binary files differ
diff --git a/macros/ImageProcessing/highgui/lib b/macros/ImageProcessing/highgui/lib
index a46d5d8..2db0482 100644
--- a/macros/ImageProcessing/highgui/lib
+++ b/macros/ImageProcessing/highgui/lib
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/lib b/macros/ImageProcessing/imgproc/lib
index 4863059..656e3bb 100644
--- a/macros/ImageProcessing/imgproc/lib
+++ b/macros/ImageProcessing/imgproc/lib
Binary files differ
diff --git a/macros/Scilab-Arduino/lib b/macros/Scilab-Arduino/lib
index 0304cad..60340e2 100644
--- a/macros/Scilab-Arduino/lib
+++ b/macros/Scilab-Arduino/lib
Binary files differ
diff --git a/macros/SymbolTable/ST_InsOutArg_Dup.sci b/macros/SymbolTable/ST_InsOutArg_Dup.sci
new file mode 100644
index 0000000..bca6623
--- /dev/null
+++ b/macros/SymbolTable/ST_InsOutArg_Dup.sci
@@ -0,0 +1,195 @@
+function ST_InsOutArg_Dup(InArg,NInArg,OutArg,NOutArg,com_type,FileInfo,SharedInfo,MatchRule)
+// function ST_InsOutArg(OutArg,NOutArg,FileInfo,SharedInfo,MatchRule)
+// -----------------------------------------------------------------
+// //NUT: add description here
+//
+// Input data:
+// //NUT: add description here
+//
+// Output data:
+// //NUT: add description here
+//
+// Status:
+// 26-Oct-2007 -- Raffaele Nutricato: Author.
+// 26-Oct-2007 -- Alberto Morea: Test Ok.
+//
+// Copyright 2007 Raffaele Nutricato & Alberto Morea.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+SCI2CNInArgCheck(argn(2),8,8)
+
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+//SCI2CNInArgCheck(argn(2),5,5);
+
+// -----------------------
+// --- Initialization. ---
+// -----------------------
+nxtscifunname = SharedInfo.NextSCIFunName;
+nxtscifunnumber = SharedInfo.NextSCIFunNumber;
+ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
+CDeclarationFileName = FileInfo.Funct(nxtscifunnumber).CDeclarationFileName;
+CGblDeclarFileName = FileInfo.Funct(nxtscifunnumber).CGblDeclarFileName;
+
+GlobalVarsFileName = FileInfo.GlobalVarFileName;
+LocalVarsFileName = FileInfo.Funct(nxtscifunnumber).LocalVarFileName;
+TempVarsFileName = FileInfo.Funct(nxtscifunnumber).TempVarFileName;
+
+CPass1FileName = FileInfo.Funct(nxtscifunnumber).CPass1FileName;
+CPass1FreeFileName = FileInfo.Funct(nxtscifunnumber).CPass1FreeFileName;
+
+
+// #RNU_RES_B
+PrintStringInfo(' ',ReportFileName,'file','y');
+PrintStringInfo('***Putting output arguments in the symbol table***',ReportFileName,'file','y','n');
+// #RNU_RES_E
+// ---------------------------
+// --- End Initialization. ---
+// ---------------------------
+
+
+for counteroutput = 1:NOutArg
+ // #RNU_RES_B
+ PrintStringInfo(' Symbol ""'+OutArg(counteroutput).Name+'""',ReportFileName,'file','y','n');
+ PrintStringInfo(' Type: '+OutArg(counteroutput).Type,ReportFileName,'file','y','n');
+ PrintStringInfo(' Size(1): '+string(OutArg(counteroutput).Size(1)),ReportFileName,'file','y','n');
+ PrintStringInfo(' Size(2): '+string(OutArg(counteroutput).Size(2)),ReportFileName,'file','y','n');
+ PrintStringInfo(' Value: '+string(OutArg(counteroutput).Value),ReportFileName,'file','y','n');
+ PrintStringInfo(' FindLike: '+string(OutArg(counteroutput).FindLike),ReportFileName,'file','y','n');
+ PrintStringInfo(' Dimension: '+string(OutArg(counteroutput).Dimension),ReportFileName,'file','y','n');
+ PrintStringInfo(' Scope: '+string(OutArg(counteroutput).Scope),ReportFileName,'file','y','n');
+ PrintStringInfo(' ',ReportFileName,'file','y','n');
+ // #RNU_RES_E
+ if (OutArg(counteroutput).Scope == 'Temp')
+ SymbTableFileName = TempVarsFileName;
+ elseif (OutArg(counteroutput).Scope == 'Local')
+ SymbTableFileName = LocalVarsFileName;
+ elseif (OutArg(counteroutput).Scope == 'Global')
+ SymbTableFileName = GlobalVarsFileName;
+ else
+ error(9999, 'Unknown scope ""'+OutArg(counteroutput).Scope+'"" for symbol: '+OutArg(counteroutput).Name);
+ end
+ // #RNU_RES_B
+ PrintStringInfo(' Setting symbol ""'+OutArg(counteroutput).Name+'"" in '+SymbTableFileName+'.',ReportFileName,'file','y');
+ // #RNU_RES_E
+
+ // #RNU_RES_B
+ // Check existence and conflicts in the symbol table.
+ // Here we have four possibilities:
+ // 1. the symbol is a global variable not initialized yet -> we have to initialize it.
+ // 2. the symbol already exists with different settings -> we have to issue an error.
+ // 3. the symbol already exists with the same settings -> ok, we don't have to do nothing.
+ // 4. the symbol doesn't exist -> we have to insert it into the table.
+ // #RNU_RES_E
+ [TBFlagfound,TBFlagEqualSymbols] = ...
+ ST_MatchSymbol(OutArg(counteroutput).Name,...
+ OutArg(counteroutput).Type,...
+ OutArg(counteroutput).Size,...
+ OutArg(counteroutput).Value,...
+ OutArg(counteroutput).FindLike,...
+ OutArg(counteroutput).Dimension,...
+ SymbTableFileName,MatchRule);
+
+ if (TBFlagfound == 1)
+ if (TBFlagEqualSymbols == 0)
+ PrintStringInfo(' ',ReportFileName,'both','y');
+ PrintStringInfo('SCI2CERROR: Symbol Table Conflict. Trying to insert again symbol ""'+...
+ OutArg(counteroutput).Name+'"" with different settings',ReportFileName,'both','y');
+ PrintStringInfo('SCI2CERROR: Please check that you are not using variable ""'+OutArg(counteroutput).Name+'""',ReportFileName,'both','y');
+ PrintStringInfo('SCI2CERROR: with different sizes and/or types.',ReportFileName,'both','y');
+ PrintStringInfo(' ',ReportFileName,'both','y');
+ error(9999, 'SCI2CERROR: Symbol Table Conflict. Trying to insert again symbol ""'+...
+ OutArg(counteroutput).Name+'"" with different settings');
+ else
+ // #RNU_RES_B
+ // It's ok symbols do match.
+ //NUT: forse occorre un altro check sulla size per capire se occore fare il malloc.
+ //NUT: qui entro anche quando ho una variabile global gia' dichiarata tale in un altro
+ //NUT: per cui devo dichiararala come external.
+ //RNU qui ci puoi mettere una warning quando stai riallocando uno stesso simbolo con size simbolica.
+ //RNU puoi anche aggiungere del codice in c o un semplice commento. per esempio una funzione c del tipo checksize che controlla il valore
+ //RNU prima dopo delle size di una data variabile. Cosa succede se cambio la size anche nel caso di array e approccio
+ //RNU di resize non attivo? L'unica cosa e' che molte size numeriche scompaiono e incomincio a creare numerose variabili
+ //RNU con size simbolica.
+
+ // If the symbol is scalar we update its value if it is an array we update its size
+ // only in case we are using the 'REALLOC_ALL_RESIZE_ALL' resize approach
+ // #RNU_RES_E
+ if ((GetSymbolDimension(OutArg(counteroutput).Size)) == 0 | (SharedInfo.ResizeApproach=='REALLOC_ALL_RESIZE_ALL'))
+ ST_Set(OutArg(counteroutput).Name,...
+ OutArg(counteroutput).Type,...
+ OutArg(counteroutput).Size,...
+ OutArg(counteroutput).Value,...
+ OutArg(counteroutput).FindLike,...
+ OutArg(counteroutput).Dimension,...
+ SymbTableFileName);
+ end
+
+ // IndentLevelDeclaration = 1; //NUT: per ora lo forzo sempre a 1
+ // IndentLevelMalloc = SharedInfo.NIndent;
+ // FlagExt = 0;
+ // C_GenDeclarations(OutArg(counteroutput),CDeclarationFileName,IndentLevelDeclaration,ReportFileName,FlagExt,SharedInfo.ResizeApproach);
+
+
+ end
+ elseif (TBFlagfound == 2)
+ // #RNU_RES_B
+ // We have a non-initialized global variable.
+ // Set the non-initialized global variable.
+ PrintStringInfo(' Found a non-initialized global variable.',ReportFileName,'file','y');
+ // #RNU_RES_E
+ ST_Set(OutArg(counteroutput).Name,...
+ OutArg(counteroutput).Type,...
+ OutArg(counteroutput).Size,...
+ OutArg(counteroutput).Value,...
+ OutArg(counteroutput).FindLike,...
+ OutArg(counteroutput).Dimension,...
+ SymbTableFileName);
+ IndentLevel = 0; //NUT: forced always to 1
+ FlagExt = 0;
+ C_GenDeclarations(OutArg(counteroutput),CGblDeclarFileName,IndentLevel,ReportFileName,FlagExt,SharedInfo.ResizeApproach);
+ IndentLevelMalloc = SharedInfo.NIndent;
+ // #RNU_RES_B
+ //RNU da verificare bene qui. Cio' che si verifica e' che se la size della globale e' simbolica
+ //RNU allora si assume che essa sia da allocare come puntatore e poi realloc.
+ // #RNU_RES_E
+ C_MemAllocOutTempVars(OutArg(counteroutput),1,CPass1FileName,CPass1FreeFileName,IndentLevelMalloc,ReportFileName,SharedInfo.ResizeApproach);
+ else
+ if (OutArg(counteroutput).FindLike == 1)
+ // #RNU_RES_B
+ // In presence of find-like functions the size must be always symbolic.
+ // Don't change here the value of OutArg.Size because the first time
+ // I need them to declare the OutArg variable with the values assumed by OutArg.Size.
+ // #RNU_RES_E
+ TmpOutArgSize(1) = '__'+OutArg(counteroutput).Name+'Size[0]';
+ TmpOutArgSize(2) = '__'+OutArg(counteroutput).Name+'Size[1]';
+ else
+ TmpOutArgSize(1) = OutArg(counteroutput).Size(1);
+ TmpOutArgSize(2) = OutArg(counteroutput).Size(2);
+ end
+ // #RNU_RES_B
+ // Set a new symbol.
+ // #RNU_RES_E
+ ST_Set(OutArg(counteroutput).Name,...
+ OutArg(counteroutput).Type,...
+ TmpOutArgSize,...
+ OutArg(counteroutput).Value,...
+ OutArg(counteroutput).FindLike,...
+ OutArg(counteroutput).Dimension,...
+ SymbTableFileName);
+ IndentLevelDeclaration = 1; //NUT: per ora lo forzo sempre a 1
+ IndentLevelMalloc = SharedInfo.NIndent;
+ FlagExt = 0;
+ C_GenDeclarations_Dup(InArg,NInArg,com_type,OutArg(counteroutput),CPass1FileName,IndentLevelDeclaration,ReportFileName,FlagExt,SharedInfo.ResizeApproach);
+ // #RNU_RES_B
+ //RNU aggiunta qui in modo che le malloc saranno fatte una sola volta:
+ //RNU verifica che tutto funzioni e chi altro usa la C_MemAlloc per capire se si puo' ottimizzare per questo stadio.
+ // #RNU_RES_E
+ C_MemAllocOutTempVars(OutArg(counteroutput),1,CPass1FileName,CPass1FreeFileName,IndentLevelMalloc,ReportFileName,SharedInfo.ResizeApproach);
+ end
+
+end
+
+endfunction
diff --git a/macros/SymbolTable/lib b/macros/SymbolTable/lib
index dbc603e..165b707 100644
--- a/macros/SymbolTable/lib
+++ b/macros/SymbolTable/lib
Binary files differ
diff --git a/macros/SymbolTable/names b/macros/SymbolTable/names
index b5a7d65..c2efc84 100644
--- a/macros/SymbolTable/names
+++ b/macros/SymbolTable/names
@@ -6,6 +6,7 @@ ST_GetInArgInfo
ST_GetSymbolInfo
ST_InsForCntVars
ST_InsOutArg
+ST_InsOutArg_Dup
ST_Load
ST_MatchSymbol
ST_Save
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index 0cc50da..cb2a733 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -968,6 +968,8 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
//PrintStringInfo('d2'+ArgSeparator+'d0',ClassFileName,'file','y');
PrintStringInfo('d2d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d2d2d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2s2s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'interp1';
@@ -1005,6 +1007,8 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2s0'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('z2d0'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
@@ -1034,6 +1038,7 @@ PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
@@ -1404,7 +1409,9 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('d0d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0s0s0'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('d2d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2s2s0'+ArgSeparator+'s2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
diff --git a/macros/ToolInitialization/lib b/macros/ToolInitialization/lib
index 4d03bdc..6240d3d 100644
--- a/macros/ToolInitialization/lib
+++ b/macros/ToolInitialization/lib
Binary files differ
diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci
index 9cd2d22..2141128 100644
--- a/macros/findDeps/getAllHeaders.sci
+++ b/macros/findDeps/getAllHeaders.sci
@@ -60,7 +60,7 @@ function allHeaders = getAllHeaders(SharedInfo)
"src/c/matrixOperations/includes/logm.h"
"src/c/matrixOperations/includes/ones.h"
"src/c/matrixOperations/includes/matrixSquaredMagnitude.h"
- "src/c/linearAlgebra/includes/spec.h" // moved from matrixOperation to linearAlgebra
+ "src/c/linearAlgebra/includes/spec.h"
"src/c/matrixOperations/includes/matrixTranspose.h"
"src/c/matrixOperations/includes/determ.h"
"src/c/matrixOperations/includes/matrixMultiplication.h"
@@ -219,8 +219,8 @@ function allHeaders = getAllHeaders(SharedInfo)
"src/c/linearAlgebra/includes/schur.h"
"src/c/linearAlgebra/includes/balanc.h"
"src/c/linearAlgebra/includes/svd.h"
- "src/c/linearAlgebra/includes/hess.h"
- "src/c/linearAlgebra/includes/sva.h"
+ "src/c/linearAlgebra/includes/hess.h"
+ "src/c/linearAlgebra/includes/sva.h"
"src/c/linearAlgebra/includes/rcond.h"];
@@ -252,7 +252,7 @@ function allHeaders = getAllHeaders(SharedInfo)
"src/c/hardware/avr/includes/AVRUtil.h"
"src/c/hardware/avr/includes/AVRPeripheralTimer.h"
"src/c/hardware/avr/includes/AVRPeripheralUART.h"
- ];
+ ];
RPi_headers = [
"thirdparty/includes/WiringPi/wiringPi.h"
@@ -263,7 +263,7 @@ function allHeaders = getAllHeaders(SharedInfo)
"src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h"
"src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h"
"src/c/hardware/rasberrypi/includes/RPIPeripheralPWM.h"
- ];
+ ];
OpenCV_headers = [
"src/c/imageProcessing/includes/cvcore.hpp"
@@ -285,7 +285,8 @@ function allHeaders = getAllHeaders(SharedInfo)
allHeaders = cat(1,allHeaders,OpenCV_headers);
end
- if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
+ if(size(SharedInfo.Includelist) <> 0 & (mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
+ disp("Hi")
allHeaders = cat(1,allHeaders,"thirdparty/includes/GSL");
end
diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci
index 48d5dd7..4255608 100644
--- a/macros/findDeps/getAllSources.sci
+++ b/macros/findDeps/getAllSources.sci
@@ -698,6 +698,8 @@ function allSources = getAllSources(SharedInfo)
"src/c/elementaryFunctions/bitset/u16bitsets.c"
"src/c/elementaryFunctions/bitget/u8bitgets.c"
"src/c/elementaryFunctions/bitget/u16bitgets.c"
+ "src/c/elementaryFunctions/linspace/slinspacea.c"
+ "src/c/elementaryFunctions/linspace/slinspaces.c"
"src/c/elementaryFunctions/linspace/dlinspaces.c"
"src/c/elementaryFunctions/linspace/dlinspacea.c"
"src/c/elementaryFunctions/logspace/dlogspaces.c"
@@ -970,9 +972,11 @@ function allSources = getAllSources(SharedInfo)
"src/c/string/string/i16stringa.c"
"src/c/string/string/i16strings.c"
"src/c/signalProcessing/modk/dmodka.c"
+ "src/c/signalProcessing/transforms/idct/sidcta.c"
"src/c/signalProcessing/transforms/idct/cidcta.c"
"src/c/signalProcessing/transforms/idct/zidcta.c"
"src/c/signalProcessing/transforms/idct/didcta.c"
+ "src/c/signalProcessing/transforms/dct/sdcta.c"
"src/c/signalProcessing/transforms/dct/cdcta.c"
"src/c/signalProcessing/transforms/dct/zdcta.c"
"src/c/signalProcessing/transforms/dct/ddcta.c"
@@ -1209,6 +1213,7 @@ function allSources = getAllSources(SharedInfo)
"src/c/elementaryFunctions/Trigonometry/sech/zsechs.c"
"src/c/elementaryFunctions/Trigonometry/sech/csecha.c"
"src/c/elementaryFunctions/Trigonometry/sech/csechs.c"
+ "src/c/interpolation/interp1/sinterp13a.c"
"src/c/interpolation/interp1/dinterp13a.c"
"src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcds.c"
"src/c/elementaryFunctions/Trigonometry/sinc/dsinca.c"
diff --git a/macros/findDeps/lib b/macros/findDeps/lib
index 0c9a111..c1deaa6 100644
--- a/macros/findDeps/lib
+++ b/macros/findDeps/lib
Binary files differ
diff --git a/macros/lib b/macros/lib
index d818e18..1b718c7 100644
--- a/macros/lib
+++ b/macros/lib
Binary files differ
diff --git a/macros/runsci2c.sci b/macros/runsci2c.sci
index ae38e57..f05cb83 100644
--- a/macros/runsci2c.sci
+++ b/macros/runsci2c.sci
@@ -113,7 +113,7 @@ PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
for i = 1:size(allSources, "*")
// DEBUG only
- disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
+ //disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
//Copy ode related functions only if 'ode' function is used.
if(~isempty(strstr(allSources(i),'dode')))
if(size(SharedInfo.Includelist) <> 0)
@@ -130,7 +130,7 @@ end
PrintStepInfo('Copying headers', FileInfo.GeneralReport,'both');
for i = 1:size(allHeaders, "*")
// DEBUG only
- disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
+ //disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
end
diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci
index 61ac42d..d0acd56 100644
--- a/macros/scilab2c.sci
+++ b/macros/scilab2c.sci
@@ -12,7 +12,7 @@
function scilab2c(varargin)
[lhs, rhs] = argn();
- disp("YES")
+
select rhs
//
// scilab2c()
diff --git a/src/c/elementaryFunctions/includes/linspace.h b/src/c/elementaryFunctions/includes/linspace.h
index 92fe10e..62d4501 100644
--- a/src/c/elementaryFunctions/includes/linspace.h
+++ b/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/src/c/elementaryFunctions/interfaces/int_linspace.h b/src/c/elementaryFunctions/interfaces/int_linspace.h
index f8af947..15ea269 100644
--- a/src/c/elementaryFunctions/interfaces/int_linspace.h
+++ b/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/src/c/elementaryFunctions/linspace/slinspacea.c b/src/c/elementaryFunctions/linspace/slinspacea.c
new file mode 100644
index 0000000..38af394
--- /dev/null
+++ b/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/src/c/elementaryFunctions/linspace/slinspaces.c b/src/c/elementaryFunctions/linspace/slinspaces.c
new file mode 100644
index 0000000..2404f4d
--- /dev/null
+++ b/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/src/c/interpolation/includes/interp1.h b/src/c/interpolation/includes/interp1.h
index 1c01417..738bfe6 100644
--- a/src/c/interpolation/includes/interp1.h
+++ b/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/src/c/interpolation/interfaces/int_interp1.h b/src/c/interpolation/interfaces/int_interp1.h
index 6d579e1..07d8ece 100644
--- a/src/c/interpolation/interfaces/int_interp1.h
+++ b/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/src/c/interpolation/interp1/sinterp13a.c b/src/c/interpolation/interp1/sinterp13a.c
new file mode 100644
index 0000000..b8cb085
--- /dev/null
+++ b/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/src/c/signalProcessing/includes/dct.h b/src/c/signalProcessing/includes/dct.h
index 5255241..80668ff 100644
--- a/src/c/signalProcessing/includes/dct.h
+++ b/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/src/c/signalProcessing/includes/idct.h b/src/c/signalProcessing/includes/idct.h
index 13458b7..1e7b85b 100644
--- a/src/c/signalProcessing/includes/idct.h
+++ b/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/src/c/signalProcessing/interfaces/int_dct.h b/src/c/signalProcessing/interfaces/int_dct.h
index 6cfb21c..3481c4d 100644
--- a/src/c/signalProcessing/interfaces/int_dct.h
+++ b/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/src/c/signalProcessing/interfaces/int_idct.h b/src/c/signalProcessing/interfaces/int_idct.h
index c3a174a..f705fe2 100644
--- a/src/c/signalProcessing/interfaces/int_idct.h
+++ b/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/src/c/signalProcessing/transforms/dct/sdcta.c b/src/c/signalProcessing/transforms/dct/sdcta.c
new file mode 100644
index 0000000..9f380e8
--- /dev/null
+++ b/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/src/c/signalProcessing/transforms/idct/sidcta.c b/src/c/signalProcessing/transforms/idct/sidcta.c
new file mode 100644
index 0000000..62f85da
--- /dev/null
+++ b/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/src/c/string/ascii/ascii.h b/src/c/string/ascii/ascii.h
deleted file mode 100644
index 2d46b74..0000000
--- a/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/src/c/string/ascii/int_ascii.h b/src/c/string/ascii/int_ascii.h
deleted file mode 100644
index 36d83f8..0000000
--- a/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/src/c/string/strchr/int_strchr.h b/src/c/string/strchr/int_strchr.h
deleted file mode 100644
index 8747545..0000000
--- a/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/src/c/string/strchr/strchr.h b/src/c/string/strchr/strchr.h
deleted file mode 100644
index 7e30641..0000000
--- a/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/src/c/string/strcspn/int_strcspn b/src/c/string/strcspn/int_strcspn
deleted file mode 100644
index f2da3e4..0000000
--- a/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/src/c/string/strcspn/strcspn.h b/src/c/string/strcspn/strcspn.h
deleted file mode 100644
index 6170afa..0000000
--- a/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/src/c/string/strncpy/int_strncpy.h b/src/c/string/strncpy/int_strncpy.h
deleted file mode 100644
index fcf245e..0000000
--- a/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/src/c/string/strncpy/strncpy.h b/src/c/string/strncpy/strncpy.h
deleted file mode 100644
index 3885550..0000000
--- a/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/src/c/string/strspn/gstrspna.c b/src/c/string/strspn/gstrspna.c
index 94a5181..af1acbb 100644
--- a/src/c/string/strspn/gstrspna.c
+++ b/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/src/c/string/strspn/int_strspn.h b/src/c/string/strspn/int_strspn.h
deleted file mode 100644
index 506b311..0000000
--- a/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/src/c/string/strspn/strspn.h b/src/c/string/strspn/strspn.h
deleted file mode 100644
index f7c2a3c..0000000
--- a/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 */