2015-04-19 23:25:52 +02:00
|
|
|
/* C wrappers around some zfs calls and C in general that should simplify
|
|
|
|
* using libzfs from go language, make go code shorter and more readable.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SERVERWARE_ZFS_H
|
|
|
|
#define SERVERWARE_ZFS_H
|
|
|
|
|
|
|
|
struct dataset_list {
|
|
|
|
zfs_handle_t *zh;
|
|
|
|
void *pnext;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct dataset_list dataset_list_t;
|
2017-02-23 11:29:17 +01:00
|
|
|
typedef struct dataset_list* dataset_list_ptr;
|
2015-04-19 23:25:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
dataset_list_t *create_dataset_list_item();
|
|
|
|
void dataset_list_close(dataset_list_t *list);
|
2017-02-23 11:29:17 +01:00
|
|
|
void dataset_list_free(dataset_list_t *list);
|
2015-04-19 23:25:52 +02:00
|
|
|
|
|
|
|
int dataset_list_root(libzfs_handle_t *libzfs, dataset_list_t **first);
|
|
|
|
int dataset_list_children(zfs_handle_t *zfs, dataset_list_t **first);
|
|
|
|
dataset_list_t *dataset_next(dataset_list_t *dataset);
|
|
|
|
|
|
|
|
int read_dataset_property(zfs_handle_t *zh, property_list_t *list, int prop);
|
2017-01-16 14:07:17 +01:00
|
|
|
int read_user_property(zfs_handle_t *zh, property_list_t *list, const char* prop);
|
2015-04-19 23:25:52 +02:00
|
|
|
|
|
|
|
int clear_last_error(libzfs_handle_t *libzfs);
|
|
|
|
|
2016-07-26 21:14:28 +02:00
|
|
|
char** alloc_cstrings(int size);
|
2015-04-19 23:25:52 +02:00
|
|
|
void strings_setat(char **a, int at, char *v);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
/* SERVERWARE_ZFS_H */
|