move files cpp + some fixs(to check)
Allan CORNET [Wed, 19 Aug 2009 17:41:29 +0000 (19:41 +0200)]
21 files changed:
scilab/modules/api_scilab/Makefile.am
scilab/modules/api_scilab/api_scilab.vcproj
scilab/modules/api_scilab/src/cpp/api_boolean.cpp [moved from scilab/modules/api_scilab/src/c/api_boolean.cpp with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_boolean_sparse.cpp [moved from scilab/modules/api_scilab/src/c/api_boolean_sparse.cpp with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_common.cpp [moved from scilab/modules/api_scilab/src/c/api_common.cpp with 97% similarity]
scilab/modules/api_scilab/src/cpp/api_double.cpp [moved from scilab/modules/api_scilab/src/c/api_double.cpp with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_int.cpp [moved from scilab/modules/api_scilab/src/c/api_int.cpp with 98% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_boolean.h [moved from scilab/modules/api_scilab/src/c/api_internal_boolean.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_boolean_sparse.h [moved from scilab/modules/api_scilab/src/c/api_internal_boolean_sparse.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_common.h [moved from scilab/modules/api_scilab/src/c/api_internal_common.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_double.h [moved from scilab/modules/api_scilab/src/c/api_internal_double.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_int.h [moved from scilab/modules/api_scilab/src/c/api_internal_int.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_pointer.h [moved from scilab/modules/api_scilab/src/c/api_internal_pointer.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_poly.h [moved from scilab/modules/api_scilab/src/c/api_internal_poly.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_sparse.h [moved from scilab/modules/api_scilab/src/c/api_internal_sparse.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_internal_string.h [moved from scilab/modules/api_scilab/src/c/api_internal_string.h with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_list.cpp [moved from scilab/modules/api_scilab/src/c/api_list.cpp with 99% similarity]
scilab/modules/api_scilab/src/cpp/api_pointer.cpp [moved from scilab/modules/api_scilab/src/c/api_pointer.cpp with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_poly.cpp [moved from scilab/modules/api_scilab/src/c/api_poly.cpp with 99% similarity]
scilab/modules/api_scilab/src/cpp/api_sparse.cpp [moved from scilab/modules/api_scilab/src/c/api_sparse.cpp with 100% similarity]
scilab/modules/api_scilab/src/cpp/api_string.cpp [moved from scilab/modules/api_scilab/src/c/api_string.cpp with 99% similarity]

index 63f1c5c..a242d0f 100644 (file)
@@ -4,16 +4,18 @@
 ##########
 
 ### SOURCES ###
-API_SCILAB_C_SOURCES = src/c/api_boolean.c \
-src/c/api_boolean_sparse.c \
-src/c/api_common.c \
-src/c/api_double.c \
-src/c/api_int.c \
-src/c/api_list.c \
-src/c/api_poly.c \
-src/c/api_sparse.c \
-src/c/api_string.c \
-src/c/api_pointer.c
+
+
+API_SCILAB_CPP_SOURCES = src/cpp/api_boolean.cpp \
+src/cpp/api_boolean_sparse.cpp \
+src/cpp/api_common.cpp \
+src/cpp/api_double.cpp \
+src/cpp/api_int.cpp \
+src/cpp/api_list.cpp \
+src/cpp/api_poly.cpp \
+src/cpp/api_sparse.cpp \
+src/cpp/api_string.cpp \
+src/cpp/api_pointer.cpp
 
 
 libsciapi_scilab_la_CFLAGS=-I$(srcdir)/includes/ \
@@ -25,16 +27,25 @@ libsciapi_scilab_la_CFLAGS=-I$(srcdir)/includes/ \
 -I$(top_srcdir)/modules/output_stream/includes \
 -I$(top_srcdir)/modules/string/includes
 
+libsciapi_scilab_la_CPPFLAGS=-I$(srcdir)/includes/ \
+-I$(srcdir)/src/cpp/ \
+-I$(top_srcdir)/modules/core/includes \
+-I$(top_srcdir)/modules/call_scilab/includes \
+-I$(top_srcdir)/libs/MALLOC/includes/ \
+-I$(top_srcdir)/modules/localization/includes \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/string/includes
+
 
 pkglib_LTLIBRARIES = libsciapi_scilab.la
 
 libsciapi_scilab_la_LDFLAGS = -version-info $(SCILAB_LIBRARY_VERSION)
 
-libsciapi_scilab_la_SOURCES = $(API_SCILAB_C_SOURCES) $(GATEWAY_C_SOURCES)
+libsciapi_scilab_la_SOURCES = $(API_SCILAB_C_SOURCES) $(API_SCILAB_CPP_SOURCES) $(GATEWAY_C_SOURCES)
 
 # For the code check (splint)
 CHECK_SRC= $(libsciapi_scilab_la_SOURCES)
-INCLUDE_FLAGS = $(libsciapi_scilab_la_CFLAGS)
+INCLUDE_FLAGS = $(libsciapi_scilab_la_CFLAGS) 
 
 libsciapi_scilab_la_LIBADD =  $(top_builddir)/modules/core/libscicore.la
 
index a5f186f..ff319e4 100644 (file)
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
                        >
                        <File
-                               RelativePath=".\src\c\api_boolean.cpp"
+                               RelativePath=".\src\cpp\api_boolean.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_boolean_sparse.cpp"
+                               RelativePath=".\src\cpp\api_boolean_sparse.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_common.cpp"
+                               RelativePath=".\src\cpp\api_common.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_double.cpp"
+                               RelativePath=".\src\cpp\api_double.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_int.cpp"
+                               RelativePath=".\src\cpp\api_int.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_list.cpp"
+                               RelativePath=".\src\cpp\api_list.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_pointer.cpp"
+                               RelativePath=".\src\cpp\api_pointer.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_poly.cpp"
+                               RelativePath=".\src\cpp\api_poly.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_sparse.cpp"
+                               RelativePath=".\src\cpp\api_sparse.cpp"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_string.cpp"
+                               RelativePath=".\src\cpp\api_string.cpp"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_boolean.h"
+                               RelativePath=".\src\cpp\api_internal_boolean.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_boolean_sparse.h"
+                               RelativePath=".\src\cpp\api_internal_boolean_sparse.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_common.h"
+                               RelativePath=".\src\cpp\api_internal_common.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_double.h"
+                               RelativePath=".\src\cpp\api_internal_double.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_int.h"
+                               RelativePath=".\src\cpp\api_internal_int.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_pointer.h"
+                               RelativePath=".\src\cpp\api_internal_pointer.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_poly.h"
+                               RelativePath=".\src\cpp\api_internal_poly.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_sparse.h"
+                               RelativePath=".\src\cpp\api_internal_sparse.h"
                                >
                        </File>
                        <File
-                               RelativePath=".\src\c\api_internal_string.h"
+                               RelativePath=".\src\cpp\api_internal_string.h"
                                >
                        </File>
                        <File
 #include "Scierror.h"
 /*--------------------------------------------------------------------------*/
 /* Defined in SCI/modules/core/src/fortran/cvname.f */
+extern "C" {
 extern int C2F(cvnamel)(int *id,char *str,int *jobptr,int *str_len); 
 /* *jobptr==0: Get Scilab codes from C-string */
 /* *jobptr==1: Get C-string from Scilab codes */
 
 extern int C2F(stackp)(int *,int *);
+};
 /*--------------------------------------------------------------------------*/
 #define idstk(x,y) (C2F(vstk).idstk+(x-1)+(y-1)*nsiz)
 #define CvNameL(id,str,jobptr,str_len) C2F(cvnamel)(id,str,jobptr,str_len);
@@ -413,7 +415,7 @@ int getDimFromVar(int* _piAddress, int* _piVal)
                case SCI_UINT8 :
                        {
                                unsigned char* pucData          = NULL;
-                               iRet = getMatrixOfInteger8(_piAddress, &iRows, &iCols, &pucData);
+                               iRet = getMatrixOfUnsignedInteger8(_piAddress, &iRows, &iCols, &pucData);
                                if(iRet)
                                {
                                        return 1;
@@ -435,7 +437,7 @@ int getDimFromVar(int* _piAddress, int* _piVal)
                case SCI_UINT16 :
                        {
                                unsigned short* pusData         = NULL;
-                               iRet = getMatrixOfInteger16(_piAddress, &iRows, &iCols, &pusData);
+                               iRet = getMatrixOfUnsignedInteger16(_piAddress, &iRows, &iCols, &pusData);
                                if(iRet)
                                {
                                        return 1;
@@ -457,7 +459,7 @@ int getDimFromVar(int* _piAddress, int* _piVal)
                case SCI_UINT32 :
                        {
                                unsigned int* puiData           = NULL;
-                               iRet = getMatrixOfInteger32(_piAddress, &iRows, &iCols, &puiData);
+                               iRet = getMatrixOfUnsignedInteger32(_piAddress, &iRows, &iCols, &puiData);
                                if(iRet)
                                {
                                        return 1;
similarity index 98%
rename from scilab/modules/api_scilab/src/c/api_int.cpp
rename to scilab/modules/api_scilab/src/cpp/api_int.cpp
index 5269c41..52ab730 100644 (file)
@@ -209,7 +209,7 @@ int allocMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char** _pcData8)
                return 1;
        }
 
-       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT8, _iRows, _iCols, (void*)&pcData8);
+       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT8, _iRows, _iCols, (void**)&pcData8);
        if(iRet)
        {
                return 1;
@@ -231,7 +231,7 @@ int allocMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short** _psData16)
                return 1;
        }
 
-       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT16, _iRows, _iCols, (void*)&psData16);
+       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT16, _iRows, _iCols, (void**)&psData16);
        if(iRet)
        {
                return 1;
@@ -253,7 +253,7 @@ int allocMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int** _piData32)
                return 1;
        }
 
-       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT32, _iRows, _iCols, (void*)&piData32);
+       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT32, _iRows, _iCols, (void**)&piData32);
        if(iRet)
        {
                return 1;
@@ -282,7 +282,7 @@ int allocMatrixOfUnsignedInteger8(int _iVar, int _iRows, int _iCols, unsigned ch
                return 1;
        }
 
-       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_UINT8, _iRows, _iCols, (void*)&pucData8);
+       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_UINT8, _iRows, _iCols, (void**)&pucData8);
        if(iRet)
        {
                return 1;
@@ -304,7 +304,7 @@ int allocMatrixOfUnsignedInteger16(int _iVar, int _iRows, int _iCols, unsigned s
                return 1;
        }
 
-       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_UINT16, _iRows, _iCols, (void*)&pusData16);
+       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_UINT16, _iRows, _iCols, (void**)&pusData16);
        if(iRet)
        {
                return 1;
@@ -326,7 +326,7 @@ int allocMatrixOfUnsignedInteger32(int _iVar, int _iRows, int _iCols, unsigned i
                return 1;
        }
 
-       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT32, _iRows, _iCols, (void*)&puiData32);
+       iRet = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT32, _iRows, _iCols, (void**)&puiData32);
        if(iRet)
        {
                return 1;
@@ -1415,32 +1415,32 @@ static int allocCommonMatrixOfIntegerInList(int _iVar, int* _piParent, int _iIte
 
 int allocMatrixOfUnsignedInteger8InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, unsigned char** _pucData)
 {
-       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT8, _iRows, _iCols, _pucData);
+       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT8, _iRows, _iCols, (void **)_pucData);
 }
 
 int allocMatrixOfUnsignedInteger16InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, unsigned short** _pusData)
 {
-       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT16, _iRows, _iCols, _pusData);
+       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT16, _iRows, _iCols, (void**)_pusData);
 }
 
 int allocMatrixOfUnsignedInteger32InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, unsigned int** _puiData)
 {
-       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT32, _iRows, _iCols, _puiData);
+       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT32, _iRows, _iCols, (void**)_puiData);
 }
 
 int allocMatrixOfInteger8InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char** _pcData)
 {
-       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT8, _iRows, _iCols, _pcData);
+       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT8, _iRows, _iCols, (void**)_pcData);
 }
 
 int allocMatrixOfInteger16InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, short** _psData)
 {
-       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT16, _iRows, _iCols, _psData);
+       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT16, _iRows, _iCols, (void**)_psData);
 }
 
 int allocMatrixOfInteger32InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int** _piData)
 {
-       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT32, _iRows, _iCols, _piData);
+       return allocCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT32, _iRows, _iCols, (void**)_piData);
 }
 
 static int createCommomMatrixOfIntegerInList(int _iVar, int* _piParent, int _iItemPos, int _iPrecision, int _iRows, int _iCols, void* _pvData)
