Skip to content

Commit

Permalink
Added ffi call to initalise the env-logger (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
kydos committed Aug 26, 2020
1 parent b9ebf1e commit 035211d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions zenoh-ffi/include/zenoh-ffi.h
Expand Up @@ -8,6 +8,8 @@
#include "zenoh-types.h"


typedef struct ZNLocators ZNLocators;

typedef struct ZNProperties ZNProperties;

typedef struct ZNQuery ZNQuery;
Expand Down Expand Up @@ -141,6 +143,12 @@ ZNSubscriber *zn_declare_subscriber(ZNSession *session,
*/
ZNProperties *zn_info(ZNSession *session);

/**
* Initialise the zenoh runtime logger
*
*/
void zn_init_logger(void);

/**
* Open a zenoh session
*
Expand Down Expand Up @@ -257,6 +265,14 @@ ZNQueryTarget *zn_query_target_default(void);
*/
ZNScout *zn_scout(unsigned int what, const char *iface, unsigned long scout_period);

/**
* Frees the ZNScout by releasing its associated memory.
*
* # Safety
* The main reason for this function to be unsafe is that it does of a pointer into a box.
*/
void zn_scout_free(ZNScout *s);

/**
* Get the number of entities scouted and available as part of
* the ZNScout
Expand All @@ -267,6 +283,42 @@ ZNScout *zn_scout(unsigned int what, const char *iface, unsigned long scout_peri
*/
unsigned int zn_scout_len(ZNScout *si);

/**
* Get the locator at the given index.
*
* # Safety
* The main reason for this function to be unsafe is that it dereferences a pointer.
*
*/
const char *zn_scout_locator_get(ZNLocators *ls, unsigned int idx);

/**
* Get the locators for the scouted.
*
* # Safety
* The main reason for this function to be unsafe is that it dereferences a pointer.
*
*/
ZNLocators *zn_scout_locators(ZNScout *si, unsigned int idx);

/**
* Frees the locators
*
* # Safety
* The main reason for this function to be unsafe is that it dereferences a pointer.
*
*/
void zn_scout_locators_free(ZNLocators *ls);

/**
* Get the number of locators for the scouted entity.
*
* # Safety
* The main reason for this function to be unsafe is that it dereferences a pointer.
*
*/
unsigned int zn_scout_locators_len(ZNLocators *ls);

/**
* Get the peer-id for the scouted entity at the given index
*
Expand Down

0 comments on commit 035211d

Please sign in to comment.