Changeset 3996
- Timestamp:
- Nov 22, 2009, 1:41:45 PM (14 years ago)
- Location:
- neercs/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/configure.ac
r3916 r3996 13 13 AM_PROG_CC_C_O 14 14 AC_PROG_CPP 15 16 AC_CANONICAL_HOST 17 18 if test "$host_os" == "darwin10.2.0"; then 19 case x${target} in 20 x*86*darwin*) 21 MACOSX_SDK="${MACOSX_SDK:-/Developer/SDKs/MacOSX10.6.sdk}" 22 GCC_VERSION="${GCC_VERSION:-4.0}" 23 ARCH="${ARCH:--arch i386}" 24 MACOSX_SDK_CFLAGS="${MACOSX_SDK_CFLAGS:--isysroot ${MACOSX_SDK}}" 25 MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CXXFLAGS:-${MACOSX_SDK_CFLAGS}}" 26 ;; 27 esac 28 CC="${CC:-gcc-${GCC_VERSION}}" 29 CXX="${CXX:-g++-${GCC_VERSION}}" 30 MACOSX_SDK_FRAMEWORKS="${MACOSX_SDK_FRAMEWORKS:--F${MACOSX_SDK}/System/Library/Frameworks}" 31 CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}" 32 CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}" 33 CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}" 34 OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}" 35 LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}" 36 fi 37 15 38 16 39 dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right … … 38 61 AC_CHECK_HEADERS(stdio.h pty.h sys/ioctl.h sys/ptrace.h sys/stat.h sys/syscall.h sys/user.h sys/wait.h linux/kdev_t.h linux/major.h security/pam_appl.h security/pam_misc.h) 39 62 63 if test $host_os != "darwin10.2.0"; then 40 64 AC_CHECK_LIB(pam, pam_authenticate, 41 65 [PAM_LIBS="${PAM_LIBS} -lpam" 42 66 AC_DEFINE(USE_LOCK, 1, [Locking the PTY is supported])]) 43 67 AC_SUBST(PAM_LIBS) 68 else 69 AC_MSG_RESULT(Disabling lock support on OSX) 70 fi 44 71 45 72 AC_CHECK_LIB(caca, caca_clear_dirty_rect_list, … … 68 95 AC_DEFINE(_GNU_SOURCE, 1, [Use GNU extentions]) 69 96 97 70 98 # Optimizations 71 99 CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" -
neercs/trunk/src/attach.c
r3969 r3996 155 155 if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) 156 156 { 157 debug("Failed to create socket\n"); 157 158 perror("connect_server:socket"); 158 159 return NULL; … … 424 425 } 425 426 426 int send_event(caca_event_t ev, struct screen_list *screen_list)427 {428 enum caca_event_type t;429 430 t = caca_get_event_type(&ev);431 432 if (t & CACA_EVENT_KEY_PRESS)433 {434 char buf[16];435 int bytes;436 bytes =437 snprintf(buf, sizeof(buf) - 1, "KEY %d",438 caca_get_event_key_ch(&ev));439 buf[bytes] = '\0';440 debug("Sending key press to server: %s", buf);441 return write(screen_list->socket[SOCK_SERVER], buf, strlen(buf)) <= 0;442 }443 else if (t & CACA_EVENT_RESIZE)444 {445 char buf[32];446 int bytes;447 bytes = snprintf(buf, sizeof(buf) - 1, "RESIZE %10d %10d",448 caca_get_event_resize_width(&ev),449 caca_get_event_resize_height(&ev));450 buf[bytes] = '\0';451 debug("Sending resize to server: %s", buf);452 return write(screen_list->socket[SOCK_SERVER], buf, strlen(buf)) <= 0;453 }454 else if (t & CACA_EVENT_QUIT)455 return write(screen_list->socket[SOCK_SERVER], "QUIT",456 strlen("QUIT")) <= 0;457 458 return 0;459 }460 461 int send_delay(struct screen_list *screen_list)462 {463 char buf[18];464 int bytes;465 bytes = snprintf(buf, sizeof(buf) - 1, "DELAY %10d", screen_list->delay);466 buf[bytes] = '\0';467 return write(screen_list->socket[SOCK_SERVER], buf, strlen(buf)) <= 0;468 } -
neercs/trunk/src/client.c
r3986 r3996 62 62 } 63 63 64 int send_event(caca_event_t ev, struct screen_list *screen_list) 65 { 66 67 enum caca_event_type t; 68 69 t = caca_get_event_type(&ev); 70 71 if (t & CACA_EVENT_KEY_PRESS) 72 { 73 char buf[16]; 74 int bytes; 75 bytes = 76 snprintf(buf, sizeof(buf) - 1, "KEY %d", 77 caca_get_event_key_ch(&ev)); 78 buf[bytes] = '\0'; 79 debug("Sending key press to server: %s", buf); 80 debug("Sending '%s', %d bytes\n", buf, strlen(buf)); 81 return write(screen_list->socket[SOCK_SERVER], buf, strlen(buf)+1) <= 0; 82 } 83 else if (t & CACA_EVENT_RESIZE) 84 { 85 86 char buf[32]; 87 int bytes; 88 bytes = snprintf(buf, sizeof(buf) - 1, "RESIZE %10d %10d", 89 caca_get_event_resize_width(&ev), 90 caca_get_event_resize_height(&ev)); 91 buf[bytes] = '\0'; 92 debug("Sending '%s', %d bytes\n", buf, strlen(buf)); 93 return write(screen_list->socket[SOCK_SERVER], buf, strlen(buf)+1) <= 0; 94 } 95 else if (t & CACA_EVENT_QUIT) 96 return write(screen_list->socket[SOCK_SERVER], "QUIT", 97 strlen("QUIT")) <= 0; 98 99 return 0; 100 } 101 102 int send_delay(struct screen_list *screen_list) 103 { 104 debug("Sending DELAY\n"); 105 char buf[18]; 106 int bytes; 107 bytes = snprintf(buf, sizeof(buf) - 1, "DELAY %10d", screen_list->delay); 108 buf[bytes] = '\0'; 109 return write(screen_list->socket[SOCK_SERVER], buf, strlen(buf)) <= 0; 110 } 64 111 65 112 … … 90 137 { 91 138 buf[n] = 0; 92 debug("Received from server: %s", buf);139 debug("Received from server: '%s' (%d bytes)", buf, n); 93 140 if (!strncmp("DETACH", buf, 6)) 94 141 { -
neercs/trunk/src/effects.c
r3969 r3996 200 200 strlen(PACKAGE_STRING)) / 2, y - 1, PACKAGE_STRING); 201 201 caca_printf(screen_list->cv, x, y++, "Copyright (c) 2006-2009"); 202 caca_printf(screen_list->cv, x, y++, 203 " Sam Hocevar <sam@zoy.org>"); 204 caca_printf(screen_list->cv, x, y++, 205 " Jean-Yves Lamoureux <jylam@lnxscene.org>"); 206 caca_printf(screen_list->cv, x, y++, 207 " Pascal Terjan <pterjan@linuxfr.org>"); 202 caca_printf(screen_list->cv, x, y++, " Sam Hocevar <sam@zoy.org>"); 203 caca_printf(screen_list->cv, x, y++, " Jean-Yves Lamoureux <jylam@lnxscene.org>"); 204 caca_printf(screen_list->cv, x, y++, " Pascal Terjan <pterjan@linuxfr.org>"); 208 205 caca_printf(screen_list->cv, x, y++, ""); 209 206 caca_printf(screen_list->cv, x, y++, ""); 210 caca_printf(screen_list->cv, x, y++, 211 "All shortcuts are in format 'ctrl-a-X' where X is :"); 207 caca_printf(screen_list->cv, x, y++, "All shortcuts are in format 'ctrl-a-X' where X is :"); 212 208 caca_printf(screen_list->cv, x, y++, "n:\t Next window"); 213 209 caca_printf(screen_list->cv, x, y++, "p:\t Previous window"); … … 216 212 caca_printf(screen_list->cv, x, y++, "m:\t Thumbnails"); 217 213 caca_printf(screen_list->cv, x, y++, "d:\t Detach"); 218 caca_printf(screen_list->cv, x, y++, 219 "k:\t Close window and kill associated process"); 214 caca_printf(screen_list->cv, x, y++, "k:\t Close window and kill associated process"); 220 215 caca_printf(screen_list->cv, x, y++, "h:\t This help"); 221 216 caca_printf(screen_list->cv, x, y++, ""); 222 217 caca_printf(screen_list->cv, x, y++, ""); 223 caca_printf(screen_list->cv, x, y++, 224 "See http://caca.zoy.org/wiki/neercs for more informations"); 218 caca_printf(screen_list->cv, x, y++, "See http://caca.zoy.org/wiki/neercs for more informations"); 225 219 } 226 220
Note: See TracChangeset
for help on using the changeset viewer.