Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deps #314

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clib.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
"development": {
"stephenmathieson/describe.h": "2.0.1"
}
}
}
17 changes: 17 additions & 0 deletions deps/list/clib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "list",
"version": "0.4.1",
"repo": "clibs/list",
"description": "Simple linked list",
"keywords": ["list", "structure"],
"license": "MIT",
"src": [
"src/list_iterator.c",
"src/list.c",
"src/list_node.c",
"src/list.h"
],
"development": {
"bench": "*"
}
}
13 changes: 13 additions & 0 deletions deps/list/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ list_new(void) {

/*
* Free the list.
* @self: Pointer to the list
*/

void
Expand All @@ -47,6 +48,8 @@ list_destroy(list_t *self) {
/*
* Append the given node to the list
* and return the node, NULL on failure.
* @self: Pointer to the list for popping node
* @node: the node to push
*/

list_node_t *
Expand All @@ -69,6 +72,7 @@ list_rpush(list_t *self, list_node_t *node) {

/*
* Return / detach the last node in the list, or NULL.
* @self: Pointer to the list for popping node
*/

list_node_t *
Expand All @@ -89,6 +93,7 @@ list_rpop(list_t *self) {

/*
* Return / detach the first node in the list, or NULL.
* @self: Pointer to the list for popping node
*/

list_node_t *
Expand All @@ -110,6 +115,8 @@ list_lpop(list_t *self) {
/*
* Prepend the given node to the list
* and return the node, NULL on failure.
* @self: Pointer to the list for pushing node
* @node: the node to push
*/

list_node_t *
Expand All @@ -132,6 +139,8 @@ list_lpush(list_t *self, list_node_t *node) {

/*
* Return the node associated to val or NULL.
* @self: Pointer to the list for finding given value
* @val: Value to find
*/

list_node_t *
Expand Down Expand Up @@ -159,6 +168,8 @@ list_find(list_t *self, void *val) {

/*
* Return the node at the given index or NULL.
* @self: Pointer to the list for finding given index
* @index: the index of node in the list
*/

list_node_t *
Expand All @@ -183,6 +194,8 @@ list_at(list_t *self, int index) {

/*
* Remove the given node from the list, freeing it and it's value.
* @self: Pointer to the list to delete a node
* @node: Pointer the node to be deleted
*/

void
Expand Down
2 changes: 1 addition & 1 deletion deps/list/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern "C" {

// Library version

#define LIST_VERSION "0.0.5"
#define LIST_VERSION "0.4.1"

// Memory management macros
#ifdef LIST_CONFIG_H
Expand Down
14 changes: 1 addition & 13 deletions deps/strdup/strdup.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,12 @@
#include <string.h>
#include "strdup.h"

#ifndef strdup

char *
strdup(const char *str) {
if (NULL == (char *) str) {
return NULL;
}

int len = strlen(str) + 1;
char *buf = malloc(len);

if (buf) {
memset(buf, 0, len);
memcpy(buf, str, len - 1);
}
if (buf) memcpy(buf, str, len);
return buf;
}

#endif

#endif /* HAVE_STRDUP */
2 changes: 0 additions & 2 deletions deps/strdup/strdup.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
* copy of `str`, or `NULL` on failure.
*/

#ifndef strdup
char *
strdup(const char *str);
#endif

#endif /* HAVE_STRDUP */
29 changes: 23 additions & 6 deletions deps/tinydir/tinydir.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2013-2019, tinydir authors:
Copyright (c) 2013-2021, tinydir authors:
- Cong Xu
- Lautis Sun
- Baudouin Feildel
Expand Down Expand Up @@ -125,8 +125,23 @@ extern "C" {
# define _TINYDIR_FUNC static __inline
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
# define _TINYDIR_FUNC static __inline__
#else
#elif defined(__cplusplus)
# define _TINYDIR_FUNC static inline
#elif defined(__GNUC__)
/* Suppress unused function warning */
# define _TINYDIR_FUNC __attribute__((unused)) static
#else
# define _TINYDIR_FUNC static
#endif

#if defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)
#ifdef _MSC_VER
# define _TINYDIR_CDECL __cdecl
#else
# define _TINYDIR_CDECL __attribute__((cdecl))
#endif
#else
# define _TINYDIR_CDECL
#endif

/* readdir_r usage; define TINYDIR_USE_READDIR_R to use it (if supported) */
Expand Down Expand Up @@ -250,7 +265,7 @@ int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path);
_TINYDIR_FUNC
void _tinydir_get_ext(tinydir_file *file);
_TINYDIR_FUNC
int _tinydir_file_cmp(const void *a, const void *b);
int _TINYDIR_CDECL _tinydir_file_cmp(const void *a, const void *b);
#ifndef _MSC_VER
#ifndef _TINYDIR_USE_READDIR
_TINYDIR_FUNC
Expand Down Expand Up @@ -543,7 +558,9 @@ int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file)
if (_tstat(
#elif (defined _BSD_SOURCE) || (defined _DEFAULT_SOURCE) \
|| ((defined _XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \
|| ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L))
|| ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) \
|| ((defined __APPLE__) && (defined __MACH__)) \
|| (defined BSD)
if (lstat(
#else
if (stat(
Expand Down Expand Up @@ -636,7 +653,7 @@ int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path)
int result = 0;
int found = 0;
_tinydir_char_t dir_name_buf[_TINYDIR_PATH_MAX];
_tinydir_char_t file_name_buf[_TINYDIR_FILENAME_MAX];
_tinydir_char_t file_name_buf[_TINYDIR_PATH_MAX];
_tinydir_char_t *dir_name;
_tinydir_char_t *base_name;
#if (defined _MSC_VER || defined __MINGW32__)
Expand Down Expand Up @@ -768,7 +785,7 @@ void _tinydir_get_ext(tinydir_file *file)
}

_TINYDIR_FUNC
int _tinydir_file_cmp(const void *a, const void *b)
int _TINYDIR_CDECL _tinydir_file_cmp(const void *a, const void *b)
{
const tinydir_file *fa = (const tinydir_file *)a;
const tinydir_file *fb = (const tinydir_file *)b;
Expand Down
Loading