[Verse-dev] Simple Question

Emil Brink emil at obsession.se
Wed Nov 3 11:27:09 CET 2004


On Wed, 3 Nov 2004 10:01:47 +0100
"Marcus Hoffmann" <Marcus.Hoffmann at igd.fhg.de> wrote:

[specs needed]
> Ok, then lets wait for his return or maybe he's reading this before....

Unfortunately, that's probably the best we can do, yes. Short of reading
the reference host code, of course. :)

> > > What about link ids?
> >
> > Link IDs are picked by the host, clients should use ~0 to request a new
> > link to be allocated, or use a value previously returned by the host to
> > refer to that link (to e.g. unset a link, use its ID and set the name to
> > empty).
> 
> I thought from R4 on its the -1 to detect a true creation. I test
> against -1, and if not -1 if the ID already exists. If not, then a new node
> (or whatever) is created.

Oh, you were really speaking from a server perspective, I didn't realize.

Yes, you are correct, but I prefer ~0 (all bits on) over -1, since all the
ID types are unsigned. Talking about the value "minus one" in an unsigned
context makes no sense to me.

> Its good that you remind me to that. In the future it would be really good
> to know, in what way a change is "marked" - not only for links but for all
> create/change commands

Well... It's simply a core design feature that (from a client's perspective)
creates and changes look exactly the same. From a host's perspective, I'd
guess that an ID of ~0 always denotes a request to create something, while
any other ID is an _attempt_ to modify existing data. This attempt need not
be granted, of course.

> I knew that if a command refered to a node with an existing ID this command
> is supposed to be a change and not a create. But things like "if the name is
> empty, then destroy a link" is something that is new to me. Such things
> should really be in the spec.

True. However, I just realized I am a bit... messed up when it comes to
object links. The real answer is "use o_link_destroy to destroy a link",
naturally. This command is not even IN the spec, which is a fsck-up on
my part. I will try to rectify that immediately. Disregard the stuff about
empty labels, please. Sorry for the confusion.

> I know your time for that is limited, but how should someone know how to
> build a correct verse client/server, if such things are only in eskils/
> your mind. ;)

Too true. :/

Regards,

/Emil


More information about the Verse-dev mailing list