odr_reset (odr_input);
continue;
}
+ else
+ {
+ char out_str[100];
+ int r;
+#if 1
+ r = zebra_string_norm (zh, 'w',
+ argv[argno], strlen(argv[argno]),
+ out_str, sizeof(out_str));
+ if (r >= 0)
+ {
+ printf ("norm: '%s'\n", out_str);
+ }
+ else
+ {
+ printf ("norm fail: %d\n", r);
+ }
+#endif
+ }
/* result set name will be called 1,2, etc */
sprintf (setname, "%d", argno);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zebraapi.c,v $
- * Revision 1.26 1999-11-30 13:48:03 adam
+ * Revision 1.27 2000-02-24 12:31:17 adam
+ * Added zebra_string_norm.
+ *
+ * Revision 1.26 1999/11/30 13:48:03 adam
* Improved installation. Updated for inclusion of YAZ header files.
*
* Revision 1.25 1999/11/04 15:00:45 adam
{
}
+
+int zebra_string_norm (ZebraHandle zh, unsigned reg_id,
+ const char *input_str, int input_len,
+ char *output_str, int output_len)
+{
+ WRBUF wrbuf;
+ if (!zh->zebra_maps)
+ return -1;
+ wrbuf = zebra_replace(zh->zebra_maps, reg_id, "",
+ input_str, input_len);
+ if (!wrbuf)
+ return -2;
+ if (wrbuf_len(wrbuf) >= output_len)
+ return -3;
+ if (wrbuf_len(wrbuf))
+ memcpy (output_str, wrbuf_buf(wrbuf), wrbuf_len(wrbuf));
+ output_str[wrbuf_len(wrbuf)] = '\0';
+ return wrbuf_len(wrbuf);
+}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zebraapi.h,v $
- * Revision 1.8 1999-11-30 13:48:03 adam
+ * Revision 1.9 2000-02-24 12:31:17 adam
+ * Added zebra_string_norm.
+ *
+ * Revision 1.8 1999/11/30 13:48:03 adam
* Improved installation. Updated for inclusion of YAZ header files.
*
* Revision 1.7 1999/11/04 15:00:45 adam
/* do authentication */
YAZ_EXPORT int zebra_auth (ZebraHandle zh, const char *user, const char *pass);
+/* Character normalisation on specific register .
+ This routine is subject to change - do not use. */
+YAZ_EXPORT int zebra_string_norm (ZebraHandle zh, unsigned reg_id,
+ const char *input_str, int input_len,
+ char *output_str, int output_len);
+
#ifdef __cplusplus
}
#endif