From: Johnny Richard <johnny@johnnyrichard.com>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Johnny Richard <johnny@johnnyrichard.com>
Subject: [PATCH olang v2 1/4] string_view: add string view formatter for printf fmt
Date: Fri, 1 Mar 2024 23:24:06 +0100 [thread overview]
Message-ID: <20240301223127.167341-2-johnny@johnnyrichard.com> (raw)
In-Reply-To: <20240301223127.167341-1-johnny@johnnyrichard.com>
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
---
v2: Removed unecessary stdint include
src/string_view.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/string_view.h b/src/string_view.h
index 367ef6b..1adc5c0 100644
--- a/src/string_view.h
+++ b/src/string_view.h
@@ -20,6 +20,9 @@
#include <stdbool.h>
#include <stddef.h>
+#define SV_FMT "%.*s"
+#define SV_ARG(sv) (int)(sv).size, (sv).chars
+
typedef struct string_view
{
char *chars;
--
2.43.2
next prev parent reply other threads:[~2024-03-01 21:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 22:24 [PATCH olang v2 0/4] create initial syntax analysis logic Johnny Richard
2024-03-01 22:24 ` Johnny Richard [this message]
2024-03-01 22:24 ` [PATCH olang v2 2/4] string_view: add string view conversion to uint32_t Johnny Richard
2024-03-01 22:24 ` [PATCH olang v2 3/4] lexer: add token lookahead capability Johnny Richard
2024-03-01 22:24 ` [PATCH olang v2 4/4] parser: create simplified parser for tiny AST Johnny Richard
2024-03-01 21:32 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-03-01 22:08 ` [PATCH olang v2 4/4] parser: create simplified parser for tiny AST Carlos Maniero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240301223127.167341-2-johnny@johnnyrichard.com \
--to=johnny@johnnyrichard.com \
--cc=~johnnyrichard/olang-devel@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.johnnyrichard.com/olang.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox