ibp

Eddie Kohler eddietwo at cag.lcs.mit.edu
Wed Feb 17 16:18:55 EST 1999


bip
pbi
bpi

I just made a commit WA HA HA HA HA which pretty much touched everything.
Main change is way of calling a faction's action. Now it is passed an array
of continuations in which it should store the continuations. It returns an
integer: how many continuations it added.

Example

    int faction_x::action(packet *p, void *v, continuation *cont, int ncont)
    {
      do_something();
      ...
      // want to forward p1 to faction f1, and p2 to f2
      set_continuation(0, cont, ncont, f1, p1, v);
      set_continuation(1, cont, ncont, f2, p2, v);
      return 2;
    }

good: no mallocs or frees, cleaner interface, no fuckups (lots of people
weren't null-terminating their continuation lists)

also each faction has a name() function which should return a descriptive
string for debugging/GUI purposes, i've changed existing factions to return
one.

Old code should be saved in a CVS branch 'feb-17', but i might have fucked
up

love,
ed



More information about the click mailing list