blob: 3f153698b27bda984b4ee42754400359b753a8e8 [file] [log] [blame]
Daniel Veillard344cee72001-08-20 00:08:40 +00001/*
2 * xmlcatalog.c : a small utility program to handle XML catalogs
3 *
4 * See Copyright for the status of this software.
5 *
6 * daniel@veillard.com
7 */
8
9#include "libxml.h"
10
11#include <string.h>
12#include <stdio.h>
13#include <stdarg.h>
14
Daniel Veillardc0631a62001-09-20 13:56:06 +000015#ifdef HAVE_STDLIB_H
16#include <stdlib.h>
17#endif
18
Bjorn Reese45029602001-08-21 09:23:53 +000019#ifdef HAVE_LIBREADLINE
20#include <readline/readline.h>
21#ifdef HAVE_LIBHISTORY
22#include <readline/history.h>
23#endif
24#endif
25
Daniel Veillard344cee72001-08-20 00:08:40 +000026#include <libxml/xmlmemory.h>
27#include <libxml/uri.h>
28#include <libxml/catalog.h>
29#include <libxml/parser.h>
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000030#include <libxml/globals.h>
Daniel Veillard344cee72001-08-20 00:08:40 +000031
32static int shell = 0;
Daniel Veillard82d75332001-10-08 15:01:59 +000033static int sgml = 0;
Daniel Veillard344cee72001-08-20 00:08:40 +000034static int noout = 0;
Daniel Veillarde7ead2d2001-08-22 23:44:09 +000035static int create = 0;
Daniel Veillardcda96922001-08-21 10:56:31 +000036static int add = 0;
37static int del = 0;
Daniel Veillard6c5f9d12001-08-25 13:33:14 +000038static int convert = 0;
Daniel Veillard344cee72001-08-20 00:08:40 +000039static int verbose = 0;
Daniel Veillardcda96922001-08-21 10:56:31 +000040static char *filename;
Daniel Veillard344cee72001-08-20 00:08:40 +000041
42#ifdef LIBXML_CATALOG_ENABLED
Daniel Veillardcd21dc72001-11-04 20:03:38 +000043
44#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
45
Daniel Veillard344cee72001-08-20 00:08:40 +000046/************************************************************************
47 * *
48 * Shell Interface *
49 * *
50 ************************************************************************/
51/**
52 * xmlShellReadline:
53 * @prompt: the prompt value
54 *
55 * Read a string
56 *
57 * Returns a pointer to it or NULL on EOF the caller is expected to
58 * free the returned string.
59 */
60static char *
61xmlShellReadline(const char *prompt) {
62#ifdef HAVE_LIBREADLINE
63 char *line_read;
64
65 /* Get a line from the user. */
66 line_read = readline (prompt);
67
68 /* If the line has any text in it, save it on the history. */
69 if (line_read && *line_read)
70 add_history (line_read);
71
72 return (line_read);
73#else
74 char line_read[501];
75
76 if (prompt != NULL)
77 fprintf(stdout, "%s", prompt);
78 if (!fgets(line_read, 500, stdin))
79 return(NULL);
80 line_read[500] = 0;
81 return(strdup(line_read));
82#endif
83}
84
85
86static void usershell(void) {
87 char *cmdline = NULL, *cur;
88 int nbargs;
89 char command[100];
90 char arg[400];
Daniel Veillardcda96922001-08-21 10:56:31 +000091 char *argv[20];
92 int i, ret;
Daniel Veillardcda96922001-08-21 10:56:31 +000093 xmlChar *ans;
Daniel Veillard344cee72001-08-20 00:08:40 +000094
95 while (1) {
96 cmdline = xmlShellReadline("> ");
97 if (cmdline == NULL)
98 return;
99
100 /*
101 * Parse the command itself
102 */
103 cur = cmdline;
104 nbargs = 0;
105 while ((*cur == ' ') || (*cur == '\t')) cur++;
106 i = 0;
107 while ((*cur != ' ') && (*cur != '\t') &&
108 (*cur != '\n') && (*cur != '\r')) {
109 if (*cur == 0)
110 break;
111 command[i++] = *cur++;
112 }
113 command[i] = 0;
114 if (i == 0) continue;
115 nbargs++;
116
117 /*
Daniel Veillardcda96922001-08-21 10:56:31 +0000118 * Parse the argument string
Daniel Veillard344cee72001-08-20 00:08:40 +0000119 */
Daniel Veillardcda96922001-08-21 10:56:31 +0000120 memset(arg, 0, sizeof(arg));
Daniel Veillard344cee72001-08-20 00:08:40 +0000121 while ((*cur == ' ') || (*cur == '\t')) cur++;
122 i = 0;
123 while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
124 if (*cur == 0)
125 break;
126 arg[i++] = *cur++;
127 }
128 arg[i] = 0;
129 if (i != 0)
130 nbargs++;
131
132 /*
Daniel Veillardcda96922001-08-21 10:56:31 +0000133 * Parse the arguments
134 */
135 i = 0;
136 nbargs = 0;
137 cur = arg;
138 memset(argv, 0, sizeof(argv));
139 while (*cur != 0) {
140 while ((*cur == ' ') || (*cur == '\t')) cur++;
141 if (*cur == '\'') {
142 cur++;
143 argv[i] = cur;
144 while ((*cur != 0) && (*cur != '\'')) cur++;
145 if (*cur == '\'') {
146 *cur = 0;
147 nbargs++;
148 i++;
149 cur++;
150 }
151 } else if (*cur == '"') {
152 cur++;
153 argv[i] = cur;
154 while ((*cur != 0) && (*cur != '"')) cur++;
155 if (*cur == '"') {
156 *cur = 0;
157 nbargs++;
158 i++;
159 cur++;
160 }
161 } else {
162 argv[i] = cur;
163 while ((*cur != 0) && (*cur != ' ') && (*cur != '\t'))
164 cur++;
165 *cur = 0;
166 nbargs++;
167 i++;
168 cur++;
169 }
170 }
171
172 /*
Daniel Veillard344cee72001-08-20 00:08:40 +0000173 * start interpreting the command
174 */
175 if (!strcmp(command, "exit"))
176 break;
177 if (!strcmp(command, "quit"))
178 break;
179 if (!strcmp(command, "bye"))
180 break;
181 if (!strcmp(command, "public")) {
Daniel Veillardcda96922001-08-21 10:56:31 +0000182 if (nbargs != 1) {
183 printf("public requires 1 arguments\n");
Daniel Veillard344cee72001-08-20 00:08:40 +0000184 } else {
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000185 ans = xmlCatalogResolvePublic((const xmlChar *) argv[0]);
186 if (ans == NULL) {
Daniel Veillardcda96922001-08-21 10:56:31 +0000187 printf("No entry for PUBLIC %s\n", argv[0]);
188 } else {
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000189 printf("%s\n", ans);
190 xmlFree(ans);
Daniel Veillardcda96922001-08-21 10:56:31 +0000191 }
Daniel Veillard344cee72001-08-20 00:08:40 +0000192 }
193 } else if (!strcmp(command, "system")) {
Daniel Veillardcda96922001-08-21 10:56:31 +0000194 if (nbargs != 1) {
195 printf("system requires 1 arguments\n");
Daniel Veillard344cee72001-08-20 00:08:40 +0000196 } else {
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000197 ans = xmlCatalogResolveSystem((const xmlChar *) argv[0]);
198 if (ans == NULL) {
Daniel Veillardcda96922001-08-21 10:56:31 +0000199 printf("No entry for SYSTEM %s\n", argv[0]);
200 } else {
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000201 printf("%s\n", ans);
202 xmlFree(ans);
Daniel Veillardcda96922001-08-21 10:56:31 +0000203 }
204 }
205 } else if (!strcmp(command, "add")) {
Daniel Veillard82d75332001-10-08 15:01:59 +0000206 if (sgml) {
207 if (nbargs != 1) {
208 printf("add requires 1 argument\n");
209 } else {
210 ret = xmlCatalogAdd(BAD_CAST "sgmlcatalog", NULL,
211 BAD_CAST argv[0]);
212 }
Daniel Veillardcda96922001-08-21 10:56:31 +0000213 } else {
Daniel Veillard82d75332001-10-08 15:01:59 +0000214 if ((nbargs != 3) && (nbargs != 2)) {
215 printf("add requires 2 or 3 arguments\n");
216 } else {
217 if (argv[2] == NULL)
218 ret = xmlCatalogAdd(BAD_CAST argv[0], NULL,
219 BAD_CAST argv[1]);
220 else
221 ret = xmlCatalogAdd(BAD_CAST argv[0], BAD_CAST argv[1],
222 BAD_CAST argv[2]);
223 if (ret != 0)
224 printf("add command failed\n");
225 }
Daniel Veillardcda96922001-08-21 10:56:31 +0000226 }
227 } else if (!strcmp(command, "del")) {
228 if (nbargs != 1) {
229 printf("del requires 1\n");
230 } else {
231 ret = xmlCatalogRemove(BAD_CAST argv[0]);
232 if (ret <= 0)
233 printf("del command failed\n");
234
235 }
236 } else if (!strcmp(command, "resolve")) {
237 if (nbargs != 2) {
238 printf("resolve requires 2 arguments\n");
239 } else {
240 ans = xmlCatalogResolve(BAD_CAST argv[0],
241 BAD_CAST argv[1]);
242 if (ans == NULL) {
243 printf("Resolver failed to find an answer\n");
244 } else {
245 printf("%s\n", ans);
246 xmlFree(ans);
247 }
Daniel Veillard344cee72001-08-20 00:08:40 +0000248 }
249 } else if (!strcmp(command, "dump")) {
Daniel Veillardcda96922001-08-21 10:56:31 +0000250 if (nbargs != 0) {
251 printf("dump has no arguments\n");
252 } else {
253 xmlCatalogDump(stdout);
254 }
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000255 } else if (!strcmp(command, "debug")) {
256 if (nbargs != 0) {
257 printf("debug has no arguments\n");
258 } else {
259 verbose++;
260 xmlCatalogSetDebug(verbose);
261 }
262 } else if (!strcmp(command, "quiet")) {
263 if (nbargs != 0) {
264 printf("quiet has no arguments\n");
265 } else {
266 if (verbose > 0)
267 verbose--;
268 xmlCatalogSetDebug(verbose);
269 }
Daniel Veillard344cee72001-08-20 00:08:40 +0000270 } else {
271 if (strcmp(command, "help")) {
272 printf("Unrecognized command %s\n", command);
273 }
274 printf("Commands available:\n");
275 printf("\tpublic PublicID: make a PUBLIC identifier lookup\n");
276 printf("\tsystem SystemID: make a SYSTEM identifier lookup\n");
Daniel Veillardcda96922001-08-21 10:56:31 +0000277 printf("\tresolve PublicID SystemID: do a full resolver lookup\n");
278 printf("\tadd 'type' 'orig' 'replace' : add an entry\n");
279 printf("\tdel 'values' : remove values\n");
Daniel Veillard344cee72001-08-20 00:08:40 +0000280 printf("\tdump: print the current catalog state\n");
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000281 printf("\tdebug: increase the verbosity level\n");
282 printf("\tquiet: decrease the verbosity level\n");
Daniel Veillard344cee72001-08-20 00:08:40 +0000283 printf("\texit: quit the shell\n");
284 }
285 free(cmdline); /* not xmlFree here ! */
286 }
287}
288
289/************************************************************************
290 * *
291 * Main *
292 * *
293 ************************************************************************/
294static void usage(const char *name) {
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000295 printf("Usage : %s [options] catalogfile entities...\n", name);
296 printf("\tParse the catalog file and query it for the entities\n");
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000297 printf("\t--sgml : handle SGML Super catalogs for --add and --del\n");
Daniel Veillard344cee72001-08-20 00:08:40 +0000298 printf("\t--shell : run a shell allowing interactive queries\n");
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000299 printf("\t--create : create a new catalog\n");
Daniel Veillardcda96922001-08-21 10:56:31 +0000300 printf("\t--add 'type' 'orig' 'replace' : add an entry\n");
301 printf("\t--del 'values' : remove values\n");
302 printf("\t--noout: avoid dumping the result on stdout\n");
303 printf("\t used with add or del, it saves the catalog changes\n");
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000304 printf("\t and with --sgml it also updates the super catalog\n");
Daniel Veillard344cee72001-08-20 00:08:40 +0000305 printf("\t-v --verbose : provide debug informations\n");
306}
307int main(int argc, char **argv) {
308 int i;
Daniel Veillard6c5f9d12001-08-25 13:33:14 +0000309 int ret;
310
Daniel Veillard344cee72001-08-20 00:08:40 +0000311
312 if (argc <= 1) {
313 usage(argv[0]);
314 return(1);
315 }
316
317 LIBXML_TEST_VERSION
318 for (i = 1; i < argc ; i++) {
319 if (!strcmp(argv[i], "-"))
320 break;
321
322 if (argv[i][0] != '-')
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000323 break;
Daniel Veillard344cee72001-08-20 00:08:40 +0000324 if ((!strcmp(argv[i], "-verbose")) ||
325 (!strcmp(argv[i], "-v")) ||
326 (!strcmp(argv[i], "--verbose"))) {
327 verbose++;
328 xmlCatalogSetDebug(verbose);
Daniel Veillardcda96922001-08-21 10:56:31 +0000329 } else if ((!strcmp(argv[i], "-noout")) ||
330 (!strcmp(argv[i], "--noout"))) {
331 noout = 1;
Daniel Veillard344cee72001-08-20 00:08:40 +0000332 } else if ((!strcmp(argv[i], "-shell")) ||
333 (!strcmp(argv[i], "--shell"))) {
334 shell++;
335 noout = 1;
Daniel Veillard82d75332001-10-08 15:01:59 +0000336 } else if ((!strcmp(argv[i], "-sgml")) ||
337 (!strcmp(argv[i], "--sgml"))) {
338 sgml++;
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000339 } else if ((!strcmp(argv[i], "-create")) ||
340 (!strcmp(argv[i], "--create"))) {
341 create++;
Daniel Veillard6c5f9d12001-08-25 13:33:14 +0000342 } else if ((!strcmp(argv[i], "-convert")) ||
343 (!strcmp(argv[i], "--convert"))) {
344 convert++;
Daniel Veillardcda96922001-08-21 10:56:31 +0000345 } else if ((!strcmp(argv[i], "-add")) ||
346 (!strcmp(argv[i], "--add"))) {
Daniel Veillard82d75332001-10-08 15:01:59 +0000347 if (sgml)
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000348 i += 2;
Daniel Veillard82d75332001-10-08 15:01:59 +0000349 else
350 i += 3;
Daniel Veillardcda96922001-08-21 10:56:31 +0000351 add++;
352 } else if ((!strcmp(argv[i], "-del")) ||
353 (!strcmp(argv[i], "--del"))) {
354 i += 1;
355 del++;
Daniel Veillard344cee72001-08-20 00:08:40 +0000356 } else {
357 fprintf(stderr, "Unknown option %s\n", argv[i]);
358 usage(argv[0]);
359 return(1);
360 }
361 }
362
363 for (i = 1; i < argc; i++) {
Daniel Veillardcda96922001-08-21 10:56:31 +0000364 if ((!strcmp(argv[i], "-add")) ||
365 (!strcmp(argv[i], "--add"))) {
Daniel Veillard82d75332001-10-08 15:01:59 +0000366 if (sgml)
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000367 i += 2;
Daniel Veillard82d75332001-10-08 15:01:59 +0000368 else
369 i += 3;
Daniel Veillard344cee72001-08-20 00:08:40 +0000370 continue;
Daniel Veillardcda96922001-08-21 10:56:31 +0000371 } else if ((!strcmp(argv[i], "-del")) ||
372 (!strcmp(argv[i], "--del"))) {
373 i += 1;
374 continue;
375 } else if (argv[i][0] == '-')
376 continue;
377 filename = argv[i];
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000378 if (!sgml) {
Daniel Veillard82d75332001-10-08 15:01:59 +0000379 ret = xmlLoadCatalog(argv[i]);
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000380 if ((ret < 0) && (create)) {
381 xmlCatalogAdd(BAD_CAST "catalog", BAD_CAST argv[i], NULL);
382 }
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000383 }
Daniel Veillardcda96922001-08-21 10:56:31 +0000384 break;
385 }
386
Daniel Veillard6c5f9d12001-08-25 13:33:14 +0000387 if (convert)
388 ret = xmlCatalogConvert();
Daniel Veillardcda96922001-08-21 10:56:31 +0000389
Daniel Veillard6c5f9d12001-08-25 13:33:14 +0000390 if ((add) || (del)) {
Daniel Veillardcda96922001-08-21 10:56:31 +0000391 for (i = 1; i < argc ; i++) {
392 if (!strcmp(argv[i], "-"))
393 break;
394
395 if (argv[i][0] != '-')
396 continue;
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000397 if (strcmp(argv[i], "-add") && strcmp(argv[i], "--add") &&
398 strcmp(argv[i], "-del") && strcmp(argv[i], "--del"))
399 continue;
400
401 if (sgml) {
402 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000403 * Maintenance of SGML catalogs.
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000404 */
405 xmlCatalogPtr catal = NULL;
406 xmlCatalogPtr super = NULL;
407
408 catal = xmlLoadSGMLSuperCatalog(argv[i + 1]);
409
410 if ((!strcmp(argv[i], "-add")) ||
411 (!strcmp(argv[i], "--add"))) {
412 if (catal == NULL)
413 catal = xmlNewCatalog(1);
414 super = xmlLoadSGMLSuperCatalog(XML_SGML_DEFAULT_CATALOG);
415 if (super == NULL)
416 super = xmlNewCatalog(1);
417
418 xmlACatalogAdd(catal, BAD_CAST "CATALOG",
419 BAD_CAST argv[i + 2], NULL);
420 xmlACatalogAdd(super, BAD_CAST "CATALOG",
421 BAD_CAST argv[i + 1], NULL);
Daniel Veillard82d75332001-10-08 15:01:59 +0000422 } else {
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000423 if (catal != NULL)
424 ret = xmlACatalogRemove(catal, BAD_CAST argv[i + 2]);
Daniel Veillard82d75332001-10-08 15:01:59 +0000425 else
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000426 ret = -1;
427 if (ret < 0)
428 fprintf(stderr, "Failed to removed entry from %s\n",
429 argv[i + 1]);
430 if ((noout) && (catal != NULL) &&
431 (xmlCatalogIsEmpty(catal))) {
432 super = xmlLoadSGMLSuperCatalog(
433 XML_SGML_DEFAULT_CATALOG);
434 if (super != NULL) {
435 ret = xmlACatalogRemove(super,
436 BAD_CAST argv[i + 1]);
437 if (ret < 0)
438 fprintf(stderr,
439 "Failed to removed entry from %s\n",
440 XML_SGML_DEFAULT_CATALOG);
441 }
442 }
Daniel Veillard82d75332001-10-08 15:01:59 +0000443 }
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000444 if (noout) {
445 FILE *out;
446
447 if (xmlCatalogIsEmpty(catal)) {
Daniel Veillard6eb17722001-11-04 22:19:27 +0000448 remove(argv[i + 1]);
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000449 } else {
450 out = fopen(argv[i + 1], "w");
451 if (out == NULL) {
452 fprintf(stderr, "could not open %s for saving\n",
453 argv[i + 1]);
454 noout = 0;
455 } else {
456 xmlACatalogDump(catal, out);
457 fclose(out);
458 }
459 }
460 if (super != NULL) {
461 if (xmlCatalogIsEmpty(super)) {
Daniel Veillard6eb17722001-11-04 22:19:27 +0000462 remove(XML_SGML_DEFAULT_CATALOG);
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000463 } else {
464 out = fopen(XML_SGML_DEFAULT_CATALOG, "w");
465 if (out == NULL) {
466 fprintf(stderr,
467 "could not open %s for saving\n",
468 XML_SGML_DEFAULT_CATALOG);
469 noout = 0;
470 } else {
471
472 xmlACatalogDump(super, out);
473 fclose(out);
474 }
475 }
476 }
477 } else {
478 xmlACatalogDump(catal, stdout);
479 }
480 i += 2;
481 } else {
482 if ((!strcmp(argv[i], "-add")) ||
483 (!strcmp(argv[i], "--add"))) {
484 if ((argv[i + 3] == NULL) || (argv[i + 3][0] == 0))
485 ret = xmlCatalogAdd(BAD_CAST argv[i + 1], NULL,
486 BAD_CAST argv[i + 2]);
487 else
488 ret = xmlCatalogAdd(BAD_CAST argv[i + 1],
489 BAD_CAST argv[i + 2],
490 BAD_CAST argv[i + 3]);
491 if (ret != 0)
492 printf("add command failed\n");
493 i += 3;
494 } else if ((!strcmp(argv[i], "-del")) ||
495 (!strcmp(argv[i], "--del"))) {
496 ret = xmlCatalogRemove(BAD_CAST argv[i + 1]);
497 i += 1;
498 }
Daniel Veillardcda96922001-08-21 10:56:31 +0000499 }
500 }
501
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000502 } else if (shell) {
Daniel Veillard344cee72001-08-20 00:08:40 +0000503 usershell();
Daniel Veillarde2940dd2001-08-22 00:06:49 +0000504 } else {
505 for (i++; i < argc; i++) {
506 xmlURIPtr uri;
507 xmlChar *ans;
508
509 uri = xmlParseURI(argv[i]);
510 if (uri == NULL) {
511 ans = xmlCatalogResolvePublic((const xmlChar *) argv[i]);
512 if (ans == NULL) {
513 printf("No entry for PUBLIC %s\n", argv[i]);
514 } else {
515 printf("%s\n", ans);
516 xmlFree(ans);
517 }
518 } else {
519 xmlFreeURI(uri);
520 ans = xmlCatalogResolveSystem((const xmlChar *) argv[i]);
521 if (ans == NULL) {
522 printf("No entry for SYSTEM %s\n", argv[i]);
523 } else {
524 printf("%s\n", ans);
525 xmlFree(ans);
526 }
527 }
528 }
Daniel Veillard344cee72001-08-20 00:08:40 +0000529 }
Daniel Veillardcd21dc72001-11-04 20:03:38 +0000530 if ((!sgml) && ((add) || (del) || (create) || (convert))) {
Daniel Veillarde7ead2d2001-08-22 23:44:09 +0000531 if (noout) {
532 FILE *out;
533
534 out = fopen(filename, "w");
535 if (out == NULL) {
536 fprintf(stderr, "could not open %s for saving\n", filename);
537 noout = 0;
538 } else {
539 xmlCatalogDump(out);
540 }
541 } else {
542 xmlCatalogDump(stdout);
543 }
544 }
Daniel Veillard344cee72001-08-20 00:08:40 +0000545
546 /*
547 * Cleanup and check for memory leaks
548 */
Daniel Veillard344cee72001-08-20 00:08:40 +0000549 xmlCleanupParser();
550 xmlMemoryDump();
551 return(0);
552}
553#else
554int main(int argc, char **argv) {
555 fprintf(stderr, "libxml was not compiled with catalog support\n");
556 return(1);
557}
558#endif