/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
*/
/*
* Listener loop for subsystem library libss.a.
*
*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
* For copyright information, see copyright.h.
*/
#include "copyright.h"
#include "ss_internal.h"
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
#include <termios.h>
#include <libintl.h>
/* Solaris Kerberos */
#include <libtecla.h>
{
}
}
int signo;
{
}
/* Solaris Kerberos */
typedef struct _ss_commands {
int sci_idx;
const char **cmd;
unsigned int count;
} ss_commands;
/*
* Solaris Kerberos
* get_commands fills out a ss_commands structure with pointers
* to the top-level commands (char*) that a program supports.
* count reflects the number of commands cmd holds. Memory must
* be allocated by the caller.
*/
const char * const *cmd;
}
}
}
}
/*
* Solaris Kerberos
* Match function used by libtecla for tab-completion.
*/
char **argv, *l;
int ret = 0;
/* Dup the line as ss_parse will modify the string */
if (l == NULL)
return (ret);
/* Tab-completion may happen in the middle of a line */
l[word_end] = '\0';
free (l);
return (ret);
}
/* Don't bother if the arg count is not 1 or 0 */
if (argc < 2) {
if (ret)
break;
}
}
}
free(l);
return (ret);
}
int sci_idx;
{
register char *cp;
int code;
/* Solaris Kerberos */
char *input;
#ifdef POSIX_SIGNALS
#else
register RETSIGTYPE (*sig_cont)();
int mask;
#endif
/* Solaris Kerberos */
"new_GetLine() failed.\n"));
return (SS_ET_TECLA_ERR);
}
/* Find out how many commands there are */
/* Alloc space for them */
return (ENOMEM);
}
/* Fill-in commands.cmd */
"failed to register completion function.\n"));
return (SS_ET_TECLA_ERR);
}
#ifdef POSIX_SIGNALS
sigemptyset(&nmask);
#else
sig_cont = (RETSIGTYPE (*)())0;
#endif
#ifdef POSIX_SIGNALS
#else
#endif
#ifdef POSIX_SIGNALS
#else
(void) sigsetmask(mask);
#endif
/*
* Solaris Kerberos:
* Let libtecla deal with SIGINT when it's doing its own processing
* otherwise the input line won't be cleared on SIGINT.
*/
"Failed to trap SIGINT.\n"));
goto egress;
}
print_prompt();
*end = '\0';
#ifdef POSIX_SIGNALS
#else
if (sig_cont == print_prompt)
#endif
/* Solaris Kerberos */
switch (ret) {
case (GLR_SIGNAL):
continue;
case (GLR_EOF):
continue;
case (GLR_ERROR):
goto egress;
}
if (cp) {
*cp = '\0';
continue;
}
#ifdef POSIX_SIGNALS
#else
#endif
;
if (code == SS_ET_COMMAND_NOT_FOUND) {
register char *c = input;
while (*c == ' ' || *c == '\t')
c++;
if (cp)
*cp = '\0';
if (cp)
*cp = '\0';
"Unknown request \"%s\". Type \"?\" for a request list."),
c);
}
}
code = 0;
/* Solaris Kerberos */
#ifdef POSIX_SIGNALS
#else
#endif
return code;
}
int sci_idx;
int code;
{
}
/* Solaris Kerberos - errors are now returned. */
int argc;
char const * const *argv;
int sci_idx;
{
return 0;
}