diff options
author | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
---|---|---|
committer | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
commit | db464f35f5a10b58d9ed1085e0b462689adee583 (patch) | |
tree | de5cdbc71a54765d9fec33414630ae2c8904c9b8 /macros/FunctionList/FL_GetFunctionClass.sci | |
download | Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.gz Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.bz2 Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.zip |
Original Version
Diffstat (limited to 'macros/FunctionList/FL_GetFunctionClass.sci')
-rw-r--r-- | macros/FunctionList/FL_GetFunctionClass.sci | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/macros/FunctionList/FL_GetFunctionClass.sci b/macros/FunctionList/FL_GetFunctionClass.sci new file mode 100644 index 0000000..09fad92 --- /dev/null +++ b/macros/FunctionList/FL_GetFunctionClass.sci @@ -0,0 +1,54 @@ +function SCI2CClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName)
+// function SCI2CClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName)
+// -----------------------------------------------------------------
+// //NUT: add description here
+//
+// Input data:
+// //NUT: add description here
+//
+// Output data:
+// //NUT: add description here
+//
+// Status:
+// 11-Jul-2007 -- Nutricato Raffaele: Author.
+//
+// Copyright 2007 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),3,3);
+
+// ---------------------------------------
+// --- Read the class of the function. ---
+// ---------------------------------------
+// --- Open the .sci file (read only). ---
+inannfid = SCI2COpenFileRead(FunFileName);
+
+FoundClass = 0;
+if (meof(inannfid) == 0)
+ check_string = stripblanks(mgetl(inannfid,1));
+ if (~isempty(check_string))
+ if (SCI2Cstrncmps1size(SCI2CClassSpecifier,check_string))
+ SCI2CClassName = part(check_string,length(SCI2CClassSpecifier)+1:length(check_string));
+ // #RNU_RES_B
+ PrintStringInfo(' Function belongs to class: '+SCI2CClassName+'.',ReportFileName,'file','y');
+ // #RNU_RES_E
+ FoundClass = 1;
+ else
+ error(9999, 'Could not find ""'+SCI2CClassSpecifier+'"" in '+FunFileName+'.');
+ end
+ end
+end
+mclose(inannfid);
+if (FoundClass == 0)
+ error(9999, 'Could not find ""'+SCI2CClassSpecifier+'"" specifier.');
+end
+
+// -------------------------------------------
+// --- End read the class of the function. ---
+// -------------------------------------------
+endfunction
+
\ No newline at end of file |