move optional argument old API out of stack-c.h into stack-optional.h 60/13660/4
Simon Marchetto [Tue, 4 Feb 2014 16:24:30 +0000 (17:24 +0100)]
Change-Id: I7b603e926184fdf5fa7363d1cf3bbb0e9560ca08
Reason: remove dependency from api_optional.h to stack-c.h

scilab/modules/api_scilab/includes/api_optional.h
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/core.iss
scilab/modules/core/includes/stack-c.h
scilab/modules/core/includes/stack-optional.h [new file with mode: 0644]
scilab/modules/core/src/c/core.vcxproj

index 757bb54..2fac23d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2012 - Scilab Enterprises - Antoine ELIAS
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
  *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
@@ -9,14 +9,15 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
  */
 
-#ifndef __OPTINAL_API__
-#define __OPTINAL_API__
+#ifndef __OPTIONAL_API__
+#define __OPTIONAL_API__
 
 #if !defined(__INTERNAL_API_SCILAB__)
-#error Do not include api_optinal.h. Include api_scilab.h instead.
+#error Do not include api_optional.h. Include api_scilab.h instead.
 #endif
 
-#include "stack-c.h"
+#include "stack-optional.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -32,4 +33,4 @@ extern "C" {
 #ifdef __cplusplus
 }
 #endif
-#endif /* __OPTINAL_API__ */
+#endif /* __OPTIONAL_API__ */
index afbdf9f..815d0bb 100644 (file)
@@ -371,6 +371,7 @@ includes/stack.h \
 includes/stack1.h \
 includes/stack2.h \
 includes/stack3.h \
+includes/stack-optional.h \
 includes/stackinfo.h \
 includes/stackTypeVariable.h \
 includes/version.h \
index 5710d19..3565db1 100644 (file)
@@ -1124,6 +1124,7 @@ includes/stack.h \
 includes/stack1.h \
 includes/stack2.h \
 includes/stack3.h \
+includes/stack-optional.h \
 includes/stackinfo.h \
 includes/stackTypeVariable.h \
 includes/version.h \
index af9eb7b..a37c799 100644 (file)
@@ -55,6 +55,7 @@ Source: modules\{#CORE}\includes\stack1.h; DestDir: {app}\modules\{#CORE}\includ
 Source: modules\{#CORE}\includes\stack2.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\includes\stack3.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\includes\stack-c.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
+Source: modules\{#CORE}\includes\stack-optional.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\includes\sci_types.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\includes\stack-def.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\includes\stack.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
index 3939ebb..37024df 100644 (file)
@@ -39,6 +39,7 @@ extern "C" {
 #include "stack1.h"
 #include "stack2.h"
 #include "stack3.h"
+#include "stack-optional.h"
 #include "sci_types.h"
 
     /*-------------------------------------------------
@@ -133,15 +134,7 @@ extern "C" {
     /* to retreive handles on the stack */
 #define hstk(x) (((long long *) C2F(stack).Stk) + x-1 )
 
-#define CheckOpt(first) if ( C2F(checkopt)(first) ) {return 0;}
 
-#define FirstOpt() C2F(firstopt)()
-
-#define FindOpt(str,opts) C2F(findopt)(str,opts)
-
-#define NumOpt() C2F(numopt)()
-
-#define IsOpt(k,name) C2F(isopt)((c_local=k,&c_local),name,nlgh)
 
 #define Maxvol(n,ct)  C2F(maxvol)((c_local=n,&c_local),ct,1L)
 
@@ -327,19 +320,6 @@ extern "C" {
 #define CheckListScalar(lpos,pos,m,n) if (! check_list_scalar(lpos,pos,m,n)) return 0;
 #define CheckListOneDim(lpos,pos,dim,val,valref) if (! check_list_one_dim(lpos,pos,dim,val,valref)) return 0;
 
-    /*-------------------------------------------------
-     * structure used for optional arguments in interfaces
-     * -------------------------------------------------*/
-
-    typedef struct rhs_opts__
-    {
-        int iPos ; /** stack position : -1 if not present */
-        char* pstName;
-        int iType;// -1 not yet defined
-        int iRows;
-        int iCols;
-        int* piAddr;
-    } rhs_opts;
 
     int get_optionals(char *name, rhs_opts opts[]);
 
diff --git a/scilab/modules/core/includes/stack-optional.h b/scilab/modules/core/includes/stack-optional.h
new file mode 100644 (file)
index 0000000..9efec62
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises
+ *
+ * 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.1-en.txt
+ */
+
+#ifndef __STACK_OPTIONAL__
+#define __STACK_OPTIONAL__
+
+#define CheckOpt(first) if ( C2F(checkopt)(first) ) {return 0;}
+
+#define FirstOpt() C2F(firstopt)()
+
+#define FindOpt(str,opts) C2F(findopt)(str,opts)
+
+#define NumOpt() C2F(numopt)()
+
+#define IsOpt(k,name) C2F(isopt)((c_local=k,&c_local),name,nlgh)
+
+/*-------------------------------------------------
+ * structure used for optional arguments in interfaces
+ * -------------------------------------------------*/
+typedef struct rhs_opts__
+{
+    int iPos ; /** stack position : -1 if not present */
+    char* pstName;
+    int iType;// -1 not yet defined
+    int iRows;
+    int iCols;
+    int* piAddr;
+} rhs_opts;
+
+#endif /* __STACK_OPTIONAL__ */
index 28f9208..9c4a913 100644 (file)
@@ -479,6 +479,7 @@ cd ..
     <ClInclude Include="..\..\includes\stack2.h" />
     <ClInclude Include="..\..\includes\stack3.h" />
     <ClInclude Include="..\..\includes\stackinfo.h" />
+    <ClInclude Include="..\..\includes\stack-optional.h" />
     <ClInclude Include="..\..\includes\storeCommand.h" />
     <ClInclude Include="saveCWDInPreferences.h" />
     <ClInclude Include="str2sci.h" />
@@ -614,4 +615,4 @@ cd ..
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>