From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +C6UAy9J4mWWQAEAbAwnHQ (envelope-from ) for ; Fri, 01 Mar 2024 22:31:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id SMHkOS5J4mUXbAAAqHPOHw (envelope-from ) for ; Fri, 01 Mar 2024 22:31:27 +0100 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; none Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DE3ABA35A for ; Fri, 1 Mar 2024 22:31:23 +0100 (CET) DKIM-Signature: a=rsa-sha256; bh=EO31K9/ll78ME1pcRz+dDwvmGVYR/e6KrDXE72UYUOo=; c=simple/simple; d=lists.sr.ht; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1709328683; v=1; b=lxJv/E+NQwAeisjgb0UdylHyB4jb/9ZI/oV4f7yPeZS5Xq1Nlb/lZCKE/q+qP6hJRFybUCMg fqTS2dXZ859h5vQ0E7fkDflMGTITe7KmREKdZvGPQshVcYNejxUF5tewT5R6ZCnL4lDu82B9lqI 2w6462HwSSJAb4OafFL84LT4nq+50Te8M4ja60iSRcZVY1qywOxq84BLRs7HaKFCr9lQwCw1ElU ecNsosLYMMGpwZnZIabgg1ln2dqLZDdjzlGoO/bQC1XpkUE4vnuH6os22QhPXwlJjw2bWmagKhG uOZrAFyHkLEwa7oQVh4DkJcxNRZ9SLIHNCnKj8E07Wn4w== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id A91BC203F5 for ; Fri, 1 Mar 2024 21:31:23 +0000 (UTC) Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) by mail-a.sr.ht (Postfix) with ESMTPS id 16EF620352 for <~johnnyrichard/olang-devel@lists.sr.ht>; Fri, 1 Mar 2024 21:31:23 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1709328682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i58dcOWIFQA0f5ME8rN73VsuyIUwg5PJSeDOil9DnWA=; b=wVvxfaUvM5d6B42QrHUgcuUtphcnuPcH2e4DooJvwHH8ATc+mkvcCVpEntvWo4/5yJvkza 46iiKXizOg543u+dfqVCmosXu82yXbJ/BS6lLE8sH4awpY/3yYD/NRXQAs5prpXLtX7X0L p28j0LI746or+YqwGQFMqo6L1mEHIWgO+dpAhep2FS05/5ZGPWc26/zAP0pjgNXZCuKE1J pBlDv1/bY0BoAzuQgyNxAb3LH9Q/jLENKLbxBZWuzaBzb2YvfA70wnswTNl/RK75HCwsJd 0SfYKWmrGvt/0T34mqo+AOVYFgHj0wrcKmzNF8zSJW7mlbdFtmx1qxaL6Qvo3w== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard Subject: [PATCH olang v2 1/4] string_view: add string view formatter for printf fmt Date: Fri, 1 Mar 2024 23:24:06 +0100 Message-ID: <20240301223127.167341-2-johnny@johnnyrichard.com> In-Reply-To: <20240301223127.167341-1-johnny@johnnyrichard.com> References: <20240301223127.167341-1-johnny@johnnyrichard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Sourcehut-Patchset-Status: UNKNOWN List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Flow: FLOW_IN X-Migadu-Country: NL X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -4.00 X-Spam-Score: -4.00 X-Migadu-Queue-Id: DE3ABA35A X-TUID: rbvfGuOSlI/v Signed-off-by: Johnny Richard --- 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 #include +#define SV_FMT "%.*s" +#define SV_ARG(sv) (int)(sv).size, (sv).chars + typedef struct string_view { char *chars; -- 2.43.2