chiark / gitweb /
rsa: Move load_err earlier
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Nov 2019 14:02:06 +0000 (14:02 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:50 +0000 (21:56 +0000)
Code motion.  We're going to want to use this for public keys.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
rsa.c

diff --git a/rsa.c b/rsa.c
index 964203650e4f1242499aa2e93d19d513b89ef730..6ff8f781709dfa53eb58883588ac008e3139c4d9 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -61,6 +61,16 @@ struct load_ctx {
     } u;
 };
 
+static void load_err(struct load_ctx *l,
+                    const struct cloc *maybe_loc, FILE *maybe_f,
+                    bool_t unsup, const char *fmt, ...)
+{
+    va_list al;
+    va_start(al,fmt);
+    l->verror(l, maybe_loc ? maybe_loc : l->loc, maybe_f,unsup,fmt,al);
+    va_end(al);
+}
+
 FORMAT(printf,5,0)
 static void verror_tryload(struct load_ctx *l, const struct cloc *loc,
                           FILE *maybe_f, bool_t unsup,
@@ -384,16 +394,6 @@ static list_t *rsapub_apply(closure_t *self, struct cloc loc, dict_t *context,
     return new_closure(&st->cl);
 }
 
-static void load_err(struct load_ctx *l,
-                    const struct cloc *maybe_loc, FILE *maybe_f,
-                    bool_t unsup, const char *fmt, ...)
-{
-    va_list al;
-    va_start(al,fmt);
-    l->verror(l, maybe_loc ? maybe_loc : l->loc, maybe_f,unsup,fmt,al);
-    va_end(al);
-}
-
 #define LDFATAL(...)      ({ load_err(l,0,0,0,__VA_ARGS__); goto error_out; })
 #define LDUNSUP(...)      ({ load_err(l,0,0,1,__VA_ARGS__); goto error_out; })
 #define LDFATAL_FILE(...) ({ load_err(l,0,f,0,__VA_ARGS__); goto error_out; })