shithub: zuke

Download patch

ref: 4a98f6822ee85d5ab2d9ba98e3e5e8124a1f6605
parent: 7f261aa809a4134793508e99689c6fc45b40e3f1
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Dec 28 10:31:44 EST 2020

move printmeta into its own C file

--- a/mkfile
+++ b/mkfile
@@ -18,8 +18,8 @@
 
 default:V: all
 
-$O.mkplist: icy.$O mkplist.$O
+$O.mkplist: icy.$O plist.$O mkplist.$O
 
-$O.zuke: theme.$O zuke.$O
+$O.zuke: theme.$O plist.$O zuke.$O
 
 </sys/src/cmd/mkmany
--- /dev/null
+++ b/plist.c
@@ -1,0 +1,27 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include "plist.h"
+
+void
+printmeta(Biobuf *b, Meta *m)
+{
+	int i;
+
+	Bprint(b, "%c %s\n%c %s\n", Ppath, m->path, Pfilefmt, m->filefmt);
+	for(i = 0; i < m->numartist; i++)
+		Bprint(b, "%c %s\n", Partist, m->artist[i]);
+	if(m->album != nil)
+		Bprint(b, "%c %s\n", Palbum, m->album);
+	if(m->title != nil)
+		Bprint(b, "%c %s\n", Ptitle, m->title);
+	if(m->date != nil)
+		Bprint(b, "%c %s\n", Pdate, m->date);
+	if(m->track != nil)
+		Bprint(b, "%c %s\n", Ptrack, m->track);
+	if(m->duration > 0)
+		Bprint(b, "%c %llud\n", Pduration, m->duration);
+	if(m->imagesize > 0)
+		Bprint(b, "%c %d %d %d %s\n", Pimage, m->imageoffset, m->imagesize, m->imagereader, m->imagefmt);
+	Bprint(b, "\n");
+}
--- a/plist.h
+++ b/plist.h
@@ -47,25 +47,4 @@
 	int imagereader; /* non-zero if a special reader required */
 };
 
-static void
-printmeta(Biobuf *b, Meta *m)
-{
-	int i;
-
-	Bprint(b, "%c %s\n%c %s\n", Ppath, m->path, Pfilefmt, m->filefmt);
-	for(i = 0; i < m->numartist; i++)
-		Bprint(b, "%c %s\n", Partist, m->artist[i]);
-	if(m->album != nil)
-		Bprint(b, "%c %s\n", Palbum, m->album);
-	if(m->title != nil)
-		Bprint(b, "%c %s\n", Ptitle, m->title);
-	if(m->date != nil)
-		Bprint(b, "%c %s\n", Pdate, m->date);
-	if(m->track != nil)
-		Bprint(b, "%c %s\n", Ptrack, m->track);
-	if(m->duration > 0)
-		Bprint(b, "%c %llud\n", Pduration, m->duration);
-	if(m->imagesize > 0)
-		Bprint(b, "%c %d %d %d %s\n", Pimage, m->imageoffset, m->imagesize, m->imagereader, m->imagefmt);
-	Bprint(b, "\n");
-}
+void printmeta(Biobuf *b, Meta *m);