add array functionality
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#ifndef LSORT_H
|
||||
#define LSORT_H
|
||||
|
||||
int add(int x, int y);
|
||||
|
||||
|
||||
#endif
|
||||
29
include/types.h
Normal file
29
include/types.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef LSORT_TYPES_H
|
||||
#define LSORT_TYPES_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "string.h"
|
||||
|
||||
typedef struct {
|
||||
const char *buf;
|
||||
size_t len;
|
||||
} lsort_string;
|
||||
|
||||
typedef struct {
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
int* items;
|
||||
} lsort_int_array;
|
||||
|
||||
lsort_int_array* lsort_create_int_array();
|
||||
void lsort_int_array_append(lsort_int_array* array, int number);
|
||||
int lsort_int_array_swap(lsort_int_array* array, int indexA, int indexB);
|
||||
|
||||
|
||||
// struct lsort_int_link {
|
||||
// int value;
|
||||
// lsort_int_array* next;
|
||||
// };
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user