kmx.io/kv/rope.h

Branch

Thomas de Grivel f1843fc12 2022-01-03T14:06:48
quote
/*
 * kv - key value text file format
 *
 * Copyright 2022 Thomas de Grivel
*/

#ifndef ROPE_H
#define ROPE_H

typedef struct rope s_rope;

struct rope {
  char   *str;
  size_t  size;
  s_rope *next;
};

void     rope_init (s_rope *r, char *str, size_t size, s_rope *next);
s_rope * rope_new (char *str, size_t size, s_rope *next);
void     rope_delete (s_rope *r);
void     rope_delete_all (s_rope *r);
void     rope_delete_all_free (s_rope *r);
int      rope_push (s_rope **r, char *str, size_t size);
void     rope_sort_by_size (s_rope *r);
int      rope_print (s_rope *r, FILE *fp);

#endif
Download