Skip to content

Commit a86dcee

Browse files
committed
lib: cfl: upgrade to v0.5.2
Signed-off-by: Eduardo Silva <[email protected]>
1 parent d58f233 commit a86dcee

File tree

15 files changed

+593
-19
lines changed

15 files changed

+593
-19
lines changed

lib/cfl/.github/workflows/build.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches:
88
- master
99
types: [opened, reopened, synchronize]
10+
1011
jobs:
1112
build-windows:
1213
name: Build sources on amd64 for ${{ matrix.os }}
@@ -57,13 +58,17 @@ jobs:
5758
name: CentOS 7 build to confirm no issues once used downstream
5859
runs-on: ubuntu-latest
5960
container: centos:7
61+
env:
62+
# workaround required for checkout@v3, https://github.com/actions/checkout/issues/1590
63+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
6064
steps:
6165
- name: Set up base image dependencies
6266
run: |
67+
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
68+
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
6369
yum -y update
6470
yum install -y ca-certificates cmake gcc gcc-c++ make wget
65-
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
66-
rpm -ivh epel-release-latest-7.noarch.rpm
71+
yum install -y epel-release
6772
yum install -y cmake3
6873
shell: bash
6974

@@ -103,7 +108,7 @@ jobs:
103108
steps:
104109
- uses: actions/checkout@v3
105110
- name: Build on ${{ matrix.os }} with ${{ matrix.compiler }}
106-
uses: uraimo/run-on-arch-action@v2.3.0
111+
uses: uraimo/run-on-arch-action@v2.5.0
107112
with:
108113
arch: aarch64
109114
distro: ubuntu20.04

lib/cfl/.github/workflows/packages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
format: [ rpm, deb ]
2020
steps:
2121
- uses: actions/checkout@v3
22-
- uses: uraimo/run-on-arch-action@v2.3.0
22+
- uses: uraimo/run-on-arch-action@v2.5.0
2323
name: Build the ${{matrix.format}} packages
2424
with:
2525
arch: aarch64

lib/cfl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
66
# C Floppy Version
77
set(CFL_VERSION_MAJOR 0)
88
set(CFL_VERSION_MINOR 5)
9-
set(CFL_VERSION_PATCH 0)
9+
set(CFL_VERSION_PATCH 1)
1010
set(CFL_VERSION_STR "${CFL_VERSION_MAJOR}.${CFL_VERSION_MINOR}.${CFL_VERSION_PATCH}")
1111

1212
# Configuration options

lib/cfl/include/cfl/cfl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#include <cfl/cfl_time.h>
3838
#include <cfl/cfl_variant.h>
3939
#include <cfl/cfl_object.h>
40+
#include <cfl/cfl_utils.h>
4041

4142
int cfl_init();
43+
char *cfl_version();
4244

4345
#endif

lib/cfl/include/cfl/cfl_array.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ static inline struct cfl_variant *cfl_array_fetch_by_index(struct cfl_array *arr
4343
return array->entries[position];
4444
}
4545

46+
static inline size_t cfl_array_size(struct cfl_array *array)
47+
{
48+
return array->entry_count;
49+
}
50+
4651
int cfl_array_append(struct cfl_array *array, struct cfl_variant *value);
4752
int cfl_array_append_string(struct cfl_array *array, char *value);
4853
int cfl_array_append_string_s(struct cfl_array *array, char *str, size_t str_len, int referenced);

lib/cfl/include/cfl/cfl_compat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@
4545

4646
#endif
4747
#endif
48-

lib/cfl/include/cfl/cfl_utils.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef CFL_UTILS_H
2+
#define CFL_UTILS_H
3+
4+
#include <sys/types.h> /* off_t */
5+
#include <cfl/cfl_sds.h>
6+
#include <cfl/cfl_compat.h>
7+
8+
struct cfl_split_entry {
9+
char *value;
10+
int len;
11+
off_t last_pos;
12+
struct cfl_list _head;
13+
};
14+
15+
struct cfl_list *cfl_utils_split_quoted(const char *line, int separator, int max_split);
16+
struct cfl_list *cfl_utils_split(const char *line, int separator, int max_split);
17+
void cfl_utils_split_free_entry(struct cfl_split_entry *entry);
18+
void cfl_utils_split_free(struct cfl_list *list);
19+
20+
#endif

lib/cfl/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set(src
99
cfl_array.c
1010
cfl_variant.c
1111
cfl_checksum.c
12+
cfl_utils.c
1213
)
1314

1415
# Static Library

lib/cfl/src/cfl.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@
1717
* limitations under the License.
1818
*/
1919

20+
#include <cfl/cfl.h>
21+
2022
int cfl_init()
2123
{
2224
return 0;
2325
}
26+
27+
char *cfl_version()
28+
{
29+
return CFL_VERSION_STR;
30+
}
31+

0 commit comments

Comments
 (0)