summaryrefslogtreecommitdiff
path: root/2.3-1/macros/ToolInitialization/ManageNextConversion.sci
blob: a15247668b7bf602210deab5031c99294bd90eed (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
function FlagContinueTranslation = ManageNextConversion(FileInfoDatFile)
// function FlagContinueTranslation = ManageNextConversion(FileInfoDatFile)
// -----------------------------------------------------------------
// //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
// -----------------------------------------------------------------

//NUT: verifica se update e managenexconversion possono essere integrate in un'unica funzione.

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

// ---------------------
// --- Load section. ---
// ---------------------
// --- Load File Info Structure. ---
load(FileInfoDatFile,'FileInfo');

// --- Load Shared Info Structure. ---
load(FileInfo.SharedInfoDatFile,'SharedInfo');

// --- Load ToBeConverted .dat file. ---
load(FileInfo.FunctionList.ToBeConvertedDat,'ToBeConverted');
// -------------------------
// --- End load section. ---
// -------------------------

FlagContinueTranslation = 0;

// ------------------------------------
// --- Finalize the current C code. ---
// ------------------------------------
C_FinalizeCode(FileInfo,SharedInfo);

// ------------------------------------------------
// --- Identify the next function to translate. ---
// ------------------------------------------------
SharedInfo.NFilesToTranslate = SharedInfo.NFilesToTranslate - 1;

if (SharedInfo.NFilesToTranslate >= 1)
   // Remove the translated C function from the ToBeConverted list
   ToBeConverted(1) = [];
   FlagContinueTranslation = 1;
   SharedInfo.NextSCIFunName   = ToBeConverted(1).SCIFunctionName;
   SharedInfo.NextCFunName     = ToBeConverted(1).CFunctionName;
   SharedInfo.NextSCIFunNumber = SharedInfo.NextSCIFunNumber + 1;
   [FlagFound,SharedInfo.NextSCIFileName] = ...
      SCI2CFindFile(FileInfo.UserSciFilesPaths,SharedInfo.NextSCIFunName+'.sci');
   if (FlagFound == 0)
      error(9999, 'Cannot find a scilab file to generate ""'+SharedInfo.NextCFunName+'"".');
   end
end
// ----------------------------------------------------
// --- End Identify the next function to translate. ---
// ----------------------------------------------------


// ---------------------
// --- Save section. ---
// ---------------------
// --- Save Shared Info Structure. ---
save(FileInfo.SharedInfoDatFile, "SharedInfo");
clear SharedInfo

// --- Save ToBeConverted .dat file. ---
save(FileInfo.FunctionList.ToBeConvertedDat, "ToBeConverted");
clear ToBeConverted

clear FileInfo
// -------------------------
// --- End Save section. ---
// -------------------------

endfunction