Beispiel #1
0
Datei: mark.c Projekt: meh/screen
void MakePaster(struct paster *pa, char *buf, int len, int bufiscopy)
{
	FreePaster(pa);
	pa->pa_pasteptr = buf;
	pa->pa_pastelen = len;
	if (bufiscopy)
		pa->pa_pastebuf = buf;
	pa->pa_pastelayer = flayer;
	DoProcess(Layer2Window(flayer), &pa->pa_pasteptr, &pa->pa_pastelen, pa);
}
Beispiel #2
0
/*
 * returns 0 if the copy buffer was really deleted.
 * Also removes any references into the users copybuffer
 */
int
UserFreeCopyBuffer(struct acluser *u)
{
  struct win *w;
  struct paster *pa;

  if (!u->u_plop.buf)
    return 1;
  for (w = windows; w; w = w->w_next)
    {
      pa = &w->w_paster;
      if (pa->pa_pasteptr >= u->u_plop.buf &&
          pa->pa_pasteptr - u->u_plop.buf < u->u_plop.len)
        FreePaster(pa);
    }
  free((char *)u->u_plop.buf);
  u->u_plop.len = 0;
  u->u_plop.buf = 0;
  return 0;
}