]> git.stg.codes - stg.git/blobdiff - stglibs/ibpp.lib/_spb.cpp
Port to CMake, get rid of os_int.h.
[stg.git] / stglibs / ibpp.lib / _spb.cpp
diff --git a/stglibs/ibpp.lib/_spb.cpp b/stglibs/ibpp.lib/_spb.cpp
deleted file mode 100644 (file)
index 632a020..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////\r
-//\r
-//     File    : $Id: _spb.cpp,v 1.2 2009/03/19 20:00:27 faust Exp $\r
-//     Subject : IBPP, internal SPB class implementation\r
-//\r
-///////////////////////////////////////////////////////////////////////////////\r
-//\r
-//     (C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org)\r
-//\r
-//     The contents of this file are subject to the IBPP License (the "License");\r
-//     you may not use this file except in compliance with the License.  You may\r
-//     obtain a copy of the License at http://www.ibpp.org or in the 'license.txt'\r
-//     file which must have been distributed along with this file.\r
-//\r
-//     This software, distributed under the License, is distributed on an "AS IS"\r
-//     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the\r
-//     License for the specific language governing rights and limitations\r
-//     under the License.\r
-//\r
-///////////////////////////////////////////////////////////////////////////////\r
-//\r
-//     COMMENTS\r
-//     * SPB == Service Parameter Block/Buffer, see Interbase 6.0 C-API\r
-//     * Tabulations should be set every four characters when editing this file.\r
-//\r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifdef _MSC_VER\r
-#pragma warning(disable: 4786 4996)\r
-#ifndef _DEBUG\r
-#pragma warning(disable: 4702)\r
-#endif\r
-#endif\r
-\r
-#include "_ibpp.h"\r
-\r
-#ifdef HAS_HDRSTOP\r
-#pragma hdrstop\r
-#endif\r
-\r
-#include <cstring>\r
-\r
-using namespace ibpp_internals;\r
-\r
-const int SPB::BUFFERINCR = 128;\r
-\r
-void SPB::Grow(int needed)\r
-{\r
-       if ((mSize + needed) > mAlloc)\r
-       {\r
-               // We need to grow the buffer. We use increments of BUFFERINCR bytes.\r
-               needed = (needed / BUFFERINCR + 1) * BUFFERINCR;\r
-               char* newbuffer = new char[mAlloc + needed];\r
-               if (mBuffer != 0)\r
-               {\r
-                       // Move the old buffer content to the new one\r
-                       memcpy(newbuffer, mBuffer, mSize);\r
-                       delete [] mBuffer;\r
-               }\r
-               mBuffer = newbuffer;\r
-               mAlloc += needed;\r
-       }\r
-}\r
-\r
-void SPB::Insert(char opcode)\r
-{\r
-       Grow(1);\r
-       mBuffer[mSize++] = opcode;\r
-}\r
-\r
-void SPB::InsertString(char type, int lenwidth, const char* data)\r
-{\r
-       int16_t len = (int16_t)strlen(data);\r
-\r
-       Grow(1 + lenwidth + len);\r
-       mBuffer[mSize++] = type;\r
-       switch (lenwidth)\r
-       {\r
-               case 1 :        mBuffer[mSize] = char(len); mSize++; break;\r
-               case 2 :        *(int16_t*)&mBuffer[mSize] = int16_t((*gds.Call()->m_vax_integer)((char*)&len, 2));\r
-                                       mSize += 2; break;\r
-               default :       throw LogicExceptionImpl("IISPB::IISPB", _("Invalid length parameter"));\r
-       }\r
-       strncpy(&mBuffer[mSize], data, len);\r
-       mSize += len;\r
-}\r
-\r
-void SPB::InsertByte(char type, char data)\r
-{\r
-       Grow(1 + 1);\r
-       mBuffer[mSize++] = type;\r
-       mBuffer[mSize++] = data;\r
-}\r
-\r
-void SPB::InsertQuad(char type, int32_t data)\r
-{\r
-       Grow(1 + 4);\r
-       mBuffer[mSize++] = type;\r
-       *(int32_t*)&mBuffer[mSize] = int32_t((*gds.Call()->m_vax_integer)((char*)&data, 4));\r
-       mSize += 4;\r
-}\r
-\r
-void SPB::Reset()\r
-{\r
-       if (mBuffer != 0)\r
-       {\r
-               delete [] mBuffer;\r
-               mBuffer = 0;\r
-               mSize = 0;\r
-               mAlloc = 0;\r
-    }\r
-}\r
-\r
-/*\r
-void SPB::Insert(char type, short data)\r
-{\r
-       Grow(1 + 3);\r
-       mBuffer[mSize++] = type;\r
-       mBuffer[mSize++] = char(2);\r
-       *(short*)&mBuffer[mSize] = data;\r
-       mSize += 2;\r
-}\r
-\r
-void SPB::Insert(char type, bool data)\r
-{\r
-       Grow(1 + 2);\r
-       mBuffer[mSize++] = type;\r
-       mBuffer[mSize++] = char(1);\r
-       mBuffer[mSize++] = char(data ? 1 : 0);\r
-}\r
-*/\r
-\r
-//\r
-//     EOF\r
-//\r