From 6e6655bb64e72ea79b834bb384b7fa3bb370a782 Mon Sep 17 00:00:00 2001 From: Per Cederqvist <ceder@lysator.liu.se> Date: Sun, 12 Jan 1992 01:32:37 +0000 Subject: [PATCH] The function prot_a_get_token is now static, not extern. --- src/server/ChangeLog | 4 +++ src/server/prot-a-parse.c | 56 ++++++++++++++++++++++----------------- src/server/prot-a-parse.h | 12 ++------- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/src/server/ChangeLog b/src/server/ChangeLog index f252d905d..a7ed43faa 100644 --- a/src/server/ChangeLog +++ b/src/server/ChangeLog @@ -1,3 +1,7 @@ +Sun Jan 12 02:30:34 1992 Per Cederqvist (ceder at lysator) + + * prot_a_get_token (prot-a-parse.[ch]): Then function is now static. + Sun Jan 5 19:10:20 1992 Per Cederqvist (ceder at lysator) * main (dbck.c): Tell the user why no compression was done if he diff --git a/src/server/prot-a-parse.c b/src/server/prot-a-parse.c index 4ff3d0302..e8ce8bdab 100644 --- a/src/server/prot-a-parse.c +++ b/src/server/prot-a-parse.c @@ -1,5 +1,5 @@ /* - * $Id: prot-a-parse.c,v 0.9 1991/12/17 22:20:57 ceder Exp $ + * $Id: prot-a-parse.c,v 0.10 1992/01/12 01:32:34 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -28,7 +28,7 @@ * BUG: Not all functions are used, I think. /ceder */ -static char *rcsid = "$Id: prot-a-parse.c,v 0.9 1991/12/17 22:20:57 ceder Exp $"; +static char *rcsid = "$Id: prot-a-parse.c,v 0.10 1992/01/12 01:32:34 ceder Exp $"; #include <setjmp.h> @@ -47,6 +47,36 @@ static char *rcsid = "$Id: prot-a-parse.c,v 0.9 1991/12/17 22:20:57 ceder Exp $" #include "config.h" #include "log.h" + +/* + * Return next token from the input stream. Note that the String returned + * by this call points into data that might be freed by the next call to + * get_token or any function which reads from the stream. + */ + +static String +prot_a_get_token(Connection *client) +{ + String result; + String_size old_first; + + old_first = client->first_to_parse; + + result = s_strtok(client->unparsed, &client->first_to_parse, + s_fcrea_str(WHITESPACE)); + + /* Check that there was at least one trailing blank. */ + + if ( client->first_to_parse >= s_strlen(client->unparsed) ) + { + client->first_to_parse = old_first; + longjmp(parse_env, ISC_MSG_INCOMPLETE); + } + + return result; +} + + long prot_a_parse_long(Connection *client) { @@ -267,28 +297,6 @@ prot_a_parse_misc_info(Connection *client, } -String -prot_a_get_token(Connection *client) -{ - String result; - String_size old_first; - - old_first = client->first_to_parse; - - result = s_strtok(client->unparsed, &client->first_to_parse, - s_fcrea_str(WHITESPACE)); - - /* Check that there was at least one trailing blank. */ - - if ( client->first_to_parse >= s_strlen(client->unparsed) ) - { - client->first_to_parse = old_first; - longjmp(parse_env, ISC_MSG_INCOMPLETE); - } - - return result; -} - void prot_a_parse_time_date(Connection *client, struct tm *result) diff --git a/src/server/prot-a-parse.h b/src/server/prot-a-parse.h index 70f1ae489..a6ef44da2 100644 --- a/src/server/prot-a-parse.h +++ b/src/server/prot-a-parse.h @@ -1,5 +1,5 @@ /* - * $Id: prot-a-parse.h,v 0.4 1991/12/17 22:20:55 ceder Exp $ + * $Id: prot-a-parse.h,v 0.5 1992/01/12 01:32:32 ceder Exp $ * Copyright (C) 1991 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -23,7 +23,7 @@ * Please mail bug reports to bug-lyskom@lysator.liu.se. */ /* - * $Id: prot-a-parse.h,v 0.4 1991/12/17 22:20:55 ceder Exp $ + * $Id: prot-a-parse.h,v 0.5 1992/01/12 01:32:32 ceder Exp $ * */ extern long @@ -47,14 +47,6 @@ extern void prot_a_parse_misc_info(Connection *client, Misc_info *result); -/* - * Return next token from the input stream. Note that the String returned - * by this call points into data that might be freed by the next call to - * get_token or any function which reads from the stream. - */ -extern String -prot_a_get_token(Connection *client); - extern void prot_a_parse_time_date(Connection *client, struct tm *result); -- GitLab