[Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Oct 18, 2001 at 06:26:55PM -0400, Justin Moore wrote:
>
> I'm in the process of doing a pretty major overhaul on the server
> infrastructure in order to make the code more reasonable and slightly
> easier to maintain or modify. The patches are pretty sizeable, but pretty
> much all of that is due to code being rearranged, not necessarily
> modified. So please don't freak when you see single patches of 1K+ lines.
> :) I'm posting the README here, and putting the actual patch into
> incoming/. Below are some comments about split() (which will eventually
> make its way into the patches).
>
> -jdm
>
> > > I'll comment split to indicate that is has strtok-like changing of the
> > > buffer you pass to it. As for the whitespace issue, for sake of speed and
> > > coding simplicity, I'm going with Raimar's suggestion for enums that get
> > > passed to split. Hence, the current (final) API is:
> > >
> > > int split(const char *toks, char *buf, char *args[], int max_args,
> > > int handle_whitespace);
> >
> > s/toks/delimeters/
> > s/args/tokens/ or s/args/items/
>
> Done.
>
> > > where handle_whitespace could be
> > >
> > > #define REMOVE_NO_WHITESPACE 0x0
> > > #define REMOVE_PADDING_WHITESPACE 0x1
> >
> > > #define REMOVE_SPLIT_WHITESPACE 0x2
> >
> > REMOVE and SPLIT? Isn't this SPLIT_ON_WHITESPACE?
> >
> > Overall it isn't a true enum.
>
> /* How do we handle whitespace within a split? */
> enum whitespace_handle {
> LEAVE_WHITESPACE = 1, /* Don't bother with it */
> REMOVE_SURROUNDING_WHITESPACE, /* Get rid of it around tokens */
> SPLIT_WHITESPACE /* Whitespace is a token */
> };
>
> > > I'll work on the server parsing stuff when I get a chance. I plan to
> > > overhaul the basic framework, and people can take it from there as to how
> > > specific functions will be implemented.
> >
> > I will wait with the inclusion of the split method till there is a
> > user.
>
> The user will be here as soon as he can code it (as long as his advisor
> isn't looking over his shoulder :)).
>
> -jdm
>
> Department of Computer Science, Duke University, Durham, NC 27708-0129
> Email: justin@xxxxxxxxxxx
Content-Description: Cleanup README
> This series of patches hopes to clean up the server code. Right now it's
> a mish-mash of commands and no clear organization or arrangement. Fx,
> code to directly toggle the AI status of players is in stdinhand.c. This
> series of patches divides stdinhand.c into several files based on
> functionality. The first few patches are huge rearrangements of chunks of
> code, while later (and future) one will target particular sections for
> readability and maitainability.
>
> NOTE: Apply patches in order. To compile you must run automake, etc, etc.
>
> Server-Cleanup-1
> ================
> - Creates files commands.[ch] and serverio.[ch].
> - Updates server/Makefile.am to include new files.
> - Removes command enumeration and descriptions from stdinhand.c and puts
> them into command.[ch]
> - Removes cmd_reply* functions from stdinhand.c and puts them into
> serverio.[ch].
>
> Server-Cleanup-2
> ================
> - Creates files settings.[ch].
A description what should go into commands, serverio and settings and
what shouldn't go would be nice.
Otherwise I wait for the patches to comment on them.
Comments from others?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"brand memory are for windows users that think their stability
problems come from the memory"
-- bomek in #freeciv
- [Freeciv-Dev] Re: Split patch (was Re: [RFC PATCH] init_techs), Justin Moore, 2001/10/05
- [Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch), Justin Moore, 2001/10/19
- [Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch), Raimar Falke, 2001/10/22
- [Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch), Daniel Sjölie, 2001/10/22
- [Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch), Daniel L Speyer, 2001/10/22
- [Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch), Justin Moore, 2001/10/22
- [Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch), Raimar Falke, 2001/10/22
- [Freeciv-Dev] Re: Server Overhaul (was Re: Re: Split patch), Arien Malec, 2001/10/22
|
|