sms_query, sms_do_update, sms_motd, sms_set_alternate_input,
format_filesys_type, parse_filesys_type,
canonicalize_hostname, strsave, strtrim, sq_create, sq_destroy,
-sq_get_data, sq_save_args, sq_save_data, sq_save_unique_data,
-sq_save_unique_string
+sq_get_data, sq_remove_data, sq_empty, sq_save_args, sq_save_data,
+sq_save_unique_data, sq_save_unique_string
.SH SYNOPSIS
.nf
.nj
Protocol functions
.B #include <sms.h>
-.B extern int sending_version_no;
-
.B int sms_connect(server);
.B char *server;
.B int sq_get_data(sq, data);
.B char **data;
+.B int sq_remove_data(sq, data);
+
+.B int sq_empty(sq);
+
.B sq_save_args(argc, argv, sq);
.B sq_save_data(sq, data);
on failure. An application should connect, check the motd in case the
server is closed, authenticate, perform queries, then disconnect.
-.I sending_version_no
-may be set to
-.B SMS_VERSION_1
-or
-.B SMS_VERSION_2
-to determine the version of the protocol that will be used. It
-currently defaults to
-.B SMS_VERSION_2.
-
.B sms_connect
establishes a connection with the SMS server. The
.I server
-specification is of the form hostname:portname, where the portname can
-be looked up in
+specification is optional. If present, it is of the form
+hostname:portname, where the portname can be looked up in
.B /etc/services.
+If NULL or an empty string is passed as
+.I server,
+then the server will be found from the MOIRASERVER environment
+variable, the "moira" sloc entry in hesiod, or the compiled in
+default, in that order.
.B sms_host
initializes
.I s
pointed to.
-.B sq_create
-will create an empty save_queue.
.TP
Simple Queues
+.B sq_create
+will create an empty save_queue.
+
.B sq_destroy
will free all of the memory contained in the queue structure
.I sq.
with the next piece of data in the queue. If will return 0 if there
is no more data in the queue.
+.B sq_remove_data
+functions like sq_get_data except that any returned data is first
+removed from the queue.
+
+.B sq_empty
+tests the length of the queue, returning non-zero if it is empty or
+zero if the queue contains data.
+
.B sq_save_args
will make a copy of
.I argv,
.br
/tmp/tkt###
.SH "SEE ALSO"
-smstest(8), The Service Management System section of the Athena
-Technical Plan
+mrtest(8), The Moira section of the Athena Technical Plan
.SH DIAGNOSTICS
The error codes returned are those defined in <sms_et.h>, or
<krb_et.h>. They may be easily decoded using the com_err library.