aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2018-10-18 08:54:14 +0200
committerThomas White <taw@bitwiz.me.uk>2018-10-18 08:54:14 +0200
commitafad5f6ac5ba0e4b92158c35f23f41688f92b048 (patch)
tree390f055ea41b3f982476881871349617f6fed178 /src/utils.c
parentfc8081e6b052e2901aa56676c5cab61eaa5996e2 (diff)
Set slide size from stylesheet
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 9033466..bafbb99 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -109,6 +109,34 @@ static char *fgets_long(FILE *fh, size_t *lp)
}
+int parse_double(const char *a, float v[2])
+{
+ int nn;
+
+ nn = sscanf(a, "%fx%f", &v[0], &v[1]);
+ if ( nn != 2 ) {
+ fprintf(stderr, _("Invalid size '%s'\n"), a);
+ return 1;
+ }
+
+ return 0;
+}
+
+
+int parse_tuple(const char *a, float v[4])
+{
+ int nn;
+
+ nn = sscanf(a, "%f,%f,%f,%f", &v[0], &v[1], &v[2], &v[3]);
+ if ( nn != 4 ) {
+ fprintf(stderr, _("Invalid tuple '%s'\n"), a);
+ return 1;
+ }
+
+ return 0;
+}
+
+
char *load_everything(const char *filename)
{
FILE *fh;