Commit 606d8056 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Add open, with only RIGHTS parameters. Use the already defined parameters in channel

parent 7334317c
...@@ -95,6 +95,8 @@ typedef struct blc_channel ...@@ -95,6 +95,8 @@ typedef struct blc_channel
void create(char const *new_name, int mode, uint32_t type, uint32_t format, int dims_nb, blc_dim *dims); void create(char const *new_name, int mode, uint32_t type, uint32_t format, int dims_nb, blc_dim *dims);
/**Creates a new blc_channel and with the dims as a string (i.e. "3x800x600") */ /**Creates a new blc_channel and with the dims as a string (i.e. "3x800x600") */
void create(char const *new_name, int mode, uint32_t type, uint32_t format, const char *size_string); void create(char const *new_name, int mode, uint32_t type, uint32_t format, const char *size_string);
/**Open a blc_channel with mode. The name should already be defined (e.g. with get_info) */
void open( int mode);
/**Open a blc_channel with **name** */ /**Open a blc_channel with **name** */
void open(const char *name, int mode); void open(const char *name, int mode);
/**Create the blc_channel if it does not exist otherwise, open it. In this later case the properties have to be compatible. /**Create the blc_channel if it does not exist otherwise, open it. In this later case the properties have to be compatible.
......
...@@ -303,12 +303,10 @@ int blc_channel::conflict(const char *new_name){ ...@@ -303,12 +303,10 @@ int blc_channel::conflict(const char *new_name){
} }
///Open an existing channel ///Open an existing channel
void blc_channel::open(const char *name, int access_mode){ void blc_channel::open(int access_mode){
char name_tmp[NAME_MAX]; char name_tmp[NAME_MAX];
int sync_new_data=0, sync_ack_data=0; int sync_new_data=0, sync_ack_data=0;
STRCPY(this->name, name);
switch (name[0]){ switch (name[0]){
case '/': case '/':
break; break;
...@@ -357,6 +355,11 @@ void blc_channel::open(const char *name, int access_mode){ ...@@ -357,6 +355,11 @@ void blc_channel::open(const char *name, int access_mode){
map_memory(access_mode); map_memory(access_mode);
} }
void blc_channel::open(const char *name, int mode){
STRCPY(this->name, name);
open(mode);
}
int blc_channel::create_or_open(char const *new_name, int access_mode, uint32_t type, uint32_t format, int dims_nb, blc_dim *dims){ int blc_channel::create_or_open(char const *new_name, int access_mode, uint32_t type, uint32_t format, int dims_nb, blc_dim *dims){
int id, dim, created; int id, dim, created;
......
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