Changeset 2455
- Timestamp:
- Jun 19, 2008, 1:36:52 AM (14 years ago)
- Location:
- neercs/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/configure.ac
r2454 r2455 46 46 esac 47 47 48 AM_CONDITIONAL(USE_GRAB, test "$grab" = "yes")49 48 if test "$grab" = "yes"; then 50 49 AC_DEFINE(USE_GRAB, 1, [Grabbing processes is supported]) -
neercs/trunk/src/Makefile.am
r2447 r2455 2 2 bin_PROGRAMS = neercs 3 3 4 5 if USE_GRAB 6 grab_c=grab.c 7 endif 8 9 neercs_SOURCES = neercs.h $(grab_c) mygetopt.c recurrent.c main.c screens.c term.c effects.c wm.c screensaver.c 4 neercs_SOURCES = neercs.h mygetopt.c recurrent.c main.c screens.c term.c \ 5 grab.c effects.c wm.c screensaver.c 10 6 neercs_CFLAGS = @CACA_CFLAGS@ 11 7 neercs_LDADD = @CACA_LIBS@ @UTIL_LIBS@ -
neercs/trunk/src/grab.c
r2452 r2455 7 7 #include <unistd.h> 8 8 9 #include <sys/ioctl.h> 10 #include <sys/ptrace.h> 11 #include <sys/stat.h> 12 #include <sys/syscall.h> 13 #include <sys/user.h> 14 #include <sys/wait.h> 15 16 #include <linux/kdev_t.h> 17 #include <linux/major.h> 9 #if defined USE_GRAB 10 # include <sys/ioctl.h> 11 # include <sys/ptrace.h> 12 # include <sys/stat.h> 13 # include <sys/syscall.h> 14 # include <sys/user.h> 15 # include <sys/wait.h> 16 17 # include <linux/kdev_t.h> 18 # include <linux/major.h> 19 #endif 18 20 19 21 #include "neercs.h" 20 22 23 #if defined USE_GRAB 21 24 static int memcpy_from_target(pid_t pid, void* dest, void* src, size_t n) 22 25 { … … 220 223 return 0; 221 224 } 225 #endif 222 226 223 227 int grab_process(pid_t pid, char *ptyname, int ptyfd) 224 228 { 229 #if defined USE_GRAB 225 230 int i, fd = 0, mode, ret; 226 231 char fdstr[1024]; … … 288 293 289 294 return 0; 290 } 295 #else 296 return -1; 297 #endif 298 } 299 -
neercs/trunk/src/main.c
r2453 r2455 139 139 int option_index = 0; 140 140 static struct myoption long_options[] = 141 142 #if defUSE_GRAB143 141 { 142 #if defined USE_GRAB 143 { "pid", 1, NULL, 'P' }, 144 144 #endif 145 { "help", 0, NULL, 'h' }, 146 { "version", 0, NULL, 'v' }, 147 }; 145 { "help", 0, NULL, 'h' }, 146 { "version", 0, NULL, 'v' }, 147 }; 148 #if defined USE_GRAB 148 149 int c = mygetopt(argc, argv, "P:hv", long_options, &option_index); 150 #else 151 int c = mygetopt(argc, argv, "hv", long_options, &option_index); 152 #endif 149 153 if(c == -1) 150 154 break; … … 152 156 switch(c) 153 157 { 154 #ifdef USE_GRAB155 158 case 'P': /* --pid */ 156 159 add_screen(screen_list,create_screen_grab(w, h, atoi(myoptarg))); 157 160 s+=2; 158 161 break; 159 #endif160 162 case 'h': /* --help */ 161 163 // usage(argc, argv); -
neercs/trunk/src/neercs.h
r2453 r2455 99 99 100 100 int create_pty(char *cmd, unsigned int w, unsigned int h, int *cpid); 101 #ifdef USE_GRAB102 101 int create_pty_grab(pid_t pid, unsigned int w, unsigned int h); 103 102 int grab_process(pid_t pid, char *ptyname, int ptyfd); 104 #endif105 103 106 104 long int import_term(struct screen_list *screen_list, struct screen *sc, void const *data, unsigned int size); … … 116 114 /* Screens management */ 117 115 struct screen* create_screen(int w, int h, char *command); 118 #ifdef USE_GRAB119 116 struct screen* create_screen_grab(int w, int h, int pid); 120 #endif121 117 int destroy_screen(struct screen *s); 122 118 int add_screen(struct screen_list *list, struct screen *s); -
neercs/trunk/src/screens.c
r2448 r2455 30 30 #include "neercs.h" 31 31 32 #ifdef USE_GRAB33 32 struct screen* create_screen_grab(int w, int h, int pid) 34 33 { … … 58 57 return s; 59 58 } 60 #endif61 59 62 60 struct screen* create_screen(int w, int h, char *command) -
neercs/trunk/src/term.c
r2453 r2455 578 578 } 579 579 580 #ifdef USE_GRAB581 580 int create_pty_grab(pid_t pid, unsigned int w, unsigned int h) 582 581 { … … 597 596 return fdm; 598 597 } 599 #endif600 598 601 599 int set_tty_size(int fd, unsigned int w, unsigned int h)
Note: See TracChangeset
for help on using the changeset viewer.