Commit 0153ade7 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Make prot-a-parse-arg.c include async.h. c_local_text_no_p,

c_misc_info_p and num_list should be followed by a maximum array
length in fncdef.txt.  Use array_parse_index instead of
array_parse_pos to count the array index.  Added a missing newline in
the generated code.
parent 3ce3661e
#
# $Id: prot-a-parse-arg-c.awk,v 0.14 1996/06/14 15:52:20 byers Exp $
# $Id: prot-a-parse-arg-c.awk,v 0.15 1996/07/26 00:38:57 ceder Exp $
# Copyright (C) 1991, 1992, 1993, 1994 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.14 1996/06/14 15:52:20 byers Exp $
# $Id: prot-a-parse-arg-c.awk,v 0.15 1996/07/26 00:38:57 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,7 @@ BEGIN {
printf("#include \"kom-types.h\"\n");
printf("#include \"com.h\"\n");
printf("#include \"isc-interface.h\"\n");
printf("#include \"async.h\"\n");
printf("#include \"connections.h\"\n");
printf("#include \"isc-parse.h\"\n");
printf("#include \"server/smalloc.h\"\n");
......@@ -73,25 +74,25 @@ $1 != "#" {
{
printf("\tif ( parse_nonwhite_char(client) != '{' )\n");
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\tif ( client->num%d > param.mark_as_read_chunk )\n",\
num-1);
printf("\tif ( client->num%d > %s )\n",\
num-1, $(++i));
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\n");
printf("\tclient->c_local_text_no_p = ");
printf("smalloc(client->num%d\n", num-1);
printf("\t\t\t\t\t * sizeof(Local_text_no));\n\n");
printf("\tclient->array_parse_pos = 0;\n");
printf("\tclient->array_parse_index = 0;\n");
printf("\tclient->fnc_parse_pos = %d;\n", i - 2);
printf(" case %d:\n", i - 2);
printf("\twhile( client->array_parse_pos < ");
printf("\twhile( client->array_parse_index < ");
printf("client->num%d )\n", num-1);
printf("\t{\n");
printf("\t client->c_local_text_no_p[ client->");
printf("array_parse_pos ]\n");
printf("array_parse_index ]\n");
printf("\t\t= prot_a_parse_long(client);\n");
printf("\t ++client->array_parse_pos;\n");
printf("\t ++client->array_parse_index;\n");
printf("\t}\n");
printf("\tclient->fnc_parse_pos = %d;", i - 1);
printf("\tclient->fnc_parse_pos = %d;\n", i - 1);
printf(" case %d:\n", i - 1);
printf("\tif ( parse_nonwhite_char(client) != '}' )\n");
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
......@@ -100,22 +101,22 @@ $1 != "#" {
{
printf("\tif ( parse_nonwhite_char(client) != '{' )\n");
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\tif ( client->num%d > param.max_crea_misc )\n", num-1);
printf("\tif ( client->num%d > %s )\n", num-1, $(++i));
printf("\t longjmp(parse_env, ISC_PROTOCOL_ERR);\n");
printf("\n");
printf("\tclient->c_misc_info_p = ");
printf("smalloc(client->num%d\n", num-1);
printf("\t\t\t\t\t* sizeof(Misc_info));\n");
printf("\tclient->array_parse_pos = 0;\n");
printf("\tclient->array_parse_index = 0;\n");
printf("\tclient->fnc_parse_pos = %d;\n", i - 2);
printf(" case %d:\n", i - 2);
printf("\twhile( client->array_parse_pos < ");
printf("\twhile( client->array_parse_index < ");
printf("client->num%d )\n", num-1);
printf("\t{\n");
printf("\t prot_a_parse_misc_info(client,");
printf(" &client->c_misc_info_p");
printf("[ client->array_parse_pos ]);\n");
printf("\t ++client->array_parse_pos;\n");
printf("[ client->array_parse_index ]);\n");
printf("\t ++client->array_parse_index;\n");
printf("\t}\n");
printf("\tclient->fnc_parse_pos = %d;\n", i - 1);
printf(" case %d:\n", i - 1);
......@@ -127,7 +128,8 @@ $1 != "#" {
else if ( $i == "info" )
printf("\tprot_a_parse_info(client, &client->info);\n");
else if ( $i == "num_list" )
printf("\tprot_a_parse_num_list(client, &client->num_list);\n");
printf("\tprot_a_parse_num_list(client, &client->num_list, %s);\n",
$(++i));
else
printf("#error in prot-a-parse-arg-c.awk: not ready yet.\n");
......
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