Added files.
[yaz-moved-to-github.git] / z39.50 / z-rrf1.c
diff --git a/z39.50/z-rrf1.c b/z39.50/z-rrf1.c
new file mode 100644 (file)
index 0000000..5ab9eb3
--- /dev/null
@@ -0,0 +1,36 @@
+/* YC 0.2 Tue Feb 29 16:45:07 CET 2000 */
+/* Module-C: ResourceReport-Format-Resource-1 */
+
+#include <yaz/z-rrf1.h>
+
+int z_ResourceReport1 (ODR o, Z_ResourceReport1 **p, int opt, const char *name)
+{
+       if (!odr_sequence_begin (o, p, sizeof(**p), name))
+               return opt && odr_ok (o);
+       return
+               odr_implicit_settag (o, ODR_CONTEXT, 1) &&
+               odr_sequence_of(o, (Odr_fun) z_Estimate1, &(*p)->estimates,
+                 &(*p)->num_estimates, "estimates") &&
+               odr_implicit_tag (o, z_InternationalString,
+                       &(*p)->message, ODR_CONTEXT, 2, 0, "message") &&
+               odr_sequence_end (o);
+}
+
+int z_Estimate1 (ODR o, Z_Estimate1 **p, int opt, const char *name)
+{
+       if (!odr_sequence_begin (o, p, sizeof(**p), name))
+               return opt && odr_ok (o);
+       return
+               odr_implicit_tag (o, z_EstimateType,
+                       &(*p)->type, ODR_CONTEXT, 1, 0, "type") &&
+               odr_implicit_tag (o, odr_integer,
+                       &(*p)->value, ODR_CONTEXT, 2, 0, "value") &&
+               odr_implicit_tag (o, odr_integer,
+                       &(*p)->currency_code, ODR_CONTEXT, 3, 1, "currency_code") &&
+               odr_sequence_end (o);
+}
+
+int z_EstimateType (ODR o, Z_EstimateType **p, int opt, const char *name)
+{
+       return odr_integer (o, p, opt, name);
+}