Commit 88a1bbfb authored by Arnaud Blanchard's avatar Arnaud Blanchard

Add accessors for external wrapping

parent 41d7c81f
......@@ -169,9 +169,20 @@ typedef struct blc_channel
///Destroys and free a blc_channel
void blc_channel_delete(blc_channel *channel);
///Return type as a text i.e. 'UIN8'
uint32_t blc_channel_get_type(blc_channel *channel);
///Return type as a text i.e. 'RGB3'
uint32_t blc_channel_get_format(blc_channel *channel);
///Returns a pointer to data
void *blc_channel_get_data(blc_channel *channel);
int blc_channel_get_dims_nb(blc_channel *channel);
blc_dim *blc_channel_get_dims(blc_channel *channel);
void blc_channel_create(blc_channel* channel, const char *name, int mode, uint32_t type, uint32_t format, int dims_nb, int length0, ...);
/**Open an exisiting channel 'name' */
......
......@@ -40,9 +40,6 @@
static int blc_channel_id_max = 0;
static sem_t *blc_channel_event[2]={NULL, NULL};
static int blc_channel_event_id=0;
//NULL, *blc_channel_event=NULL;
;
static void (*blc_channel_event_callback)(void*)=NULL;
static void *blc_channel_event_user_data=NULL;
......@@ -55,10 +52,14 @@ blc_channel *blc_channel_new(char const *name, int mode, uint32_t type, uint32_
blc_channel* channel;
va_list vargs;
va_start(vargs, length0);
channel = new blc_channel(name, mode, type, format, dims_nb, length0, vargs);
va_end(vargs);
if (type==0 && format==0 && dims_nb==0 && length0==0){ //We open a channel
channel = new blc_channel(name, mode);
}
else {
va_start(vargs, length0);
channel = new blc_channel(name, mode, type, format, dims_nb, length0, vargs);
va_end(vargs);
}
return channel;
}
......@@ -72,6 +73,22 @@ void *blc_channel_get_data(blc_channel *channel){
return channel->data;
}
uint32_t blc_channel_get_type(blc_channel *channel){
return channel->type;
}
uint32_t blc_channel_get_format(blc_channel *channel){
return channel->format;
}
int blc_channel_get_dims_nb(blc_channel *channel){
return channel->dims_nb;
}
blc_dim *blc_channel_get_dims(blc_channel *channel){
return channel->dims;
}
void blc_remove_channel_with_name(char const *name){
FILE *list_file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment