#ifndef _SMB_SHARE_MODES_H_
#define _SMB_STATE_MODES_H_
#ifdef __cplusplus
extern "C" {
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
# include <stdint.h>
# endif
#endif
struct smbdb_ctx;
struct smb_share_mode_entry {
uint64_t dev;
uint64_t ino;
uint32_t share_access;
uint32_t access_mask;
struct timeval open_time;
uint32_t file_id;
struct process_id pid;
};
struct smbdb_ctx *smb_share_mode_db_open(const char *db_path);
int smb_share_mode_db_close(struct smbdb_ctx *db_ctx);
int smb_lock_share_mode_entry(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino);
int smb_unlock_share_mode_entry(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino);
int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino,
struct smb_share_mode_entry **pp_list,
unsigned char *p_delete_on_close);
int smb_create_share_mode_entry(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino,
const struct smb_share_mode_entry *set_entry,
const char *path);
int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino,
const struct smb_share_mode_entry *set_entry);
int smb_change_share_mode_entry(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino,
const struct smb_share_mode_entry *set_entry,
const struct smb_share_mode_entry *new_entry);
#ifdef __cplusplus
}
#endif
#endif