Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
358dfaa8
Commit
358dfaa8
authored
Jun 14, 1996
by
David Byers
Browse files
(prot_a_parse_num_list): New function to pase num_list data
parent
4682186e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/server/prot-a-parse.c
View file @
358dfaa8
/*
* $Id: prot-a-parse.c,v 0.2
2
1996/06/
09
1
3
:5
4
:4
3
byers Exp $
* $Id: prot-a-parse.c,v 0.2
3
1996/06/
14
1
5
:5
3
:4
0
byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 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.2
2
1996/06/
09
1
3
:5
4
:4
3
byers Exp $"
;
static
char
*
rcsid
=
"$Id: prot-a-parse.c,v 0.2
3
1996/06/
14
1
5
:5
3
:4
0
byers Exp $"
;
#include
"rcs.h"
USE
(
rcsid
);
...
...
@@ -40,10 +40,14 @@ USE(rcsid);
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include
"debug.h"
#include
"s-string.h"
#include
"kom-types.h"
#include
"server/smalloc.h"
#include
"com.h"
#include
"connections.h"
#include
"prot-a-parse.h"
...
...
@@ -100,6 +104,41 @@ prot_a_parse_long(Connection *client)
return
res
;
}
void
prot_a_parse_num_list
(
Connection
*
client
,
Number_list
*
res
)
{
String
token
;
token
=
prot_a_get_token
(
client
);
if
(
client
->
array_parse_pos
==
0
)
{
res
->
length
=
atoi
(
token
.
string
);
res
->
data
=
smalloc
(
sizeof
(
*
res
->
data
)
*
res
->
length
);
client
->
array_parse_pos
+=
1
;
}
if
(
client
->
array_parse_pos
==
1
)
/* Ignore open-brace token or star */
{
token
=
prot_a_get_token
(
client
);
/* Ignore open-brace */
client
->
array_parse_pos
+=
1
;
}
if
(
res
->
length
==
0
)
return
;
while
(
client
->
array_parse_pos
<
res
->
length
+
2
)
{
token
=
prot_a_get_token
(
client
);
res
->
data
[
client
->
array_parse_pos
-
2
]
=
atol
(
token
.
string
);
client
->
array_parse_pos
+=
1
;
}
token
=
prot_a_get_token
(
client
);
/* Ignore close-brace token */
}
void
prot_a_parse_priv_bits
(
Connection
*
client
,
Priv_bits
*
res
)
...
...
src/server/prot-a-parse.h
View file @
358dfaa8
/*
* $Id: prot-a-parse.h,v 0.
9
1996/06/
09
1
3
:5
4
:4
5
byers Exp $
* $Id: prot-a-parse.h,v 0.
10
1996/06/
14
1
5
:5
3
:4
3
byers Exp $
* Copyright (C) 1991, 1992, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -23,12 +23,16 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: prot-a-parse.h,v 0.
9
1996/06/
09
1
3
:5
4
:4
5
byers Exp $
* $Id: prot-a-parse.h,v 0.
10
1996/06/
14
1
5
:5
3
:4
3
byers Exp $
*
*/
extern
long
prot_a_parse_long
(
Connection
*
client
);
extern
void
prot_a_parse_num_list
(
Connection
*
client
,
Number_list
*
res
);
extern
void
prot_a_parse_priv_bits
(
Connection
*
client
,
Priv_bits
*
result
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment