Skip to content

Commit

Permalink
clang fmt
Browse files Browse the repository at this point in the history
Signed-off-by: jiacai2050 <[email protected]>
  • Loading branch information
jiacai2050 committed Nov 8, 2024
1 parent 03bc8e2 commit cec099e
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 272 deletions.
72 changes: 45 additions & 27 deletions include/vsag/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,64 @@ extern "C" {
#include <stddef.h>
#include <stdint.h>

#ifndef VSAG_MAX_ERROR_MESSAGE_LENGTH
#define VSAG_MAX_ERROR_MESSAGE_LENGTH 256
#endif

struct CError {
int type_;
char message[VSAG_MAX_ERROR_MESSAGE_LENGTH];
};
typedef struct CError {
int type_;
char message[VSAG_MAX_ERROR_MESSAGE_LENGTH];
} CError;

CError *new_error(int type_, const char *msg);
void free_error(const CError *);
CError*
new_error(int type_, const char* msg);
void
free_error(const CError*);

const CError *create_index(const char *in_index_type, const char *in_parameters,
const CError*
create_index(const char* in_index_type,
const char* in_parameters,

void **out_index_ptr);
void** out_index_ptr);

const CError *build_index(void *in_index_ptr, size_t in_num_vectors,
size_t in_dim, const int64_t *in_ids,
const float *in_vectors,
const CError*
build_index(void* in_index_ptr,
size_t in_num_vectors,
size_t in_dim,
const int64_t* in_ids,
const float* in_vectors,

const int64_t **out_failed_ids,
size_t *out_num_failed);
const int64_t** out_failed_ids,
size_t* out_num_failed);

const CError *knn_search_index(void *in_index_ptr, size_t in_dim,
const float *in_query_vector, size_t in_k,
const char *in_search_parameters,
const CError*
knn_search_index(void* in_index_ptr,
size_t in_dim,
const float* in_query_vector,
size_t in_k,
const char* in_search_parameters,

const int64_t **out_ids,
const float **out_distances,
size_t *out_num_results);
const int64_t** out_ids,
const float** out_distances,
size_t* out_num_results);

const CError *dump_index(void *in_index_ptr, const char *in_file_path);
const CError*
dump_index(void* in_index_ptr, const char* in_file_path);

const CError *load_index(const char *in_file_path, const char *in_index_type,
const char *in_parameters,
const CError*
load_index(const char* in_file_path,
const char* in_index_type,
const char* in_parameters,

void **out_index_ptr);
void** out_index_ptr);

void free_index(void *index_ptr);
void free_i64_vector(int64_t *vector);
void free_f32_vector(float *vector);
void
free_index(void* index_ptr);
void
free_i64_vector(int64_t* vector);
void
free_f32_vector(float* vector);

#ifdef __cplusplus
} // extern "C"
} // extern "C"
#endif
Loading

0 comments on commit cec099e

Please sign in to comment.