/* @(#)66    1.2  src/examples/common/bind_util.h, examples.src, os2dce12  6/15/93  14:59:19 */
/*
 * COMPONENT_NAME:  examples.src
 *
 * FUNCTIONS:
 *
 * ORIGINS: 27
 *
 * (C) COPYRIGHT International Business Machines Corp. 1992, 1993, 1994
 * All Rights Reserved
 * Licensed Materials - Property of IBM
 *
 * US Government Users Restricted Rights - Use, duplication or
 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 *
 */

/*********************************************************************
 *  File      :  bind_util.h                                         *
 *********************************************************************
 *                                                                   *
 *  Prototypes : get_binding_begin()                                 *
 *               get_binding_next()                                  *
 *               get_binding_done()                                  *
 *                                                                   *
 *  Type Definitions:                                                *
 *               binding_ctx_handle_t (opaque)                       *
 *                                                                   *
 *  Comments  :  Routines that obtain a binding handle for use in    *
 *               an RPC.                                             *
 *                                                                   *
 *               See the function descriptions in the body of this   *
 *               module for details.                                 *
 *                                                                   *
 *               get_binding_begin()                                 *
 *                                                                   *
 *                 Allocates and initializes a binding context used  *
 *                 by get_binding_next().                            *
 *                                                                   *
 *               get_binding_next()                                  *
 *                                                                   *
 *                 Acquires a binding handle to a remote server.     *
 *                 Successive calls to this routine advance the      *
 *                 context through the namespace and, ultimately,    *
 *                 through the endpoint maps of hosts pointed to     *
 *                 by the partially bound handles found in the       *
 *                 namespace.                                        *
 *                                                                   *
 *                 Returns rpc_s_no_more_bindings when the namespace *
 *                 has been exhausted of compatible bindings.        *
 *                                                                   *
 *               get_binding_done()                                  *
 *                                                                   *
 *                 Frees the binding context resources.              *
 *                                                                   *
 *********************************************************************/

/*
 *  get_binding context is an opaque data type.
 */
typedef void * binding_ctx_handle_t;

/*
 *  Optional caller supplied binding vector sort function.
 */
typedef unsigned32 (*bind_vec_sort_fn_t)
 (
    rpc_binding_vector_t *binding_vector
 );

#if defined (IBMOS2)
extern unsigned32 get_binding_begin( char *entry_name, rpc_if_handle_t if_handle, uuid_t *obj_uuid, boolean32 bypass_ns_cache, bind_vec_sort_fn_t bind_vec_sort_fn, binding_ctx_handle_t *binding_context_p );
extern unsigned32 get_binding_next( binding_ctx_handle_t   binding_context, unsigned_char_t **binding_ns_entry_name_p, rpc_binding_handle_t *binding_handle );
extern unsigned32 get_binding_done( binding_ctx_handle_t  *binding_context_p );
static unsigned32 get_binding_endpoint( binding_ctx_handle_t  binding_context, rpc_binding_handle_t *binding_handle );
static unsigned32 get_binding_vector( binding_ctx_handle_t  binding_context );
#else
extern unsigned32 get_binding_begin( );
extern unsigned32 get_binding_next( );
extern unsigned32 get_binding_done( );
static unsigned32 get_binding_endpoint( );
static unsigned32 get_binding_vector( );
#endif

/* EOF: bindutil.h */
