summaryrefslogtreecommitdiff
path: root/2.3-1/macros/FunctionAnnotation/FA_TP_USER.sci
diff options
context:
space:
mode:
authorSandeep Gupta2017-06-18 23:55:40 +0530
committerSandeep Gupta2017-06-18 23:55:40 +0530
commitb43eccd4cffed5bd1017c5821524fb6e49202f78 (patch)
tree4c53d798252cbeae9bcf7dc9604524b20bb10f27 /2.3-1/macros/FunctionAnnotation/FA_TP_USER.sci
downloadScilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.gz
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.tar.bz2
Scilab2C-b43eccd4cffed5bd1017c5821524fb6e49202f78.zip
First commit
Diffstat (limited to '2.3-1/macros/FunctionAnnotation/FA_TP_USER.sci')
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_TP_USER.sci38
1 files changed, 38 insertions, 0 deletions
diff --git a/2.3-1/macros/FunctionAnnotation/FA_TP_USER.sci b/2.3-1/macros/FunctionAnnotation/FA_TP_USER.sci
new file mode 100644
index 00000000..e60a8ce8
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_TP_USER.sci
@@ -0,0 +1,38 @@
+function type_out = FA_TP_USER(PrecisionSpecifier,DefaultType)
+// function type_out = FA_TP_USER(PrecisionSpecifier,DefaultType)
+// -----------------------------------------------------------------
+// Generate the output type of the output argument by using the
+// output (AnnotationFnc) generated by CheckAnnotationFunction.
+// double and float functions can be used to specify the type
+// of the output argument. They are typically used in combination
+// with zeros-like function.
+//
+// Input data:
+// PrecisionSpecifier: it can be 'double' or 'float'.
+//
+// Output data:
+// type_out: specifies the type of the output argument. It can be
+// 's' for float precision or 'd' for double precision.
+//
+// Status:
+// 26-Oct-2007 -- Raffaele Nutricato: Author.
+// 26-Oct-2007 -- Alberto Morea: Test Ok.
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),2,2);
+
+if (mtlb_strcmp(PrecisionSpecifier,'int'))
+ type_out = 'i';
+elseif (mtlb_strcmp(PrecisionSpecifier,'float'))
+ type_out = 's';
+elseif (mtlb_strcmp(PrecisionSpecifier,'double'))
+ type_out = 'd';
+elseif (mtlb_strcmp(PrecisionSpecifier,'default'))
+ type_out = DefaultType;
+else
+ error(9999, 'Unknown precision function: ""'+AnnotationFnc+'"".');
+end
+endfunction