#pentagram@irc.freenode.net logs for 23 Feb 2003 (GMT)

Archive Today Yesterday Tomorrow
Pentagram homepage


[00:57:44] --> Kirben has joined #pentagram
[00:57:44] --- ChanServ gives channel operator status to Kirben
[02:09:21] <-- wjp has left IRC ("Zzzz...")
[03:33:53] <-- Kirben has left IRC ("System Meltdown")
[03:50:07] --> Kirben has joined #pentagram
[03:50:08] --- ChanServ gives channel operator status to Kirben
[06:43:24] <-- DarkeZzz has left IRC (sterling.freenode.net irc.freenode.net)
[06:43:28] --> DarkeZzz has joined #pentagram
[06:43:28] --- ChanServ removes channel operator status from DarkeZzz
[11:17:00] --> wjp has joined #pentagram
[11:17:00] --- ChanServ gives channel operator status to wjp
[11:37:45] --> Colourless has joined #Pentagram
[11:37:45] --- ChanServ gives channel operator status to Colourless
[11:42:46] --- DarkeZzz is now known as Darke
[11:42:51] --- ChanServ gives channel operator status to Darke
[12:15:28] * Darke has a strange urge to ramble on about virtual path stuff. *grin*
[12:16:34] <wjp> ramble away :-)
[12:18:19] * Darke is suddenly distracted by food to much on. He's be back to ramble again in a couple of minutes once his mouth is empty of food. *grin*
[12:18:31] <Darke> Politeness and all. *grin*
[12:18:51] <wjp> how considerate :-)
[12:18:58] <Colourless> :-)
[12:25:04] <Colourless> do you know if gcc allows you to use -> on a pointer to access a static member of a class ?
[12:25:19] <Colourless> i'm guessing it should
[12:25:33] <wjp> IIRC, yes, but I'll check
[12:26:55] <wjp> yes, it does
[12:28:13] <Colourless> good. I'm actually pretty sure it's a standard thing :-)
[12:30:55] * Darke admittedly has typed something to the effect of "Can't chat. Mouth full." before.
[12:31:09] <Darke> Ah yes, vpath stuff. *grin*
[12:32:11] <Darke> Firstly, % is probably not the best character to use for virtual paths, since like $ under unix, under windows it means reference an environment variable, and probably should be avoided for paranoias sake. *grin*
[12:32:41] <wjp> ah, didn't know that :-)
[12:32:57] <Colourless> you do %VAR_NAME%
[12:33:14] <wjp> how about !, @, #, &?
[12:33:16] <Colourless> and it's also used in batch files to get args %1 %2 %3 and so on
[12:33:16] <Darke> Though it's actually %systemroot% for example. I think what'd happen was it'll try to use everything after the % as an environment variable. Could cause problems.
[12:33:45] <Darke> I can't think of anything wrong with @.
[12:33:49] <Colourless> % will also screw with C strings will it not?
[12:34:01] * Colourless thinks of %d %i %f %l and so on
[12:34:16] <wjp> only if you pass it straight to *printf
[12:34:18] <Darke> Yep. Only if you're using it as a printf/scanf type string.
[12:34:33] <Colourless> yeah, which shouldn't happen, but you never know
[12:34:36] <Darke> Though that's a *really* unsecure way of doing things and should never be used. *grin*
[12:35:21] <Darke> I think @ is really the only character available, though ! could be ok too.
[12:35:55] <Darke> Though between shell scripting and vi, I read ! as 'execute'. *grin*
[12:36:33] <wjp> anyway, the starting character isn't really defined anywhere atm
[12:36:47] <wjp> it's just that 'coincidentally' all current vpaths start with % :-)
[12:37:06] * Darke considers a user defined starting character. *evillook*
[12:37:06] <Colourless> i'm guessing that it doesn't matter does it :-)
[12:37:52] <wjp> maybe an extra check could be added to consider paths starting with a %/@/... as 'illegal' to open
[12:38:41] <wjp> (after they're rewritten, of course)
[12:39:42] <Darke> How do you mean?
[12:40:09] <wjp> well, right now, it'll try to open something like "%blah/whatever"
[12:40:45] <wjp> um, if rewriting produces "%blah/whatever", I mean, and that isn't rewritten further
[12:41:00] * Darke ahhs. Makes sense.
[12:41:21] <wjp> (i.e., there's not much point in passing that to fopen functions)
[12:41:29] * Darke nods. Makes sense.
[12:42:14] <Darke> Is it possible to unmount virtual paths?
[12:42:26] <wjp> yeah; RemoveVirtualPath or something
[12:42:47] <Darke> Cool. Haven't gotten to that bit then. *grin*
[12:42:55] <wjp> it doesn't support .zip/.flx files yet, btw :-)
[12:43:37] <Darke> Doesn't matter for the moment. I'd just like to start using it with the the (de)compilers. *grin*
[12:44:44] <wjp> the current 'default' vpaths (%home, %data) should be enough, right?
[12:44:50] <wjp> or should the current dir get one too?
[12:45:22] <wjp> also, if we're especially paranoid, maybe we should disallow ../ in some places
[12:45:56] <Darke> Probably not. But we'd need to somehow be able to define directories for arbitary game paths (remorse{version}/pagan{version}), and be able to mount them to a generic @game vpath.
[12:46:12] <Darke> I think disallowing ../ outright would make sense.
[12:46:19] <Colourless> yes, i think it would be a good idea to be able to prevent Absolute paths from being passed, and also prevent the paths from going in to the parents on the pentagram dir
[12:46:36] <wjp> absolute paths are already disallowed
[12:46:51] <wjp> (i.e., a path has to be rewritten at least once for it to be allowed)
[12:47:24] <wjp> .. should probably be allowed only for 'top-level' vpaths
[12:47:39] <wjp> or maybe not even there
[12:47:44] <Colourless> ah ok. so a path has got to be set allowed
[12:48:47] * wjp nods
[12:49:46] <Colourless> .. is an issue. i think it should probably be forbidden
[12:50:31] <Darke> I agree. There's too many special cases to take into account if we do allow it.
[12:51:26] <-- Kirben has left IRC ("System Meltdown")
[12:52:04] <Colourless> example what would you do here: @some_path/../@some_other_path/a_filename
[12:52:27] <wjp> hm, what would a @ not at the start mean?
[12:52:46] <wjp> it only rewrites prefixes atm
[12:53:32] <Darke> Also, if we attempt to 'mount' a path, and fail, we should fail 'silently' and just log the fail into the logs. This allows us to ship a default config file with it, with entries like <u8><path>./game/u8</path></u8> and suggest the user just put the datafiles in the default directory, we can override it with the ~/.pentagram/pentagram.cfg file they wish to then.
[12:55:09] <wjp> should we check the validity of a path when mounting it?
[12:55:11] <Darke> I don't think there should be any meaning to an @ not at a start.
[12:55:35] <wjp> (if it actually exists, and is a directory)
[12:56:13] <Darke> I think it'd probably be a good idea. At least we know it fails then because of a typo, rather then somewhere else failing to load a file and us wondering why. *grin*
[12:56:59] <Darke> Will also help with user's bug reports, "Oh, you said for it to look *there* but the error.log says it can't find *there*, did you typo?"
[12:57:02] <wjp> do we already have some directory-checking code for multiple platforms somewhere?
[12:57:17] <Colourless> no idea
[12:57:20] <Colourless> don't think so
[12:57:43] <Darke> I think exult might have it somewhere in it's file checking code. Just a sec.
[12:57:55] <wjp> I vaguely remember having something of the sort... but that be checking if something's a file
[12:58:06] <wjp> s/be/might be/
[12:59:41] <Darke> files/utils.cc has a bunch of directory making/changing/exists code.
[13:00:30] <Darke> Basically it uses 'stat()' to test it on every platform other then Wince.
[13:01:14] <Darke> stat() conforms to POSIX, so that's the reason.
[13:01:54] <Darke> Though I really wonder how the amiga port worked with that, I didn't think they had a posix compatability layer.
[13:02:07] <Darke> Incidentally, did we ever get that code to merge into our cvs?
[13:02:22] <wjp> hm, don't know
[13:02:44] <wjp> it should be somewhere, seeing how exult's GPL, but I haven't seen it I think
[13:03:41] <Darke> Anyway, you use stat() to get back a structure you then pass to the S_ISDIR() macro, and that's it. *grin*
[13:05:08] <Colourless> stat works fine in windows
[13:05:13] <Darke> And stat() will return something other then 0 if it doesn't exist.
[13:05:15] <Colourless> but it doesn't work in wince
[13:05:43] <Darke> *nod* Wince probably isn't POSIX compliant, which windows technically is, IIRC. *grin*
[13:11:03] <-- Colourless has left IRC ("brb")
[13:35:51] --> Colourless has joined #Pentagram
[13:35:51] --- ChanServ gives channel operator status to Colourless
[13:36:30] <wjp> wb
[13:36:40] <Colourless> thx
[13:37:04] <Darke> Greetings once more.
[14:10:04] * Darke yawns and hops off to sleep. Night!
[14:10:12] <Colourless> cya
[14:10:13] --- Darke is now known as DarkeZzz
[14:10:14] <Colourless> i should go too
[14:10:15] <-- Colourless has left IRC ("casts invisibility")
[14:11:05] <wjp> g'night
[23:48:40] --> Kirben has joined #pentagram
[23:48:40] --- ChanServ gives channel operator status to Kirben
[23:52:08] --- DarkeZzz is now known as Darke