Skip to content

Commit

Permalink
lib: cfl: upgrade to v0.5.2
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Aug 6, 2024
1 parent d58f233 commit a86dcee
Show file tree
Hide file tree
Showing 15 changed files with 593 additions and 19 deletions.
11 changes: 8 additions & 3 deletions lib/cfl/.github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- master
types: [opened, reopened, synchronize]

jobs:
build-windows:
name: Build sources on amd64 for ${{ matrix.os }}
Expand Down Expand Up @@ -57,13 +58,17 @@ jobs:
name: CentOS 7 build to confirm no issues once used downstream
runs-on: ubuntu-latest
container: centos:7
env:
# workaround required for checkout@v3, https://github.com/actions/checkout/issues/1590
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Set up base image dependencies
run: |
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
yum -y update
yum install -y ca-certificates cmake gcc gcc-c++ make wget
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum install -y epel-release
yum install -y cmake3
shell: bash

Expand Down Expand Up @@ -103,7 +108,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build on ${{ matrix.os }} with ${{ matrix.compiler }}
uses: uraimo/run-on-arch-action@v2.3.0
uses: uraimo/run-on-arch-action@v2.5.0
with:
arch: aarch64
distro: ubuntu20.04
Expand Down
2 changes: 1 addition & 1 deletion lib/cfl/.github/workflows/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
format: [ rpm, deb ]
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2.3.0
- uses: uraimo/run-on-arch-action@v2.5.0
name: Build the ${{matrix.format}} packages
with:
arch: aarch64
Expand Down
2 changes: 1 addition & 1 deletion lib/cfl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# C Floppy Version
set(CFL_VERSION_MAJOR 0)
set(CFL_VERSION_MINOR 5)
set(CFL_VERSION_PATCH 0)
set(CFL_VERSION_PATCH 1)
set(CFL_VERSION_STR "${CFL_VERSION_MAJOR}.${CFL_VERSION_MINOR}.${CFL_VERSION_PATCH}")

# Configuration options
Expand Down
2 changes: 2 additions & 0 deletions lib/cfl/include/cfl/cfl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
#include <cfl/cfl_time.h>
#include <cfl/cfl_variant.h>
#include <cfl/cfl_object.h>
#include <cfl/cfl_utils.h>

int cfl_init();
char *cfl_version();

#endif
5 changes: 5 additions & 0 deletions lib/cfl/include/cfl/cfl_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ static inline struct cfl_variant *cfl_array_fetch_by_index(struct cfl_array *arr
return array->entries[position];
}

static inline size_t cfl_array_size(struct cfl_array *array)
{
return array->entry_count;
}

int cfl_array_append(struct cfl_array *array, struct cfl_variant *value);
int cfl_array_append_string(struct cfl_array *array, char *value);
int cfl_array_append_string_s(struct cfl_array *array, char *str, size_t str_len, int referenced);
Expand Down
1 change: 0 additions & 1 deletion lib/cfl/include/cfl/cfl_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@

#endif
#endif

20 changes: 20 additions & 0 deletions lib/cfl/include/cfl/cfl_utils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef CFL_UTILS_H
#define CFL_UTILS_H

#include <sys/types.h> /* off_t */
#include <cfl/cfl_sds.h>
#include <cfl/cfl_compat.h>

struct cfl_split_entry {
char *value;
int len;
off_t last_pos;
struct cfl_list _head;
};

struct cfl_list *cfl_utils_split_quoted(const char *line, int separator, int max_split);
struct cfl_list *cfl_utils_split(const char *line, int separator, int max_split);
void cfl_utils_split_free_entry(struct cfl_split_entry *entry);
void cfl_utils_split_free(struct cfl_list *list);

#endif
1 change: 1 addition & 0 deletions lib/cfl/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(src
cfl_array.c
cfl_variant.c
cfl_checksum.c
cfl_utils.c
)

# Static Library
Expand Down
8 changes: 8 additions & 0 deletions lib/cfl/src/cfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
* limitations under the License.
*/

#include <cfl/cfl.h>

int cfl_init()
{
return 0;
}

char *cfl_version()
{
return CFL_VERSION_STR;
}

Loading

0 comments on commit a86dcee

Please sign in to comment.