Example #1
0
/** Send one or more FJOINs for a channel of users.
 * If the length of a single line is more than 480-NICKMAX
 * in length, it is split over multiple lines.
 * Send one or more FMODEs for a channel with the
 * channel bans, if there's any.
 */
void TreeSocket::SendFJoins(Channel* c)
{
	CommandFJoin::Builder fjoin(c);
	const UserMembList *ulist = c->GetUsers();

	for (UserMembCIter i = ulist->begin(); i != ulist->end(); ++i)
	{
		Membership* memb = i->second;
		if (!fjoin.has_room(memb))
		{
			// No room for this user, send the line and prepare a new one
			this->WriteLine(fjoin.finalize());
			fjoin.clear();
		}
		fjoin.add(memb);
	}
	this->WriteLine(fjoin.finalize());
}
Example #2
0
File: annot.c Project: koraa/annot
void *thr_read(void *arg__) {
  ArgRead *arg = arg__;

  Tok *t; 
  while (feof(arg->F)==0) { // Each token (mostly lines)
    t = newTok();
    nlock_lock(t->edit);

    fjoin(arg->F);   // Wait for the stream to have data
    ll_push(inQ, t); // Pass on for timestamp

    // Now read the data
    getItok(arg->F, arg->delim, t->str);
    nlock_unlock(t->edit);
  }
 
  inQ->EOT = true;   
  return 0;
}