summaryrefslogtreecommitdiff
path: root/2.3-1/macros/CCodeGeneration/C_Type.sci
blob: d296c5c6752ce5615b3f939b10cf89490493a407 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function OutC_Type = C_Type(ArgType)
// function OutC_Type = C_Type(ArgType)
// -----------------------------------------------------------------
// //NUT: add description here
//
// Input data:
// //NUT: add description here
//
// Output data:
// //NUT: add description here
//
// Status:
// 27-Oct-2007 -- Raffaele Nutricato: Author.
//
// Copyright 2007 Raffaele Nutricato.
// Contact: raffaele.nutricato@tiscali.it
// -----------------------------------------------------------------

// ------------------------------
// --- Check input arguments. ---
// ------------------------------
SCI2CNInArgCheck(argn(2),1,1);

if (ArgType == 's')
   OutC_Type = 'float';
elseif (ArgType == 'd')
   OutC_Type = 'double';
elseif (ArgType == 'c')
   OutC_Type = 'floatComplex';
elseif (ArgType == 'z')
   OutC_Type = 'doubleComplex';
elseif (ArgType == 'i')
   OutC_Type = 'int';
elseif (ArgType == 'g')
   OutC_Type = 'char';
elseif (ArgType == 'f')
   OutC_Type = 'FILE *';
elseif (ArgType == 'u8')
   OutC_Type = 'uint8';
elseif (ArgType == 'i8')
   OutC_Type = 'int8';
elseif (ArgType == 'u16')
   OutC_Type = 'uint16';
elseif (ArgType == 'i16')
   OutC_Type = 'int16';
elseif (ArgType == 'u32')
   OutC_Type = 'uint32';
elseif (ArgType == 'i32')
   OutC_Type = 'int32';
elseif (ArgType == 'fn') //This type introduced for ODE function,
   // as it's one of the inout argument is  name of the other function 
   OutC_Type = '';
elseif (ArgType ==  'mt')
   OutC_Type = 'Mat'
elseif (ArgType == 'ss') 
   OutC_Type = 'double'
   //This type is introduced for storing state space systems. 
   //It is a matrix of size (n+k)*(n+m+1), for n states, m inputs,
   //k outputs. It stores matrices A,B,C,D and initial state in following form
   //    | A B X0 |
   //    | C D 0  |
   	   
else
   error(9999, 'Unknown Argument Type: ""'+ArgType+'"".');
end
endfunction