Re: [LHA-misc] Line parsing routine
Status: Beta
Brought to you by:
ncherry
From: Neil C. <nc...@ho...> - 2000-12-01 13:25:20
|
Paul Fox wrote: > > > > > we've planed for. Also can we have more than 1 value? Say we d/l some > > > > code to the Ocelot, we can first send the size of the file (make > > > > reserving memory easier) then the actual file, which can we a stream > > > > of 8 bit characters (no null or <CR> to worry about or escape). > > > > > > this is a good idea. but don't require sending the size of the file > > > first. or at least make it device-specific. it's hard to do > > > on-the-fly compression if you need to know the final size up front. > > > > Why would we need to do on the fly compression? Please don't take this > > as a negative comment. I do not see a reason for it, it could be stored > > commpressed (which in my opinion would be better). > > well, i guess it depends what "it" is. > > i just happened to hit an issue with this sort of thing at work a while > ago, and was thinking you might not want to set limits you don't need to. Without the size of the file we then need to change the way we download the file to the Ocelot (which might not be a bad thing). Here is an example: set addr=Ocelot:0.0.0 value=5 value=^@^M^J^Z^D The ^x characters are single characters each but they would need some fancy way of escaping them if the size wasn't sent. We could fall back sending them in their hex-ASCII equivalants. Such as value=000D0A1A04 . Since we now use select with line buffering (we don't see the line until the user hits a line ending) it's still necessary to know the size as a 32K file would be enough to clobber most input buffers (buffer overruns). Now I know we're recoding but I kind of like the line at a time as it writting the program a lot easier. Any ideas on how to get around said problems? Maybe we could have a set command that has a continue and end command(???). So it would be: set addr=<> continue=<><CR><LF> set addr=<> continue=<><CR><LF> set addr=<> continue=<><CR><LF> set addr=<> continue=<><CR><LF> set addr=<> end=<><CR><LF> This seems a little kludgy. -- Linux Home Automation Neil Cherry nc...@ho... http://members.home.net/ncherry (Text only) http://meltingpot.fortunecity.com/lightsey/52 (Graphics) http://linuxha.sourceforge.net/ (SourceForge) |