* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.141 2002-02-01 23:59:49 adam Exp $
+ * $Id: client.c,v 1.145 2002-02-24 12:24:40 adam Exp $
*/
#include <stdio.h>
size_t i;
for (i = 0; i<len; i++)
if ((buf[i] <= 126 && buf[i] >= 32) || strchr ("\n\r\t\f", buf[i]))
- fputc (buf[i], stdout);
+ printf ("%c", buf[i]);
else
printf ("\\X%02X", buf[i]);
}
printf (" namedResultSets");
setnumber = 0;
}
+ if (ODR_MASK_GET(res->options, Z_Options_encapsulation))
+ printf (" encapsulation");
+ if (ODR_MASK_GET(res->options, Z_Options_resultCount))
+ printf (" resultCount");
+ if (ODR_MASK_GET(res->options, Z_Options_negotiationModel))
+ printf (" negotiationModel");
+ if (ODR_MASK_GET(res->options, Z_Options_duplicateDetection))
+ printf (" duplicateDetection");
+ if (ODR_MASK_GET(res->options, Z_Options_queryType104))
+ printf (" queryType104");
printf ("\n");
fflush (stdout);
return 0;
print_stringn (buf, len);
/* add newline if not already added ... */
if (i <= 0 || buf[i-1] != '\n')
- fputc ('\n', stdout);
+ printf ("\n");
}
static void display_record(Z_External *r)
{
if (
#if AVOID_MARC_DECODE
- /* primitive check for a marc OID 5.1-29 */
- ent->oidsuffix[0] == 5 && ent->oidsuffix[1] < 30
+ /* primitive check for a marc OID 5.1-29 except 16 */
+ ent->oidsuffix[0] == 5 && ent->oidsuffix[1] < 30 &&
+ ent->oidsuffix[1] != 16
#else
- 1
+ 1
#endif
- )
- {
+ )
+ {
if (marc_display_exl (octet_buf, NULL, 0 /* debug */,
r->u.octet_aligned->len) <= 0)
{
if(apdu_file && apdu_file != stderr) { /* don't close stdout*/
perror("unable to close apdu log file");
- };
+ }
apdu_file=NULL;
if(strlen(arg)<1) {
{
if(marcdump && marcdump != stderr) { /* don't close stdout*/
perror("unable to close apdu log file");
- };
+ }
marcdump=NULL;
if(strlen(arg)<1) {
char *command_generator(const char *text, int state)
{
- static idx; // index is the last used the last time command_generator was called
+ static int idx;
if (state==0) {
idx = 0;
}
if (!strncmp(cmd[idx].cmd,text,strlen(text))) {
++idx; /* skip this entry on the next run */
return strdup(cmd[idx-1].cmd);
- };
+ }
}
return NULL;
}
if ((res = sscanf(rl_line_buffer, "%31s %1023[^;]", word, arg)) <= 0) {
rl_attempted_completion_over = 1;
return NULL;
- };
+ }
if(start != strlen(word) +1 ) {
rl_attempted_completion_over = 1;
} else {
rl_attempted_completion_over = 1;
return 0;
- };
- };
+ }
+ }
#else
return 0;
#endif
-};
+}
static void client(void)