/*



    ========== licence begin  GPL
    Copyright (c) 2000-2005 SAP AG

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end





*/
//@B Win
// DBMAPI.IDL
[
uuid(1F305484-6D00-11d4-B2EA-0050DADEFE1A),
helpstring("SAPDB Database Manager API Type Library 7.4"),
lcid (0x00000000),
version(7.4)
]

library DBMAPILib
{

	importlib("stdole2.tlb");

	[
	uuid(1F305486-6D00-11d4-B2EA-0050DADEFE1A),
	helpstring("DBMAPI Constants"),
	dllname("nosuch.dll")
	]
	module DBMAPIConst {

		[ helpstring("Everything works fine.") ]
		const long DBMAPI_RC_OK           =    0;
		[ helpstring("User not exist.") ]
		const long DBMAPI_RC_USR_UNKNOWN  =   -1;
		[ helpstring("Wrong username password combination.") ]
		const long DBMAPI_RC_USR_FALSE    =   -2;
		[ helpstring("Memory error.") ]
		const long DBMAPI_RC_MEMORY       =   -3;
		[ helpstring("Communication error.") ]
		const long DBMAPI_RC_COMMERR      =   -4;
		[ helpstring("Communication buffer to smal.") ]
		const long DBMAPI_RC_TOSMALL      =   -5;
		[ helpstring("Invalid session.") ]
		const long DBMAPI_RC_INVSESSION   =   -6;
		[ helpstring("No more data in packet.") ]
		const long DBMAPI_RC_NOMOREDATA   =   -7;
		[ helpstring("Session released.") ]
		const long DBMAPI_RC_RELEASED     =   -8;
		[ helpstring("User key too long.") ]
		const long DBMAPI_RC_XUSERKEY     =   -9;
		[ helpstring("xUser API error.") ]
		const long DBMAPI_RC_XUSER        =  -10;
		[ helpstring("R/3 TP error.") ]
		const long DBMAPI_RC_R3TP         =  -11;
		[ helpstring("UCS2 conversion error.") ]
		const long DBMAPI_USC2_CN14       =  -12;
		[ helpstring("Common error") ]
		const long DBMAPI_RC_NOT_OK       = -100;

	}

	[
	uuid(1F305485-6D00-11d4-B2EA-0050DADEFE1A),
	helpstring("DBMAPI Functions"),
	dllname("dbmapi.dll")
	]
	module DBMAPI {

		[
		entry("cn14connectDBM"),
		helpstring("Connect the client application with the specified server.")
		]
		long __stdcall Connect (
							[in] LPCWSTR Node,
							[in] LPCWSTR Database,
							[in] LPCWSTR InstRoot,
							[out] long * Session,
							[out] LPWSTR Errortext );

		[
		entry("cn14connectDBMUsr"),
		helpstring("Connect the client application with the specified server and executes a authorization with the user.")
		]
		long __stdcall ConnectUser (
							[in] LPCWSTR Node,
							[in] LPCWSTR Database,
							[in] LPCWSTR InstRoot,
							[in] LPCWSTR User,
							[out] long * Session,
							[out] LPWSTR Errortext );

		[
		entry("cn14release"),
		helpstring("Disconnect the client application from the server program an terminated the server program.")
		]
		void __stdcall Release (
							[in, out] long * Session );

		[
		entry("cn14cmdRequest"),
		helpstring("Write the specified data in the packet and send the paket.")
		]
		long __stdcall Request (
							[in] long Session,
							[in] LPCWSTR Data,
							[in] long Len,
							[out] LPWSTR Errortext );

		[
		entry("cn14replyReceive"),
		helpstring("Receive the answer and read the data from the packet to the provided buffer.")
		]
		long __stdcall Receive (
							[in] long Session,
							[out] LPCWSTR Data,
							[in, out] long * Len,
							[out] LPWSTR Errortext );

		[
		entry("cn14cmdExecute"),
		helpstring("Write the specified data in the packet, send the paket, receive the answer and read the data from the packet to the provided buffer.")
		]
		long __stdcall Execute (
							[in] long Session,
							[in] LPCWSTR DataIn,
							[in] long LenIn,
							[out] LPCWSTR DataOut,
							[in, out] long * LenOut,
							[out] LPWSTR Errortext );
    
		[
		entry("cn14replyAvailable"),
		helpstring("Check if there is an answer available for a pending request.")
		]
		long __stdcall Available (
							[in] long Session,
							[out] LPWSTR Errortext );

		[
		entry("cn14cmdCancel"),
		helpstring("Cancel a pending request.")
		]
		void __stdcall Cancel (
							[in] long Session );
    
		[
		entry("cn14packetstats"),
		helpstring("Returns some information about the current packet.")
		]
		void __stdcall PacketState (
							[in] long Session,
							[out] long * Size,
							[out] long * Len,
							[out] long * pos );
    


	}


};
//@E Win
//
