GRPC Core  0.11.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions
init.c File Reference
#include <grpc/support/port_platform.h>
#include <memory.h>
#include <grpc/census.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/time.h>
#include "src/core/channel/channel_stack.h"
#include "src/core/client_config/resolver_registry.h"
#include "src/core/client_config/resolvers/dns_resolver.h"
#include "src/core/client_config/resolvers/sockaddr_resolver.h"
#include "src/core/debug/trace.h"
#include "src/core/iomgr/iomgr.h"
#include "src/core/profiling/timers.h"
#include "src/core/surface/call.h"
#include "src/core/surface/init.h"
#include "src/core/surface/surface_trace.h"
#include "src/core/transport/chttp2_transport.h"
#include "src/core/transport/connectivity_state.h"

Data Structures

struct  grpc_plugin
 

Macros

#define MAX_PLUGINS   128
 

Typedefs

typedef struct grpc_plugin grpc_plugin
 

Functions

void grpc_register_plugin (void(*init)(void), void(*destroy)(void))
 Registers a plugin to be initialized and destroyed with the library. More...
 
void grpc_init (void)
 Initialize the grpc library. More...
 
void grpc_shutdown (void)
 Shut down the grpc library. More...
 
int grpc_is_initialized (void)
 

Macro Definition Documentation

#define MAX_PLUGINS   128

Typedef Documentation

typedef struct grpc_plugin grpc_plugin

Function Documentation

void grpc_init ( void  )

Initialize the grpc library.

It is not safe to call any other grpc functions before calling this. (To avoid overhead, little checking is done, and some things may work. We do not warrant that they will continue to do so in future revisions of this library).

int grpc_is_initialized ( void  )
void grpc_register_plugin ( void(*)(void)  init,
void(*)(void)  destroy 
)

Registers a plugin to be initialized and destroyed with the library.

The init and destroy functions will be invoked as part of grpc_init() and grpc_shutdown(), respectively. Note that these functions can be invoked an arbitrary number of times (and hence so will init and destroy). It is safe to pass NULL to either argument. Plugins are destroyed in the reverse order they were initialized.

void grpc_shutdown ( void  )

Shut down the grpc library.

No memory is used by grpc after this call returns, nor are any instructions executing within the grpc library. Prior to calling, all application owned grpc objects must have been destroyed.