/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SHADOW_IMPL_H
#define _SHADOW_IMPL_H
#include <libshadowfs_impl.h>
#include <libzfs.h>
#include <libscf.h>
#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <math.h>
#include <pthread.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <libintl.h>
#include <sys/sysmacros.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct shadow_list {
typedef struct shadow_hash_link {
typedef struct shadow_hash {
/*
* Common data structure for managing a priority queue.
*/
typedef struct shadow_pq {
void **shpq_items;
} shadow_pq_t;
/*
* File or directory entry in pending list
*/
typedef enum {
typedef struct shadow_entry {
typedef struct shadow_error {
typedef struct shadow_progress {
/*
* Per-mountpoint library handle.
*/
struct shadow_handle {
};
/*
* Functions in shadow_subr.c
*/
extern void *shadow_alloc(size_t);
extern void *shadow_zalloc(size_t);
extern char *shadow_strdup(const char *);
extern int shadow_error(shadow_errno_t, const char *, ...);
extern int shadow_set_errno(shadow_errno_t);
extern const char *shadow_strerror(shadow_errno_t);
extern const char *shadow_errname(shadow_errno_t);
extern shadow_errno_t shadow_errcode(const char *);
extern int shadow_zfs_error(libzfs_handle_t *);
extern boolean_t shadow_debug_enabled(void);
extern int shadow_debug_enable(const char *);
extern void shadow_debug_disable(void);
extern void _shad_dprintf(int, const char *, const char *, ...);
/*
* Functions in shadow_pq.c
*/
extern void shadow_pq_fini(shadow_pq_t *);
extern int shadow_pq_enqueue(shadow_pq_t *, void *);
extern void *shadow_pq_dequeue(shadow_pq_t *);
extern void *shadow_pq_peek(shadow_pq_t *);
extern int shadow_pq_remove(shadow_pq_t *, void *);
void *), void *);
/*
* Functions in shadow_migrate.c
*/
extern uint64_t shadow_priority(const void *);
extern void shadow_end(shadow_handle_t *);
/*
* Functions in shadow_status.c
*/
/*
* Function in shadow_list.c
*/
extern void shadow_list_append(shadow_list_t *, void *);
extern void shadow_list_prepend(shadow_list_t *, void *);
extern void shadow_list_insert_before(shadow_list_t *, void *, void *);
extern void shadow_list_insert_after(shadow_list_t *, void *, void *);
extern void shadow_list_delete(shadow_list_t *, void *);
/*
* Function in shadow_hash.c
*/
const void *(*convert)(const void *),
int (*compare)(const void *, const void *));
extern void shadow_hash_destroy(shadow_hash_t *);
extern void *shadow_hash_lookup(shadow_hash_t *, const void *);
extern void shadow_hash_insert(shadow_hash_t *, void *);
extern void shadow_hash_remove(shadow_hash_t *, void *);
extern ulong_t shadow_hash_strhash(const void *);
extern int shadow_hash_strcmp(const void *, const void *);
extern ulong_t shadow_hash_ptrhash(const void *);
extern int shadow_hash_ptrcmp(const void *, const void *);
extern void *shadow_hash_first(shadow_hash_t *);
extern void *shadow_hash_next(shadow_hash_t *, void *);
#ifdef __cplusplus
}
#endif
#endif /* _SHADOW_IMPL_H */