summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2020-05-31 22:30:55 -0400
committerRyan Kavanagh <rak@rak.ac>2020-05-31 22:30:55 -0400
commit8b5b6b12c07a0a4520349a270839696bb9ff11d2 (patch)
tree33987d4a81ab1fe9c984d83d41ab6397d791f601
parentDrop unneeded _oasis file (diff)
mimetype stub
Diffstat (limited to '')
-rw-r--r--gemini/mimeType.ml37
-rw-r--r--gemini/mimeType.mli16
2 files changed, 53 insertions, 0 deletions
diff --git a/gemini/mimeType.ml b/gemini/mimeType.ml
new file mode 100644
index 0000000..0559168
--- /dev/null
+++ b/gemini/mimeType.ml
@@ -0,0 +1,37 @@
+module type MIME_TYPE =
+sig
+ type t
+
+ exception ParseError of string
+
+ val from_string : string -> t
+
+ val to_type : t -> string
+
+ val to_subtype : t -> string
+
+ val to_parameter : t -> (string * string) option
+end
+
+module MimeType : MIME_TYPE =
+struct
+
+ type t =
+ { mime_type : string;
+ mime_subtype : string;
+ mime_param : (string * string) option;
+ }
+
+ exception ParseError of string
+
+ let from_string _ = { mime_type = "text";
+ mime_subtype = "plain";
+ mime_param = None }
+
+ let to_type m = m.mime_type
+
+ let to_subtype m = m.mime_subtype
+
+ let to_parameter m = m.mime_param
+
+end
diff --git a/gemini/mimeType.mli b/gemini/mimeType.mli
new file mode 100644
index 0000000..6075ef9
--- /dev/null
+++ b/gemini/mimeType.mli
@@ -0,0 +1,16 @@
+module type MIME_TYPE =
+sig
+ type t
+
+ exception ParseError of string
+
+ val from_string : string -> t
+
+ val to_type : t -> string
+
+ val to_subtype : t -> string
+
+ val to_parameter : t -> (string * string) option
+end
+
+module MimeType : MIME_TYPE