<commit_before>#ifndef CEPH_LIBRADOS_H
#define CEPH_LIBRADOS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <netinet/in.h>
#include <linux/types.h>
#include <string.h>

#ifndef CEPH_OSD_TMAP_SET
#define CEPH_OSD_TMAP_HDR 'h'
#define CEPH_OSD_TMAP_SET 's'
#define CEPH_OSD_TMAP_CREATE 'c'
#define CEPH_OSD_TMAP_RM  'r'
#endif

#define LIBRADOS_VER_MAJOR 0
#define LIBRADOS_VER_MINOR 30
#define LIBRADOS_VER_EXTRA 0

#define LIBRADOS_VERSION(maj, min, extra) ((maj << 16) + (min << 8) + extra)

#define LIBRADOS_VERSION_CODE LIBRADOS_VERSION(LIBRADOS_VER_MAJOR, LIBRADOS_VER_MINOR, LIBRADOS_VER_EXTRA)

#define LIBRADOS_SUPPORTS_WATCH 1

struct CephContext;

typedef void *rados_t;
typedef void *rados_ioctx_t;
typedef void *rados_list_ctx_t;
typedef uint64_t rados_snap_t;
typedef void *rados_xattrs_iter_t;

struct rados_pool_stat_t {
  uint64_t num_bytes;    // in bytes
  uint64_t num_kb;       // in KB
  uint64_t num_objects;
  uint64_t num_object_clones;
  uint64_t num_object_copies;  // num_objects * num_replicas
  uint64_t num_objects_missing_on_primary;
  uint64_t num_objects_unfound;
  uint64_t num_objects_degraded;
  uint64_t num_rd, num_rd_kb,num_wr, num_wr_kb;
};

struct rados_cluster_stat_t {
  uint64_t kb, kb_used, kb_avail;
  uint64_t num_objects;
};

void rados_version(int *major, int *minor, int *extra);

/* initialization */
int rados_create(rados_t *cluster, const char * const id);

/* initialize rados with an existing configuration. */
int rados_create_with_context(rados_t *cluster, struct CephContext *cct_);

/* Connect to the cluster */
int rados_connect(rados_t cluster);

/* destroy the cluster instance */
void rados_shutdown(rados_t cluster);

/* Config
 *
 * Functions for manipulating the Ceph configuration at runtime.
 */
int rados_conf_read_file(rados_t cluster, const char *path);

/* Parse argv */
void rados_conf_parse_argv(rados_t cluster, int argc, const char **argv);

/* Sets a configuration value from a string.
 * Returns 0 on success, error code otherwise. */
int rados_conf_set(rados_t cluster, const char *option, const char *value);

/* Returns a configuration value as a string.
 * If len is positive, that is the maximum number of bytes we'll write into the
 * buffer. If len == -1, we'll call malloc() and set *buf.
 * Returns 0 on success, error code otherwise. Returns ENAMETOOLONG if the
 * buffer is too short. */
int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len);

/* cluster info */
int rados_cluster_stat(rados_t cluster, struct rados_cluster_stat_t *result);


/* pools */

/* Gets a list of pool names as NULL-terminated strings.
 * The pool names will be placed in the supplied buffer one after another.
 * After the last pool name, there will be two 0 bytes in a row.
 *
 * If len is too short to fit all the pool name entries we need, we will fill
 * as much as we can.
 * Returns the length of the buffer we would need to list all pools.
 */
int rados_pool_list(rados_t cluster, char *buf, size_t len);

int rados_ioctx_create(rados_t cluster, const char *pool_name, rados_ioctx_t *ioctx);
void rados_ioctx_destroy(rados_ioctx_t io);
<commit_msg>librados.h: fix out-of-date comment<commit_after>#ifndef CEPH_LIBRADOS_H
#define CEPH_LIBRADOS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <netinet/in.h>
#include <linux/types.h>
#include <string.h>

#ifndef CEPH_OSD_TMAP_SET
#define CEPH_OSD_TMAP_HDR 'h'
#define CEPH_OSD_TMAP_SET 's'
#define CEPH_OSD_TMAP_CREATE 'c'
#define CEPH_OSD_TMAP_RM  'r'
#endif

#define LIBRADOS_VER_MAJOR 0
#define LIBRADOS_VER_MINOR 30
#define LIBRADOS_VER_EXTRA 0

#define LIBRADOS_VERSION(maj, min, extra) ((maj << 16) + (min << 8) + extra)

#define LIBRADOS_VERSION_CODE LIBRADOS_VERSION(LIBRADOS_VER_MAJOR, LIBRADOS_VER_MINOR, LIBRADOS_VER_EXTRA)

#define LIBRADOS_SUPPORTS_WATCH 1

struct CephContext;

typedef void *rados_t;
typedef void *rados_ioctx_t;
typedef void *rados_list_ctx_t;
typedef uint64_t rados_snap_t;
typedef void *rados_xattrs_iter_t;

struct rados_pool_stat_t {
  uint64_t num_bytes;    // in bytes
  uint64_t num_kb;       // in KB
  uint64_t num_objects;
  uint64_t num_object_clones;
  uint64_t num_object_copies;  // num_objects * num_replicas
  uint64_t num_objects_missing_on_primary;
  uint64_t num_objects_unfound;
  uint64_t num_objects_degraded;
  uint64_t num_rd, num_rd_kb,num_wr, num_wr_kb;
};

struct rados_cluster_stat_t {
  uint64_t kb, kb_used, kb_avail;
  uint64_t num_objects;
};

void rados_version(int *major, int *minor, int *extra);

/* initialization */
int rados_create(rados_t *cluster, const char * const id);

/* initialize rados with an existing configuration. */
int rados_create_with_context(rados_t *cluster, struct CephContext *cct_);

/* Connect to the cluster */
int rados_connect(rados_t cluster);

/* destroy the cluster instance */
void rados_shutdown(rados_t cluster);

/* Config
 *
 * Functions for manipulating the Ceph configuration at runtime.
 */
int rados_conf_read_file(rados_t cluster, const char *path);

/* Parse argv */
void rados_conf_parse_argv(rados_t cluster, int argc, const char **argv);

/* Sets a configuration value from a string.
 * Returns 0 on success, error code otherwise. */
int rados_conf_set(rados_t cluster, const char *option, const char *value);

/* Returns a configuration value as a string.
 * len is the maximum number of bytes we'll write into the buffer.
 * Returns 0 on success, error code otherwise. Returns ENAMETOOLONG if the
 * buffer is too short. */
int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len);

/* cluster info */
int rados_cluster_stat(rados_t cluster, struct rados_cluster_stat_t *result);


/* pools */

/* Gets a list of pool names as NULL-terminated strings.
 * The pool names will be placed in the supplied buffer one after another.
 * After the last pool name, there will be two 0 bytes in a row.
 *
 * If len is too short to fit all the pool name entries we need, we will fill
 * as much as we can.
 * Returns the length of the buffer we would need to list all pools.
 */
int rados_pool_list(rados_t cluster, char *buf, size_t len);

int rados_ioctx_create(rados_t cluster, const char *pool_name, rados_ioctx_t *ioctx);
void rados_ioctx_destroy(rados_ioctx_t io);

{'fraction_non_alphanumeric': 0.08298688839142948, 'fraction_numerical': 0.01135273425007995, 'mean_word_length': 5.020211742059673, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '333871', 'n_tokens_mistral': 2370, 'n_tokens_neox': 2241, 'n_words': 696}