Ignore:
Timestamp:
Jun 15, 2008, 7:01:48 PM (14 years ago)
Author:
Pascal Terjan
Message:
  • First attempt to grab a process when started with -P <pid>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/screens.c

    r2422 r2426  
    2828
    2929#include "neercs.h"
     30
     31struct screen* create_screen_grab(int w, int h, int pid)
     32{
     33    struct screen *s = (struct screen*) malloc(sizeof(struct screen));
     34
     35    s->cv = cucul_create_canvas(w, h);
     36    cucul_set_color_ansi(s->cv, CUCUL_BLACK, CUCUL_BLACK);
     37    cucul_clear_canvas(s->cv);
     38    s->init = 0;
     39
     40    s->buf = NULL;
     41    s->title = NULL;
     42    s->total = 0;
     43    s->w = w+1;
     44    s->h = h+1;
     45    s->bell = 0;
     46    s->pid = pid;
     47
     48    s->fd = create_pty_grab(pid, w, h);
     49
     50    if(s->fd < 0)
     51    {
     52        cucul_free_canvas(s->cv);
     53        free(s);
     54        return NULL;
     55    }
     56    return s;
     57}
    3058
    3159struct screen* create_screen(int w, int h, char *command)
Note: See TracChangeset for help on using the changeset viewer.