@@ -1513,32 +1513,32 @@ static int getCommonMatrixOfIntegerInList(int _iVar, int* _piParent, int _iItemP
 
 int getMatrixOfUnsignedInteger8InList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, unsigned char** _pucData)
 {
-       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT8, _piRows, _piCols, _pucData);
+       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT8, _piRows, _piCols, (void**)_pucData);
 }
 
 int getMatrixOfUnsignedInteger16InList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, unsigned short** _pusData)
 {
-       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT16, _piRows, _piCols, _pusData);
+       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT16, _piRows, _piCols, (void**)_pusData);
 }
 
 int getMatrixOfUnsignedInteger32InList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, unsigned int** _puiData)
 {
-       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT32, _piRows, _piCols, _puiData);
+       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_UINT32, _piRows, _piCols, (void**)_puiData);
 }
 
 int getMatrixOfInteger8InList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, char** _pcData)
 {
-       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT8, _piRows, _piCols, _pcData);
+       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT8, _piRows, _piCols, (void**)_pcData);
 }
 
 int getMatrixOfInteger16InList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, short** _psData)
 {
-       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT16, _piRows, _piCols, _psData);
+       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT16, _piRows, _piCols, (void**)_psData);
 }
 
 int getMatrixOfInteger32InList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int** _piData)
 {
-       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT32, _piRows, _piCols, _piData);
+       return getCommonMatrixOfIntegerInList(_iVar, _piParent, _iItemPos, SCI_INT32, _piRows, _piCols, (void**)_piData);
 }
 
 static int createCommonMatrixOfIntegerInNamedList(char* _pstName, int* _piParent, int _iItemPos, int _iPrecision, int _iRows, int _iCols, void* _pvData)
@@ -21,8 +21,9 @@
 #include "MALLOC.h"
 #include "CallScilab.h"
 #include "stack-c.h"
+extern "C" {
 #include "code2str.h"
-
+};
 
 int getPolyVariableName(int* _piAddress, char* _pstVarName, int* _piVarNameLen)
 {
 #include "api_common.h"
 #include "api_internal_common.h"
 #include "api_string.h"
-
+#include "api_internal_string.h"
 #include "CallScilab.h"
 #include "stack-c.h"
+extern "C"
+{
 #include "code2str.h"
-#include "api_internal_string.h"
 #include "freeArrayOfString.h"
+};
 /*--------------------------------------------------------------------------*/
 
 /*******************************/