aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9660/rune.c
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-06-17 01:47:21 +0000
committerwkj <devnull@localhost>2004-06-17 01:47:21 +0000
commit7285a491c1ce1e630a0751b1011fd33e6b17234b (patch)
treeb2b2e24e333fa4660325a35f6c0f1d333e50e797 /src/cmd/9660/rune.c
parente1dddc053287874e82e2b67f95ccee7d7bc63e22 (diff)
downloadplan9port-7285a491c1ce1e630a0751b1011fd33e6b17234b.tar.gz
plan9port-7285a491c1ce1e630a0751b1011fd33e6b17234b.tar.bz2
plan9port-7285a491c1ce1e630a0751b1011fd33e6b17234b.zip
Dump9660 (and mk9660). Until we either do something
intelligent with symlinks or put in a switch for things like dump9660, this is of rather limited utility under Unix.
Diffstat (limited to 'src/cmd/9660/rune.c')
-rw-r--r--src/cmd/9660/rune.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/cmd/9660/rune.c b/src/cmd/9660/rune.c
new file mode 100644
index 00000000..3a436f4a
--- /dev/null
+++ b/src/cmd/9660/rune.c
@@ -0,0 +1,39 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include <libsec.h>
+
+#include "iso9660.h"
+
+Rune*
+strtorune(Rune *r, char *s)
+{
+ Rune *or;
+
+ if(s == nil)
+ return nil;
+
+ or = r;
+ while(*s)
+ s += chartorune(r++, s);
+ *r = L'\0';
+ return or;
+}
+
+Rune*
+runechr(Rune *s, Rune c)
+{
+ for(; *s; s++)
+ if(*s == c)
+ return s;
+ return nil;
+}
+
+int
+runecmp(Rune *s, Rune *t)
+{
+ while(*s && *t && *s == *t)
+ s++, t++;
+ return *s - *t;
+}
+