Skip to content

Commit

Permalink
map2 + figuring things out + minor adjustments for iodine required fe…
Browse files Browse the repository at this point in the history
…atures
  • Loading branch information
boazsegev committed Jul 21, 2024
1 parent 9246169 commit 97027c0
Show file tree
Hide file tree
Showing 12 changed files with 4,162 additions and 49 deletions.
2,139 changes: 2,103 additions & 36 deletions fio-stl.h

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions fio-stl.md
Original file line number Diff line number Diff line change
Expand Up @@ -6125,6 +6125,8 @@ Destroys a copy of `fio_keystr_s` - used internally by the hash map.

```c
int fio_keystr_is_eq(fio_keystr_s a, fio_keystr_s b);
int fio_keystr_is_eq2(fio_keystr_s a, fio_str_info_s b);
int fio_keystr_is_eq3(fio_keystr_s a, fio_buf_info_s b);
```

Compares two Key Strings - used internally by the hash map.
Expand Down Expand Up @@ -8344,6 +8346,22 @@ Accepts a listener handler returned by `fio_srv_listen` and destroys it.

Normally this function isn't called, as the `listener` handle auto-destructs during server cleanup (at exit).

#### `fio_srv_listener_url`

```c
fio_buf_info_s fio_srv_listener_url(void *listener);
```

Returns the URL on which the listener is listening.

#### `fio_srv_listener_is_tls`

```c
int fio_srv_listener_is_tls(void *listener);
```

Returns true if the listener protocol has an attached TLS context.

#### `fio_srv_attach_fd`

```c
Expand Down
3 changes: 2 additions & 1 deletion fio-stl/000 dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ FIO_MAP Ordering & Naming Shortcut
#if defined(FIO_HTTP_HANDLE) || defined(FIO_STR_NAME) || \
defined(FIO_STR_SMALL) || defined(FIO_ARRAY_TYPE_STR) || \
defined(FIO_MAP_KEY_KSTR) || defined(FIO_MAP_KEY_BSTR) || \
(defined(FIO_MAP_NAME) && !defined(FIO_MAP_KEY)) || defined(FIO_MUSTACHE)
(defined(FIO_MAP_NAME) && !defined(FIO_MAP_KEY)) || \
defined(FIO_MUSTACHE) || defined(FIO_MAP2_NAME)
#undef FIO_STR
#define FIO_STR
#endif
Expand Down
3 changes: 2 additions & 1 deletion fio-stl/001 memalt.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ SFUNC void *fio_memcpy(void *dest_, const void *src_, size_t bytes) {
const char *s = (const char *)src_;

if ((d == s) | !bytes | !d | !s) {
FIO_LOG_DEBUG2("fio_memcpy null error - ignored instruction");
if (bytes && (d != s))
FIO_LOG_DEBUG2("fio_memcpy null error - ignored instruction");
return d;
}

Expand Down
7 changes: 7 additions & 0 deletions fio-stl/102 string core.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,8 @@ FIO_SFUNC void fio_keystr_destroy(fio_keystr_s *key,
FIO_IFUNC int fio_keystr_is_eq(fio_keystr_s a, fio_keystr_s b);
/** Compares a Key String to any String - used internally by the hash map. */
FIO_IFUNC int fio_keystr_is_eq2(fio_keystr_s a_, fio_str_info_s b);
/** Compares a Key String to any String - used internally by the hash map. */
FIO_IFUNC int fio_keystr_is_eq3(fio_keystr_s a_, fio_buf_info_s b);
/** Returns a good-enough `fio_keystr_s` risky hash. */
FIO_IFUNC uint64_t fio_keystr_hash(fio_keystr_s a);

Expand Down Expand Up @@ -1084,6 +1086,11 @@ FIO_IFUNC int fio_keystr_is_eq2(fio_keystr_s a_, fio_str_info_s b) {
fio_str_info_s a = fio_keystr_info(&a_);
return FIO_STR_INFO_IS_EQ(a, b);
}
/** Compares a Key String to any String - used internally by the hash map. */
FIO_IFUNC int fio_keystr_is_eq3(fio_keystr_s a_, fio_buf_info_s b) {
fio_buf_info_s a = fio_keystr_buf(&a_);
return FIO_BUF_INFO_IS_EQ(a, b);
}

/** Returns a good-enough `fio_keystr_s` risky hash. */
FIO_IFUNC uint64_t fio_keystr_hash(fio_keystr_s a_) {
Expand Down
2 changes: 2 additions & 0 deletions fio-stl/102 string core.md
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ Destroys a copy of `fio_keystr_s` - used internally by the hash map.

```c
int fio_keystr_is_eq(fio_keystr_s a, fio_keystr_s b);
int fio_keystr_is_eq2(fio_keystr_s a, fio_str_info_s b);
int fio_keystr_is_eq3(fio_keystr_s a, fio_buf_info_s b);
```
Compares two Key Strings - used internally by the hash map.
Expand Down
Loading

0 comments on commit 97027c0

Please sign in to comment.