Commit b097a2ff authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Include oop.h.

parent 561e79e9
/*
* $Id: prot-a-output.c,v 0.59 2003/03/23 09:44:58 ceder Exp $
* $Id: prot-a-output.c,v 0.60 2003/07/12 00:18:30 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -43,6 +43,8 @@
#endif
#include <assert.h>
#include "oop.h"
#include "s-string.h"
#include "kom-types.h"
#include "isc-interface.h"
......
#
# $Id: prot-a-parse-arg-c.awk,v 0.26 2002/12/30 14:09:44 ceder Exp $
# $Id: prot-a-parse-arg-c.awk,v 0.27 2003/07/12 00:18:32 ceder Exp $
# Copyright (C) 1991-1994, 1996-1999, 2002 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -22,7 +22,7 @@
#
# Please mail bug reports to bug-lyskom@lysator.liu.se.
#
# $Id: prot-a-parse-arg-c.awk,v 0.26 2002/12/30 14:09:44 ceder Exp $
# $Id: prot-a-parse-arg-c.awk,v 0.27 2003/07/12 00:18:32 ceder Exp $
BEGIN {
printf("/* Don't edit this file - it is generated automatically");
printf(" from\n prot-a-parse-arg-c.awk and fncdef.txt */\n\n");
......@@ -35,6 +35,8 @@ BEGIN {
printf("#include <setjmp.h>\n");
printf("#include <time.h>\n");
printf("\n");
printf("#include \"oop.h\"\n");
printf("\n");
printf("#include \"s-string.h\"\n");
printf("#include \"kom-types.h\"\n");
printf("#include \"com.h\"\n");
......@@ -88,10 +90,10 @@ $1 != "#" && $1 != "" {
else if ( $i == "c_local_text_no_p" )
{
printf("\tif ( parse_nonwhite_char(client) != '{' )\n");
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\t longjmp(parse_env, KOM_PROTOCOL_ERR);\n");
printf("\tif ( client->num%d > %s )\n",\
num-1, $(++i));
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\t longjmp(parse_env, KOM_PROTOCOL_ERR);\n");
printf("\n");
printf("\tclient->c_local_text_no_p = ");
printf("smalloc(client->num%d\n", num-1);
......@@ -110,14 +112,14 @@ $1 != "#" && $1 != "" {
printf("\tclient->fnc_parse_pos = %d;\n", ++pos);
printf(" case %d:\n", pos);
printf("\tif ( parse_nonwhite_char(client) != '}' )\n");
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\t longjmp(parse_env, KOM_PROTOCOL_ERR);\n");
}
else if ( $i == "c_misc_info_p" )
{
printf("\tif ( parse_nonwhite_char(client) != '{' )\n");
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\t longjmp(parse_env, KOM_PROTOCOL_ERR);\n");
printf("\tif ( client->num%d > %s )\n", num-1, $(++i));
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\t longjmp(parse_env, KOM_PROTOCOL_ERR);\n");
printf("\n");
printf("\tclient->c_misc_info_p = ");
printf("smalloc(client->num%d\n", num-1);
......@@ -136,7 +138,7 @@ $1 != "#" && $1 != "" {
printf("\tclient->fnc_parse_pos = %d;\n", ++pos);
printf(" case %d:\n", pos);
printf("\tif ( parse_nonwhite_char(client) != '}' )\n");
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\t longjmp(parse_env, KOM_PROTOCOL_ERR);\n");
}
else if ( $i == "aux_item" )
printf("\tprot_a_parse_aux_item(client, &client->aux_item);\n");
......
/*
* $Id: prot-a-parse.c,v 0.56 2003/01/12 19:56:09 ceder Exp $
* $Id: prot-a-parse.c,v 0.57 2003/07/12 00:18:34 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -43,6 +43,8 @@
# include <stdlib.h>
#endif
#include "oop.h"
#include "debug.h"
#include "s-string.h"
#include "kom-types.h"
......@@ -90,10 +92,10 @@ prot_a_get_token(Connection *client)
{
isc_puts("%%Insane token length.\n", client->isc_session);
isc_flush(client->isc_session);
longjmp(parse_env, ISC_LOGOUT);
longjmp(parse_env, KOM_LOGOUT);
}
client->first_to_parse = old_first;
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
}
return result;
......@@ -110,7 +112,7 @@ prot_a_parse_long(Connection *client)
token = prot_a_get_token(client);
res = s_strtol(token, &end);
if (end != s_strlen(token))
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
return res;
}
......@@ -143,14 +145,14 @@ prot_a_parse_num_list(Connection *client,
{
isc_puts("%%Insane array size.\n", client->isc_session);
isc_flush(client->isc_session);
longjmp(parse_env, ISC_LOGOUT);
longjmp(parse_env, KOM_LOGOUT);
}
client->array_parse_pos = 1;
/* Fall through */
case 1: /* The opening curly brace. */
if ( parse_nonwhite_char(client) != '{' )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
res->length = min(maxlen+1, client->array_parse_parsed_length);
res->data = smalloc(sizeof(*res->data) * res->length);
......@@ -179,7 +181,7 @@ prot_a_parse_num_list(Connection *client,
/* Read the closing brace */
if ( parse_nonwhite_char(client) != '}' )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
default:
client->array_parse_pos = 0;
}
......@@ -195,7 +197,7 @@ prot_a_parse_priv_bits(Connection *client,
token = prot_a_get_token(client);
len = s_strlen(token);
if (len <= 0 )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
init_priv_bits(res);
switch (len)
......@@ -230,7 +232,7 @@ prot_a_parse_pers_flags(Connection *client,
token = prot_a_get_token(client);
len = s_strlen(token);
if (len <= 0)
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
init_personal_flags(res);
switch (len)
......@@ -257,7 +259,7 @@ prot_a_parse_membership_type(Connection *client,
token = prot_a_get_token(client);
len = s_strlen(token);
if (len <= 0)
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
init_membership_type(res);
switch (len)
......@@ -284,7 +286,7 @@ prot_a_parse_conf_type(Connection *client,
token = prot_a_get_token(client);
len = s_strlen(token);
if (len <= 0)
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
init_conf_type(res);
switch (len)
......@@ -341,7 +343,7 @@ prot_a_parse_string(Connection *client,
|| client->first_to_parse + hptr
>= s_strlen(client->unparsed) )
{
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
}
if (client_len < 0)
......@@ -349,7 +351,7 @@ prot_a_parse_string(Connection *client,
isc_puts("%%Insane string length.\n", client->isc_session);
isc_flush(client->isc_session);
BUG(("%%%%Insane string length.\n"));
longjmp(parse_env, ISC_LOGOUT);
longjmp(parse_env, KOM_LOGOUT);
}
/* Check that
......@@ -360,7 +362,7 @@ prot_a_parse_string(Connection *client,
+ hptr ] != 'H'
|| hptr <= 0 )
{
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
}
client->first_to_parse += 1 + hptr;
......@@ -386,7 +388,7 @@ prot_a_parse_string(Connection *client,
if ( client->first_to_parse + truncated_len
> s_strlen(client->unparsed) )
{
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
}
*result = EMPTY_STRING;
......@@ -427,7 +429,7 @@ prot_a_parse_string(Connection *client,
result->len = client_len;
if ( client_len > truncated_len )
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
/* Fall through */
default:
client->string_parse_pos = 0;
......@@ -444,7 +446,7 @@ prot_a_parse_aux_item_flags(Connection *client,
token = prot_a_get_token(client);
len = s_strlen(token);
if (len <= 0)
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
init_aux_item_flags(res);
switch (len)
......@@ -513,7 +515,7 @@ prot_a_parse_aux_item_list(Connection *client,
{
isc_puts("%%Insane array size.\n", client->isc_session);
isc_flush(client->isc_session);
longjmp(parse_env, ISC_LOGOUT);
longjmp(parse_env, KOM_LOGOUT);
}
client->array_parse_pos = 1;
......@@ -521,7 +523,7 @@ prot_a_parse_aux_item_list(Connection *client,
case 1:
if ( parse_nonwhite_char(client) != '{' )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
result->length = min(maxlen+1, client->array_parse_parsed_length);
result->items = smalloc(result->length * sizeof(Aux_item));
......@@ -556,7 +558,7 @@ prot_a_parse_aux_item_list(Connection *client,
/* Read the closing brace */
if ( parse_nonwhite_char(client) != '}' )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
default:
client->array_parse_pos = 0;
}
......@@ -589,7 +591,7 @@ prot_a_parse_misc_info_list(Connection *client,
{
isc_puts("%%Insane array size.\n", client->isc_session);
isc_flush(client->isc_session);
longjmp(parse_env, ISC_LOGOUT);
longjmp(parse_env, KOM_LOGOUT);
}
client->array_parse_pos = 1;
......@@ -597,7 +599,7 @@ prot_a_parse_misc_info_list(Connection *client,
case 1:
if ( parse_nonwhite_char(client) != '{' )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
result->no_of_misc = min(maxlen+1, client->array_parse_parsed_length);
result->misc = smalloc(result->no_of_misc * sizeof(Misc_info));
......@@ -639,7 +641,7 @@ prot_a_parse_misc_info_list(Connection *client,
/* Read the closing brace */
if ( parse_nonwhite_char(client) != '}' )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
default:
client->array_parse_pos = 0;
}
......@@ -749,7 +751,7 @@ prot_a_parse_read_range_list(Connection *client,
{
isc_puts("%%Insane array size.\n", client->isc_session);
isc_flush(client->isc_session);
longjmp(parse_env, ISC_LOGOUT);
longjmp(parse_env, KOM_LOGOUT);
}
client->array_parse_pos = 1;
......@@ -757,7 +759,7 @@ prot_a_parse_read_range_list(Connection *client,
case 1:
if (parse_nonwhite_char(client) != '{')
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
res->length = min(maxlen+1, client->array_parse_parsed_length);
res->ranges = smalloc(res->length * sizeof(struct read_range));
......@@ -780,7 +782,7 @@ prot_a_parse_read_range_list(Connection *client,
case 3:
/* Read the closing brace */
if ( parse_nonwhite_char(client) != '}' )
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
default:
client->array_parse_pos = 0;
}
......@@ -884,7 +886,7 @@ prot_a_hunt_nl(Connection *client)
{
case 0: /* whitspace/simple tokens */
if ( client->first_to_parse >= s_strlen(client->unparsed) )
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
switch(client->unparsed.string[client->first_to_parse])
{
......@@ -907,7 +909,7 @@ prot_a_hunt_nl(Connection *client)
client->fnc_parse_pos = 1;
break;
default:
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
}
break;
case 1: /* number/string */
......@@ -931,7 +933,7 @@ prot_a_hunt_nl(Connection *client)
}
if (number_end == s_strlen(client->unparsed))
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
if (client->unparsed.string[number_end] == 'H')
{
......@@ -969,7 +971,7 @@ prot_a_hunt_nl(Connection *client)
/* Skip as much of the string as possible. */
client->num0 -= len;
client->first_to_parse = s_strlen(client->unparsed);
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
}
abort();
default:
......@@ -998,7 +1000,7 @@ prot_a_hunt_array_end(Connection *client)
{
case 0: /* whitspace/simple tokens */
if ( client->first_to_parse >= s_strlen(client->unparsed) )
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
switch(client->unparsed.string[client->first_to_parse])
{
......@@ -1033,7 +1035,7 @@ prot_a_hunt_array_end(Connection *client)
client->hunt_parse_pos = 1;
break;
default:
longjmp(parse_env, ISC_PROTOCOL_ERR);
longjmp(parse_env, KOM_PROTOCOL_ERR);
}
break;
case 1: /* number/string */
......@@ -1057,7 +1059,7 @@ prot_a_hunt_array_end(Connection *client)
}
if (number_end == s_strlen(client->unparsed))
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
if (client->unparsed.string[number_end] == 'H')
{
......@@ -1095,7 +1097,7 @@ prot_a_hunt_array_end(Connection *client)
/* Skip as much of the string as possible. */
client->array_hunt_num -= len;
client->first_to_parse = s_strlen(client->unparsed);
longjmp(parse_env, ISC_MSG_INCOMPLETE);
longjmp(parse_env, KOM_MSG_INCOMPLETE);
}
abort(); /* NOTREACHED */
default:
......
/*
* $Id: prot-a-send-async.c,v 0.30 2003/01/06 13:10:09 ceder Exp $
* $Id: prot-a-send-async.c,v 0.31 2003/07/12 00:18:36 ceder Exp $
* Copyright (C) 1991, 1993-1999, 2001-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -39,6 +39,8 @@
# include <stdarg.h>
#endif
#include "oop.h"
#include "misc-types.h"
#include "s-string.h"
#include "kom-types.h"
......
/*
* $Id: prot-a.c,v 0.74 2002/11/15 17:14:41 ceder Exp $
* $Id: prot-a.c,v 0.75 2003/07/12 00:18:39 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -42,6 +42,8 @@
#include <sys/types.h>
#include <sys/socket.h>
#include "oop.h"
#include "misc-types.h"
#include "s-string.h"
#include "kom-types.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment