/*
 *  MICO --- a free CORBA implementation
 *  Copyright (C) 1997-98 Kay Roemer & Arno Puder
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library 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
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public
 *  License along with this library; if not, write to the Free
 *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  Send comments and/or bug reports to:
 *                 mico@informatik.uni-frankfurt.de
 */

#ifndef CORBA_C_H
#define CORBA_C_H 1

#ifndef __corba_h__
#ifdef _WINDOWS
#include <mico/config-win32.h>
#else
#include <mico/config.h>
#endif
#endif
#include <mico/assert.h>
#include <mico/types.h>

#ifndef CPP_WRAPPER
typedef MICO_Short CORBA_short;
typedef MICO_Long CORBA_long;
typedef MICO_UShort CORBA_unsigned_short;
typedef MICO_ULong CORBA_unsigned_long;
typedef MICO_Float CORBA_float;
typedef MICO_Double CORBA_double;
typedef MICO_Char CORBA_char;
typedef MICO_Boolean CORBA_boolean;
typedef MICO_Octet CORBA_octet;
typedef char * CORBA_string;
typedef void * CORBA_TypeCode;
typedef void * CORBA_TypeCode_ptr;
typedef struct {
  CORBA_TypeCode _type;
  void *_value;
} CORBA_any;
typedef void * CORBA_Environment;

typedef void * CORBA_Object; /* Bleah */
typedef void * CORBA_ORB;
typedef void * CORBA_BOA;
typedef void * CORBA_Dispatcher;

#else
/* Used only internally by the wrapper stuff */
typedef CORBA::Short CORBA_short;
typedef CORBA::Long CORBA_long;
typedef CORBA::UShort CORBA_unsigned_short;
typedef CORBA::ULong CORBA_unsigned_long;
typedef CORBA::Float CORBA_float;
typedef CORBA::Double CORBA_double;
typedef CORBA::Char CORBA_char;
typedef CORBA::Boolean CORBA_boolean;
typedef CORBA::Octet CORBA_octet;
typedef char *CORBA_string;
typedef char *CORBA_String_var;
typedef CORBA::TypeCode_ptr CORBA_TypeCode;
typedef CORBA::TypeCode_ptr CORBA_TypeCode_ptr;
typedef CORBA::Any *CORBA_any;
typedef CORBA::Environment CORBA_Environment;
typedef CORBA::Object_ptr CORBA_Object;
typedef CORBA::ORB_ptr CORBA_ORB;
typedef CORBA::BOA_ptr CORBA_BOA;
typedef CORBA::Dispatcher *CORBA_Dispatcher;

#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

#endif

extern CORBA_ORB CORBA_ORB_init(int *argcp,
				char ***argvp,
				const char *id);
extern CORBA_BOA CORBA_BOA_init(CORBA_ORB orb,
				int *argcp,
				char ***argvp,
				const char *id);
/* Pass in addr = NULL if you like */
extern CORBA_Object CORBA_ORB_bind(CORBA_ORB orb,
				   const char *repoid,
				   const char *addr);
extern CORBA_Object CORBA_ORB_string_to_object(CORBA_ORB orb,
					       const char *iorstring);
extern char *CORBA_ORB_object_to_string(CORBA_ORB orb,
					CORBA_Object obj);
extern void CORBA_ORB_dispatcher(CORBA_ORB orb, CORBA_Dispatcher disp);
extern CORBA_Dispatcher gtk_dispatcher_new(void);
extern CORBA_boolean CORBA_Object_is_nil(CORBA_Object obj);
extern void CORBA_BOA_impl_is_ready(CORBA_BOA boa, CORBA_Object obj);
extern void CORBA_ORB_run (CORBA_ORB orb);

#endif
