CliXoN
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
clixon_handle.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <cligen/cligen.h>
#include "clixon_queue.h"
#include "clixon_hash.h"
#include "clixon_handle.h"
#include "clixon_err.h"
#include "clixon_yang.h"
#include "clixon_options.h"

Macros

#define CLICON_MAGIC   0x99aafabe
 
#define handle(h)   (assert(clicon_handle_check(h)==0),(struct clicon_handle *)(h))
 

Functions

clicon_handle clicon_handle_init0 (int size)
 
clicon_handle clicon_handle_init (void)
 
int clicon_handle_exit (clicon_handle h)
 
int clicon_handle_check (clicon_handle h)
 
clicon_hash_t * clicon_options (clicon_handle h)
 
clicon_hash_t * clicon_data (clicon_handle h)
 

Macro Definition Documentation

#define CLICON_MAGIC   0x99aafabe
#define handle (   h)    (assert(clicon_handle_check(h)==0),(struct clicon_handle *)(h))

Function Documentation

clicon_hash_t* clicon_data ( clicon_handle  h)
int clicon_handle_check ( clicon_handle  h)
int clicon_handle_exit ( clicon_handle  h)

Deallocate clicon handle, including freeing handle data. : handle 'h' cannot be used in calls after this

clicon_handle clicon_handle_init ( void  )

Basic CLICON init functions returning a handle for API access.

This is the first call to CLICON basic API which returns a handle to be used in the API functions. There are other clicon_init functions for more elaborate applications (cli/backend/netconf). This should be used by the most basic applications that use CLICON lib directly.

clicon_handle clicon_handle_init0 ( int  size)

Internal call to allocate a CLICON handle.

There may be different variants of handles with some common options. So far the only common options is a MAGIC cookie for sanity checks and CLICON options

clicon_hash_t* clicon_options ( clicon_handle  h)