Lines Matching refs:p
262 char *p, *str; in add_item() local
274 p = strtok(instr, ","); in add_item()
275 while (p) { in add_item()
276 if (!strcmp(p, item)) { in add_item()
278 p = strtok(NULL, ","); in add_item()
282 } else if (*p == '\0') { in add_item()
283 p = strtok(NULL, ","); in add_item()
289 strcat(str, p); in add_item()
290 p = strtok(NULL, ","); in add_item()
302 char *p, *str; in delete_item() local
314 p = strtok(instr, ","); in delete_item()
315 while (p) { in delete_item()
316 if (!strcmp(p, item) || *p == '\0') { in delete_item()
317 p = strtok(NULL, ","); in delete_item()
323 strcat(str, p); in delete_item()
324 p = strtok(NULL, ","); in delete_item()
368 char *p, *base; in check_httpdir() local
376 p = strtok(path, ":"); in check_httpdir()
377 while(p) { in check_httpdir()
382 len = strlen(p) + 1 + strlen(base) + 1; in check_httpdir()
384 snprintf(prog, len, "%s/%s", p, base); in check_httpdir()
388 p = strtok(NULL, ":"); in check_httpdir()
845 char *p = cmd; in process_remote_cmd() local
873 p += strlen("cmd="); in process_remote_cmd()
874 if (strstr(p, "script:") == p) { in process_remote_cmd()
878 p += strlen("script:"); in process_remote_cmd()
880 if (strstr(p, "file=") == p) { in process_remote_cmd()
884 p += strlen("file="); in process_remote_cmd()
886 rfbLog("reading script from file '%s'\n", p); in process_remote_cmd()
888 if (stat(p, &sbuf) != 0) { in process_remote_cmd()
893 f = fopen(p, "r"); in process_remote_cmd()
899 p = (char *) calloc(sbuf.st_size + 1, 1); in process_remote_cmd()
904 if (strlen(p) + strlen(tmp) > (size_t) sbuf.st_size) { in process_remote_cmd()
907 strcat(p, tmp); in process_remote_cmd()
912 pieces = (char **) malloc(strlen(p) * sizeof(char *)); in process_remote_cmd()
914 s = strdup(p); in process_remote_cmd()
916 s = p; in process_remote_cmd()
1000 p += strlen("qry="); in process_remote_cmd()
1007 if (!strchr(p, ':')) { in process_remote_cmd()
1008 char *q = strchr(p, '='); in process_remote_cmd()
1014 if (strstr(p, str) != p) { \ in process_remote_cmd()
1020 char *q = strchr(p, ':'); \ in process_remote_cmd()
1028 if (strchr(p, ':')) { \ in process_remote_cmd()
1029 snprintf(buf, bufn, "ans=%sN/A", p); \ in process_remote_cmd()
1031 snprintf(buf, bufn, "ans=%s:N/A", p); \ in process_remote_cmd()
1038 if (strchr(p, ':')) { \ in process_remote_cmd()
1039 snprintf(buf, bufn, "aro=%sN/A", p); \ in process_remote_cmd()
1041 snprintf(buf, bufn, "aro=%s:N/A", p); \ in process_remote_cmd()
1049 if (!strcmp(p, "")) { /* skip-cmd-list */ in process_remote_cmd()
1054 if (strstr(p, "CR:") == p) { /* skip-cmd-list */ in process_remote_cmd()
1058 if (sscanf(p+3, "%dx%d+%d+%d,%d,%d", &w, &h, &x, &y, &dx, &dy) == 6) { in process_remote_cmd()
1067 rfbLog("remote_cmd: bad CR string: %s\n", p); in process_remote_cmd()
1071 if (!strcmp(p, "stop") || !strcmp(p, "quit") || in process_remote_cmd()
1072 !strcmp(p, "exit") || !strcmp(p, "shutdown")) { in process_remote_cmd()
1086 if (!strcmp(p, "ping") in process_remote_cmd()
1087 || strstr(p, "ping:") == p) { /* skip-cmd-list */ in process_remote_cmd()
1090 snprintf(buf, bufn, "ans=%s:%s", p, rfb_desktop_name); in process_remote_cmd()
1092 snprintf(buf, bufn, "ans=%s:%s", p, "unknown"); in process_remote_cmd()
1097 if (!strcmp(p, "resend_cutbuffer")) { in process_remote_cmd()
1102 if (!strcmp(p, "resend_clipboard")) { in process_remote_cmd()
1107 if (!strcmp(p, "resend_primary")) { in process_remote_cmd()
1112 if (!strcmp(p, "blacken") || !strcmp(p, "zero")) { in process_remote_cmd()
1117 if (!strcmp(p, "refresh")) { in process_remote_cmd()
1122 if (!strcmp(p, "reset")) { in process_remote_cmd()
1127 if (strstr(p, "zero:") == p) { /* skip-cmd-list */ in process_remote_cmd()
1130 p += strlen("zero:"); in process_remote_cmd()
1131 if (sscanf(p, "%d,%d,%d,%d", &x1, &y1, &x2, &y2) == 4) { in process_remote_cmd()
1133 rfbLog("zeroing rect: %s\n", p); in process_remote_cmd()
1148 if (strstr(p, "damagefb:") == p) { /* skip-cmd-list */ in process_remote_cmd()
1151 p += strlen("damagefb:"); in process_remote_cmd()
1152 if (sscanf(p, "%d", &delay) == 1) { in process_remote_cmd()
1160 if (strstr(p, "close") == p) { in process_remote_cmd()
1163 p += strlen("close:"); in process_remote_cmd()
1164 close_clients(p); in process_remote_cmd()
1167 if (strstr(p, "disconnect") == p) { in process_remote_cmd()
1170 p += strlen("disconnect:"); in process_remote_cmd()
1171 close_clients(p); in process_remote_cmd()
1174 if (strstr(p, "id_cmd") == p) { in process_remote_cmd()
1177 p += strlen("id_cmd:"); in process_remote_cmd()
1178 id_cmd(p); in process_remote_cmd()
1181 if (strstr(p, "id") == p) { in process_remote_cmd()
1186 snprintf(buf, bufn, "ans=%s%s0x%lx", p, co, in process_remote_cmd()
1190 p += strlen("id:"); in process_remote_cmd()
1191 if (*p == '\0' || !strcmp("root", p)) { /* skip-cmd-list */ in process_remote_cmd()
1195 } else if (!strcmp("pick", p)) { in process_remote_cmd()
1202 } else if (! scan_hexdec(p, &twin)) { in process_remote_cmd()
1204 " %s\n", p); in process_remote_cmd()
1223 if (strstr(p, "sid") == p) { in process_remote_cmd()
1228 snprintf(buf, bufn, "ans=%s%s0x%lx", p, co, in process_remote_cmd()
1232 p += strlen("sid:"); in process_remote_cmd()
1233 if (*p == '\0' || !strcmp("root", p)) { /* skip-cmd-list */ in process_remote_cmd()
1237 } else if (!strcmp("pick", p)) { in process_remote_cmd()
1244 } else if (! scan_hexdec(p, &twin)) { in process_remote_cmd()
1245 rfbLog("-sid: skipping incorrect hex/dec number: %s\n", p); in process_remote_cmd()
1264 if (strstr(p, "waitmapped") == p) { in process_remote_cmd()
1266 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
1273 if (strstr(p, "nowaitmapped") == p) { in process_remote_cmd()
1275 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
1282 if (!strcmp(p, "clip") || in process_remote_cmd()
1283 strstr(p, "clip:") == p) { /* skip-cmd-list */ in process_remote_cmd()
1286 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1290 p += strlen("clip:"); in process_remote_cmd()
1295 if (parse_geom(p, &w, &h, &x, &y, wdpy_x, wdpy_y)) { in process_remote_cmd()
1301 clip_str = strdup(p); in process_remote_cmd()
1308 clip_str = strdup(p); in process_remote_cmd()
1314 if (!strcmp(p, "flashcmap")) { in process_remote_cmd()
1316 snprintf(buf, bufn, "ans=%s:%d", p, flash_cmap); in process_remote_cmd()
1323 if (!strcmp(p, "noflashcmap")) { in process_remote_cmd()
1325 snprintf(buf, bufn, "ans=%s:%d", p, !flash_cmap); in process_remote_cmd()
1332 if (strstr(p, "shiftcmap") == p) { in process_remote_cmd()
1335 snprintf(buf, bufn, "ans=%s%s%d", p, co, shift_cmap); in process_remote_cmd()
1338 p += strlen("shiftcmap:"); in process_remote_cmd()
1339 shift_cmap = atoi(p); in process_remote_cmd()
1344 if (!strcmp(p, "truecolor")) { in process_remote_cmd()
1347 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
1358 if (!strcmp(p, "notruecolor")) { in process_remote_cmd()
1361 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
1372 if (!strcmp(p, "overlay")) { in process_remote_cmd()
1374 snprintf(buf, bufn, "ans=%s:%d", p, overlay); in process_remote_cmd()
1395 if (!strcmp(p, "nooverlay")) { in process_remote_cmd()
1398 snprintf(buf, bufn, "ans=%s:%d", p, !overlay); in process_remote_cmd()
1413 if (!strcmp(p, "overlay_cursor") || in process_remote_cmd()
1414 !strcmp(p, "overlay_yescursor") || in process_remote_cmd()
1415 !strcmp(p, "nooverlay_nocursor")) { in process_remote_cmd()
1417 snprintf(buf, bufn, "ans=%s:%d", p, overlay_cursor); in process_remote_cmd()
1433 if (!strcmp(p, "nooverlay_cursor") || in process_remote_cmd()
1434 !strcmp(p, "nooverlay_yescursor") || in process_remote_cmd()
1435 !strcmp(p, "overlay_nocursor")) { in process_remote_cmd()
1437 snprintf(buf, bufn, "ans=%s:%d", p, !overlay_cursor); in process_remote_cmd()
1452 if (!strcmp(p, "8to24")) { in process_remote_cmd()
1454 snprintf(buf, bufn, "ans=%s:%d", p, cmap8to24); in process_remote_cmd()
1470 if (!strcmp(p, "no8to24")) { in process_remote_cmd()
1472 snprintf(buf, bufn, "ans=%s:%d", p, !cmap8to24); in process_remote_cmd()
1480 if (strstr(p, "8to24_opts") == p) { in process_remote_cmd()
1483 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1487 p += strlen("8to24_opts:"); in process_remote_cmd()
1491 cmap8to24_str = strdup(p); in process_remote_cmd()
1492 if (*p == '\0') { in process_remote_cmd()
1501 if (!strcmp(p, "24to32")) { in process_remote_cmd()
1503 snprintf(buf, bufn, "ans=%s:%d", p, xform24to32); in process_remote_cmd()
1511 if (!strcmp(p, "no24to32")) { in process_remote_cmd()
1513 snprintf(buf, bufn, "ans=%s:%d", p, !xform24to32); in process_remote_cmd()
1531 if (strstr(p, "visual") == p) { in process_remote_cmd()
1534 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1538 p += strlen("visual:"); in process_remote_cmd()
1540 visual_str = strdup(p); in process_remote_cmd()
1546 if (!strcmp(p, "scale") || in process_remote_cmd()
1547 strstr(p, "scale:") == p) { /* skip-cmd-list */ in process_remote_cmd()
1550 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1554 p += strlen("scale:"); in process_remote_cmd()
1556 scale_str = strdup(p); in process_remote_cmd()
1563 if (!strcmp(p, "scale_cursor") || in process_remote_cmd()
1564 strstr(p, "scale_cursor:") == p) { /* skip-cmd-list */ in process_remote_cmd()
1567 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1571 p += strlen("scale_cursor:"); in process_remote_cmd()
1573 if (*p == '\0') { in process_remote_cmd()
1576 scale_cursor_str = strdup(p); in process_remote_cmd()
1581 if (!strcmp(p, "viewonly")) { in process_remote_cmd()
1583 snprintf(buf, bufn, "ans=%s:%d", p, view_only); in process_remote_cmd()
1590 if (!strcmp(p, "noviewonly")) { in process_remote_cmd()
1592 snprintf(buf, bufn, "ans=%s:%d", p, !view_only); in process_remote_cmd()
1600 if (!strcmp(p, "shared")) { in process_remote_cmd()
1602 snprintf(buf, bufn, "ans=%s:%d", p, shared); goto qry; in process_remote_cmd()
1613 if (!strcmp(p, "noshared")) { in process_remote_cmd()
1615 snprintf(buf, bufn, "ans=%s:%d", p, !shared); goto qry; in process_remote_cmd()
1626 if (!strcmp(p, "forever")) { in process_remote_cmd()
1628 snprintf(buf, bufn, "ans=%s:%d", p, 1-connect_once); in process_remote_cmd()
1635 if (!strcmp(p, "noforever") || !strcmp(p, "once")) { in process_remote_cmd()
1637 snprintf(buf, bufn, "ans=%s:%d", p, connect_once); in process_remote_cmd()
1644 if (strstr(p, "timeout") == p) { in process_remote_cmd()
1648 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
1652 p += strlen("timeout:"); in process_remote_cmd()
1653 to = atoi(p); in process_remote_cmd()
1661 if (!strcmp(p, "tightfilexfer")) { in process_remote_cmd()
1663 snprintf(buf, bufn, "ans=%s:%d", p, tightfilexfer); in process_remote_cmd()
1678 if (!strcmp(p, "notightfilexfer")) { in process_remote_cmd()
1680 snprintf(buf, bufn, "ans=%s:%d", p, !tightfilexfer); in process_remote_cmd()
1695 if (!strcmp(p, "ultrafilexfer")) { in process_remote_cmd()
1698 snprintf(buf, bufn, "ans=%s:%d", p, screen->permitFileTransfer == TRUE); in process_remote_cmd()
1700 snprintf(buf, bufn, "ans=%s:%d", p, 0); in process_remote_cmd()
1711 if (!strcmp(p, "noultrafilexfer")) { in process_remote_cmd()
1714 snprintf(buf, bufn, "ans=%s:%d", p, screen->permitFileTransfer == FALSE); in process_remote_cmd()
1716 snprintf(buf, bufn, "ans=%s:%d", p, 1); in process_remote_cmd()
1727 if (strstr(p, "rfbversion") == p) { in process_remote_cmd()
1732 …snprintf(buf, bufn, "ans=%s:%d.%d", p, screen->protocolMajorVersion, screen->protocolMinorVersion); in process_remote_cmd()
1734 snprintf(buf, bufn, "ans=%s:%d.%d", p, 3, 8); in process_remote_cmd()
1738 p += strlen("rfbversion:"); in process_remote_cmd()
1740 if (sscanf(p, "%d.%d", &maj, &min) == 2) { in process_remote_cmd()
1746 rfbLog("remote_cmd: invalid rfbversion: %s\n", p); in process_remote_cmd()
1750 if (!strcmp(p, "deny") || !strcmp(p, "lock")) { in process_remote_cmd()
1752 snprintf(buf, bufn, "ans=%s:%d", p, deny_all); in process_remote_cmd()
1759 if (!strcmp(p, "nodeny") || !strcmp(p, "unlock")) { in process_remote_cmd()
1761 snprintf(buf, bufn, "ans=%s:%d", p, !deny_all); in process_remote_cmd()
1768 if (!strcmp(p, "avahi") || !strcmp(p, "mdns") || !strcmp(p, "zeroconf")) { in process_remote_cmd()
1770 snprintf(buf, bufn, "ans=%s:%d", p, avahi); in process_remote_cmd()
1782 if (!strcmp(p, "noavahi") || !strcmp(p, "nomdns") || !strcmp(p, "nozeroconf")) { in process_remote_cmd()
1784 snprintf(buf, bufn, "ans=%s:%d", p, !avahi); in process_remote_cmd()
1794 if (strstr(p, "connect") == p) { in process_remote_cmd()
1797 p += strlen("connect:"); in process_remote_cmd()
1799 reverse_connect(p); in process_remote_cmd()
1802 if (strstr(p, "proxy") == p) { in process_remote_cmd()
1805 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1809 p += strlen("proxy:"); in process_remote_cmd()
1814 if (!strcmp(p, "") || !strcasecmp(p, "none")) { /* skip-cmd-list */ in process_remote_cmd()
1817 connect_proxy = strdup(p); in process_remote_cmd()
1822 if (strstr(p, "allowonce") == p) { in process_remote_cmd()
1825 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1829 p += strlen("allowonce:"); in process_remote_cmd()
1830 allow_once = strdup(p); in process_remote_cmd()
1834 if (strstr(p, "allow") == p) { in process_remote_cmd()
1838 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
1847 p += strlen("allow:"); in process_remote_cmd()
1860 if (*p == '+') { in process_remote_cmd()
1861 p++; in process_remote_cmd()
1862 allow_list = add_item(allow_list, p); in process_remote_cmd()
1863 } else if (*p == '-') { in process_remote_cmd()
1864 p++; in process_remote_cmd()
1865 allow_list = delete_item(allow_list, p); in process_remote_cmd()
1867 allow_list = strdup(p); in process_remote_cmd()
1879 if (!strcmp(p, "noipv6")) { in process_remote_cmd()
1881 snprintf(buf, bufn, "ans=%s:%d", p, noipv6); in process_remote_cmd()
1888 if (!strcmp(p, "ipv6")) { in process_remote_cmd()
1890 snprintf(buf, bufn, "ans=%s:%d", p, !noipv6); in process_remote_cmd()
1897 if (!strcmp(p, "noipv4")) { in process_remote_cmd()
1899 snprintf(buf, bufn, "ans=%s:%d", p, noipv4); in process_remote_cmd()
1906 if (!strcmp(p, "ipv4")) { in process_remote_cmd()
1908 snprintf(buf, bufn, "ans=%s:%d", p, !noipv4); in process_remote_cmd()
1915 if (!strcmp(p, "no6")) { in process_remote_cmd()
1917 snprintf(buf, bufn, "ans=%s:%d", p, !ipv6_listen); in process_remote_cmd()
1931 if (!strcmp(p, "6")) { in process_remote_cmd()
1933 snprintf(buf, bufn, "ans=%s:%d", p, ipv6_listen); in process_remote_cmd()
1947 if (!strcmp(p, "localhost")) { in process_remote_cmd()
1956 snprintf(buf, bufn, "ans=%s:%d", p, state); in process_remote_cmd()
1989 if (!strcmp(p, "nolocalhost")) { in process_remote_cmd()
1998 snprintf(buf, bufn, "ans=%s:%d", p, !state); in process_remote_cmd()
2035 if (strstr(p, "listen") == p) { in process_remote_cmd()
2041 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2054 p += strlen("listen:"); in process_remote_cmd()
2056 listen_str = strdup(p); in process_remote_cmd()
2130 if (!strcmp(p, "lookup")) { in process_remote_cmd()
2132 snprintf(buf, bufn, "ans=%s:%d", p, host_lookup); in process_remote_cmd()
2139 if (!strcmp(p, "nolookup")) { in process_remote_cmd()
2141 snprintf(buf, bufn, "ans=%s:%d", p, !host_lookup); in process_remote_cmd()
2148 if (strstr(p, "accept") == p) { in process_remote_cmd()
2152 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2156 p += strlen("accept:"); in process_remote_cmd()
2157 if (!strcmp(p, "") || strstr(p, "popup") == p) { /* skip-cmd-list */ in process_remote_cmd()
2161 rfbLog("unsafe: %s\n", p); in process_remote_cmd()
2167 accept_cmd = strdup(p); in process_remote_cmd()
2171 if (strstr(p, "afteraccept") == p) { in process_remote_cmd()
2175 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2179 p += strlen("afteraccept:"); in process_remote_cmd()
2180 if (!strcmp(p, "")) { /* skip-cmd-list */ in process_remote_cmd()
2184 rfbLog("unsafe: %s\n", p); in process_remote_cmd()
2187 afteraccept_cmd = strdup(p); in process_remote_cmd()
2191 if (strstr(p, "gone") == p) { in process_remote_cmd()
2195 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2199 p += strlen("gone:"); in process_remote_cmd()
2200 if (!strcmp(p, "") || strstr(p, "popup") == p) { /* skip-cmd-list */ in process_remote_cmd()
2204 rfbLog("unsafe: %s\n", p); in process_remote_cmd()
2207 gone_cmd = strdup(p); in process_remote_cmd()
2211 if (!strcmp(p, "shm")) { in process_remote_cmd()
2214 snprintf(buf, bufn, "ans=%s:%d", p, using_shm); in process_remote_cmd()
2228 if (!strcmp(p, "noshm")) { in process_remote_cmd()
2231 snprintf(buf, bufn, "ans=%s:%d", p, !using_shm); in process_remote_cmd()
2243 if (!strcmp(p, "flipbyteorder")) { in process_remote_cmd()
2246 snprintf(buf, bufn, "ans=%s:%d", p, flip_byte_order); in process_remote_cmd()
2260 if (!strcmp(p, "noflipbyteorder")) { in process_remote_cmd()
2263 snprintf(buf, bufn, "ans=%s:%d", p, !flip_byte_order); in process_remote_cmd()
2277 if (!strcmp(p, "onetile")) { in process_remote_cmd()
2279 snprintf(buf, bufn, "ans=%s:%d", p, single_copytile); in process_remote_cmd()
2286 if (!strcmp(p, "noonetile")) { in process_remote_cmd()
2288 snprintf(buf, bufn, "ans=%s:%d", p, !single_copytile); in process_remote_cmd()
2300 if (strstr(p, "solid_color") == p) { in process_remote_cmd()
2310 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2314 p += strlen("solid_color:"); in process_remote_cmd()
2315 if (*p != '\0') { in process_remote_cmd()
2316 newc = strdup(p); in process_remote_cmd()
2337 if (!strcmp(p, "solid")) { in process_remote_cmd()
2340 snprintf(buf, bufn, "ans=%s:%d", p, use_solid_bg); in process_remote_cmd()
2354 if (!strcmp(p, "nosolid")) { in process_remote_cmd()
2357 snprintf(buf, bufn, "ans=%s:%d", p, !use_solid_bg); in process_remote_cmd()
2367 if (strstr(p, "blackout") == p) { in process_remote_cmd()
2371 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2375 p += strlen("blackout:"); in process_remote_cmd()
2382 if (*p == '+') { in process_remote_cmd()
2383 p++; in process_remote_cmd()
2384 blackout_str = add_item(blackout_str, p); in process_remote_cmd()
2385 } else if (*p == '-') { in process_remote_cmd()
2386 p++; in process_remote_cmd()
2387 blackout_str = delete_item(blackout_str, p); in process_remote_cmd()
2389 blackout_str = strdup(p); in process_remote_cmd()
2407 if (!strcmp(p, "xinerama")) { in process_remote_cmd()
2409 snprintf(buf, bufn, "ans=%s:%d", p, xinerama); in process_remote_cmd()
2417 if (!strcmp(p, "noxinerama")) { in process_remote_cmd()
2419 snprintf(buf, bufn, "ans=%s:%d", p, !xinerama); in process_remote_cmd()
2427 if (!strcmp(p, "xtrap")) { in process_remote_cmd()
2429 snprintf(buf, bufn, "ans=%s:%d", p, xtrap_input); in process_remote_cmd()
2440 if (!strcmp(p, "noxtrap")) { in process_remote_cmd()
2442 snprintf(buf, bufn, "ans=%s:%d", p, !xtrap_input); in process_remote_cmd()
2453 if (!strcmp(p, "xrandr")) { in process_remote_cmd()
2456 snprintf(buf, bufn, "ans=%s:%d", p, xrandr); goto qry; in process_remote_cmd()
2473 if (!strcmp(p, "noxrandr")) { in process_remote_cmd()
2476 snprintf(buf, bufn, "ans=%s:%d", p, !xrandr); goto qry; in process_remote_cmd()
2490 if (strstr(p, "xrandr_mode") == p) { in process_remote_cmd()
2494 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2498 p += strlen("xrandr_mode:"); in process_remote_cmd()
2499 if (!strcmp("none", p)) { in process_remote_cmd()
2503 if (known_xrandr_mode(p)) { in process_remote_cmd()
2505 xrandr_mode = strdup(p); in process_remote_cmd()
2507 rfbLog("skipping unknown xrandr mode: %s\n", p); in process_remote_cmd()
2529 if (strstr(p, "rotate") == p) { in process_remote_cmd()
2532 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2536 p += strlen("rotate:"); in process_remote_cmd()
2538 rotating_str = strdup(p); in process_remote_cmd()
2544 if (strstr(p, "padgeom") == p) { in process_remote_cmd()
2547 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2551 p += strlen("padgeom:"); in process_remote_cmd()
2552 if (!strcmp("force", p) || !strcmp("do",p) || !strcmp("go",p)) { in process_remote_cmd()
2557 pad_geometry = strdup(p); in process_remote_cmd()
2563 if (!strcmp(p, "quiet") || !strcmp(p, "q")) { in process_remote_cmd()
2565 snprintf(buf, bufn, "ans=%s:%d", p, quiet); goto qry; in process_remote_cmd()
2571 if (!strcmp(p, "noquiet")) { in process_remote_cmd()
2573 snprintf(buf, bufn, "ans=%s:%d", p, !quiet); goto qry; in process_remote_cmd()
2579 if (!strcmp(p, "modtweak")) { in process_remote_cmd()
2581 snprintf(buf, bufn, "ans=%s:%d", p, use_modifier_tweak); in process_remote_cmd()
2592 if (!strcmp(p, "nomodtweak")) { in process_remote_cmd()
2594 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
2603 if (!strcmp(p, "xkb")) { in process_remote_cmd()
2605 snprintf(buf, bufn, "ans=%s:%d", p, use_xkb_modtweak); in process_remote_cmd()
2624 if (!strcmp(p, "noxkb")) { in process_remote_cmd()
2626 snprintf(buf, bufn, "ans=%s:%d", p, !use_xkb_modtweak); in process_remote_cmd()
2640 if (!strcmp(p, "capslock")) { in process_remote_cmd()
2642 snprintf(buf, bufn, "ans=%s:%d", p, watch_capslock); in process_remote_cmd()
2649 if (!strcmp(p, "nocapslock")) { in process_remote_cmd()
2651 snprintf(buf, bufn, "ans=%s:%d", p, !watch_capslock); in process_remote_cmd()
2658 if (!strcmp(p, "skip_lockkeys")) { in process_remote_cmd()
2660 snprintf(buf, bufn, "ans=%s:%d", p, skip_lockkeys); in process_remote_cmd()
2667 if (!strcmp(p, "noskip_lockkeys")) { in process_remote_cmd()
2669 snprintf(buf, bufn, "ans=%s:%d", p, !skip_lockkeys); in process_remote_cmd()
2676 if (strstr(p, "skip_keycodes") == p) { in process_remote_cmd()
2679 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2683 p += strlen("skip_keycodes:"); in process_remote_cmd()
2685 " to:\n\t'%s'\n", p); in process_remote_cmd()
2697 skip_keycodes = strdup(p); in process_remote_cmd()
2701 if (!strcmp(p, "sloppy_keys")) { in process_remote_cmd()
2703 snprintf(buf, bufn, "ans=%s:%d", p, sloppy_keys); in process_remote_cmd()
2710 if (!strcmp(p, "nosloppy_keys")) { in process_remote_cmd()
2712 snprintf(buf, bufn, "ans=%s:%d", p, !sloppy_keys); in process_remote_cmd()
2719 if (!strcmp(p, "skip_dups")) { in process_remote_cmd()
2721 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
2729 if (!strcmp(p, "noskip_dups")) { in process_remote_cmd()
2731 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
2739 if (!strcmp(p, "add_keysyms")) { in process_remote_cmd()
2741 snprintf(buf, bufn, "ans=%s:%d", p, add_keysyms); in process_remote_cmd()
2748 if (!strcmp(p, "noadd_keysyms")) { in process_remote_cmd()
2750 snprintf(buf, bufn, "ans=%s:%d", p, !add_keysyms); in process_remote_cmd()
2757 if (!strcmp(p, "clear_mods")) { in process_remote_cmd()
2759 snprintf(buf, bufn, "ans=%s:%d", p, clear_mods == 1); in process_remote_cmd()
2769 if (!strcmp(p, "noclear_mods")) { in process_remote_cmd()
2771 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
2779 if (!strcmp(p, "clear_keys")) { in process_remote_cmd()
2781 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
2792 if (!strcmp(p, "noclear_keys")) { in process_remote_cmd()
2794 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
2802 if (!strcmp(p, "clear_all")) { in process_remote_cmd()
2804 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
2816 if (!strcmp(p, "clear_locks")) { in process_remote_cmd()
2824 if (!strcmp(p, "keystate")) { in process_remote_cmd()
2838 if (strstr(p, "remap") == p) { in process_remote_cmd()
2842 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
2846 p += strlen("remap:"); in process_remote_cmd()
2847 if ((*p == '+' || *p == '-') && remap_file && in process_remote_cmd()
2859 if (*p == '+') { in process_remote_cmd()
2860 p++; in process_remote_cmd()
2861 remap_file = add_item(remap_file, p); in process_remote_cmd()
2862 } else if (*p == '-') { in process_remote_cmd()
2863 p++; in process_remote_cmd()
2864 remap_file = delete_item(remap_file, p); in process_remote_cmd()
2869 remap_file = strdup(p); in process_remote_cmd()
2881 if (!strcmp(p, "repeat")) { in process_remote_cmd()
2883 snprintf(buf, bufn, "ans=%s:%d", p, !no_autorepeat); in process_remote_cmd()
2891 if (!strcmp(p, "norepeat")) { in process_remote_cmd()
2893 snprintf(buf, bufn, "ans=%s:%d", p, no_autorepeat); in process_remote_cmd()
2906 if (!strcmp(p, "fb")) { in process_remote_cmd()
2908 snprintf(buf, bufn, "ans=%s:%d", p, !nofb); in process_remote_cmd()
2923 if (!strcmp(p, "nofb")) { in process_remote_cmd()
2925 snprintf(buf, bufn, "ans=%s:%d", p, nofb); in process_remote_cmd()
2941 if (!strcmp(p, "bell")) { in process_remote_cmd()
2943 snprintf(buf, bufn, "ans=%s:%d", p, sound_bell); in process_remote_cmd()
2951 if (!strcmp(p, "nobell")) { in process_remote_cmd()
2953 snprintf(buf, bufn, "ans=%s:%d", p, !sound_bell); in process_remote_cmd()
2961 if (!strcmp(p, "sendbell")) { in process_remote_cmd()
2969 if (!strcmp(p, "sel")) { in process_remote_cmd()
2971 snprintf(buf, bufn, "ans=%s:%d", p, watch_selection); in process_remote_cmd()
2980 if (!strcmp(p, "nosel")) { in process_remote_cmd()
2982 snprintf(buf, bufn, "ans=%s:%d", p, !watch_selection); in process_remote_cmd()
2991 if (!strcmp(p, "primary")) { in process_remote_cmd()
2993 snprintf(buf, bufn, "ans=%s:%d", p, watch_primary); in process_remote_cmd()
3000 if (!strcmp(p, "noprimary")) { in process_remote_cmd()
3002 snprintf(buf, bufn, "ans=%s:%d", p, !watch_primary); in process_remote_cmd()
3009 if (!strcmp(p, "setprimary")) { in process_remote_cmd()
3011 snprintf(buf, bufn, "ans=%s:%d", p, set_primary); in process_remote_cmd()
3018 if (!strcmp(p, "nosetprimary")) { in process_remote_cmd()
3020 snprintf(buf, bufn, "ans=%s:%d", p, !set_primary); in process_remote_cmd()
3027 if (!strcmp(p, "clipboard")) { in process_remote_cmd()
3029 snprintf(buf, bufn, "ans=%s:%d", p, watch_clipboard); in process_remote_cmd()
3036 if (!strcmp(p, "noclipboard")) { in process_remote_cmd()
3038 snprintf(buf, bufn, "ans=%s:%d", p, !watch_clipboard); in process_remote_cmd()
3045 if (!strcmp(p, "setclipboard")) { in process_remote_cmd()
3047 snprintf(buf, bufn, "ans=%s:%d", p, set_clipboard); in process_remote_cmd()
3054 if (!strcmp(p, "nosetclipboard")) { in process_remote_cmd()
3056 snprintf(buf, bufn, "ans=%s:%d", p, !set_clipboard); in process_remote_cmd()
3063 if (strstr(p, "seldir") == p) { in process_remote_cmd()
3066 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3070 p += strlen("seldir:"); in process_remote_cmd()
3071 rfbLog("remote_cmd: setting -seldir to %s\n", p); in process_remote_cmd()
3073 sel_direction = strdup(p); in process_remote_cmd()
3076 if (!strcmp(p, "set_no_cursor")) { /* skip-cmd-list */ in process_remote_cmd()
3081 if (!strcmp(p, "cursorshape")) { in process_remote_cmd()
3083 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
3095 if (!strcmp(p, "nocursorshape")) { in process_remote_cmd()
3098 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
3114 if (!strcmp(p, "cursorpos")) { in process_remote_cmd()
3116 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
3124 if (!strcmp(p, "nocursorpos")) { in process_remote_cmd()
3126 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
3134 if (!strcmp(p, "cursor_drag")) { in process_remote_cmd()
3136 snprintf(buf, bufn, "ans=%s:%d", p, cursor_drag_changes); in process_remote_cmd()
3143 if (!strcmp(p, "nocursor_drag")) { in process_remote_cmd()
3145 snprintf(buf, bufn, "ans=%s:%d", p, !cursor_drag_changes); in process_remote_cmd()
3152 if (strstr(p, "cursor") == p) { in process_remote_cmd()
3155 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3159 p += strlen("cursor:"); in process_remote_cmd()
3165 multiple_cursors_mode = strdup(p); in process_remote_cmd()
3179 if (!strcmp(p, "show_cursor")) { in process_remote_cmd()
3181 snprintf(buf, bufn, "ans=%s:%d", p, show_cursor); in process_remote_cmd()
3202 if (!strcmp(p, "noshow_cursor") || !strcmp(p, "nocursor")) { in process_remote_cmd()
3204 snprintf(buf, bufn, "ans=%s:%d", p, !show_cursor); in process_remote_cmd()
3216 if (strstr(p, "arrow") == p) { in process_remote_cmd()
3219 snprintf(buf, bufn, "ans=%s%s%d", p, co, alt_arrow); in process_remote_cmd()
3222 p += strlen("arrow:"); in process_remote_cmd()
3223 alt_arrow = atoi(p); in process_remote_cmd()
3228 if (!strcmp(p, "xfixes")) { in process_remote_cmd()
3230 snprintf(buf, bufn, "ans=%s:%d", p, use_xfixes); in process_remote_cmd()
3245 if (!strcmp(p, "noxfixes")) { in process_remote_cmd()
3247 snprintf(buf, bufn, "ans=%s:%d", p, !use_xfixes); in process_remote_cmd()
3261 if (!strcmp(p, "xdamage")) { in process_remote_cmd()
3264 snprintf(buf, bufn, "ans=%s:%d", p, use_xdamage); in process_remote_cmd()
3281 if (!strcmp(p, "noxdamage")) { in process_remote_cmd()
3284 snprintf(buf, bufn, "ans=%s:%d", p, !use_xdamage); in process_remote_cmd()
3300 if (strstr(p, "xd_area") == p) { in process_remote_cmd()
3304 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
3308 p += strlen("xd_area:"); in process_remote_cmd()
3309 a = atoi(p); in process_remote_cmd()
3317 if (strstr(p, "xd_mem") == p) { in process_remote_cmd()
3321 snprintf(buf, bufn, "ans=%s%s%.3f", p, co, in process_remote_cmd()
3325 p += strlen("xd_mem:"); in process_remote_cmd()
3326 a = atof(p); in process_remote_cmd()
3334 if (strstr(p, "alphacut") == p) { in process_remote_cmd()
3338 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
3342 p += strlen("alphacut:"); in process_remote_cmd()
3343 a = atoi(p); in process_remote_cmd()
3358 if (strstr(p, "alphafrac") == p) { in process_remote_cmd()
3362 snprintf(buf, bufn, "ans=%s%s%f", p, co, in process_remote_cmd()
3366 p += strlen("alphafrac:"); in process_remote_cmd()
3367 a = atof(p); in process_remote_cmd()
3378 if (strstr(p, "alpharemove") == p) { in process_remote_cmd()
3380 snprintf(buf, bufn, "ans=%s:%d", p, alpha_remove); in process_remote_cmd()
3390 if (strstr(p, "noalpharemove") == p) { in process_remote_cmd()
3392 snprintf(buf, bufn, "ans=%s:%d", p, !alpha_remove); in process_remote_cmd()
3402 if (strstr(p, "alphablend") == p) { in process_remote_cmd()
3404 snprintf(buf, bufn, "ans=%s:%d", p, alpha_blend); in process_remote_cmd()
3415 if (strstr(p, "noalphablend") == p) { in process_remote_cmd()
3417 snprintf(buf, bufn, "ans=%s:%d", p, !alpha_blend); in process_remote_cmd()
3427 if (strstr(p, "xwarppointer") == p || strstr(p, "xwarp") == p) { in process_remote_cmd()
3429 snprintf(buf, bufn, "ans=%s:%d", p, use_xwarppointer); in process_remote_cmd()
3436 if (strstr(p, "noxwarppointer") == p || in process_remote_cmd()
3437 strstr(p, "noxwarp") == p) { in process_remote_cmd()
3439 snprintf(buf, bufn, "ans=%s:%d", p, !use_xwarppointer); in process_remote_cmd()
3446 if (strstr(p, "always_inject") == p) { in process_remote_cmd()
3448 snprintf(buf, bufn, "ans=%s:%d", p, always_inject); in process_remote_cmd()
3455 if (strstr(p, "noalways_inject") == p) { in process_remote_cmd()
3457 snprintf(buf, bufn, "ans=%s:%d", p, !always_inject); in process_remote_cmd()
3464 if (strstr(p, "buttonmap") == p) { in process_remote_cmd()
3467 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3471 p += strlen("buttonmap:"); in process_remote_cmd()
3473 pointer_remap = strdup(p); in process_remote_cmd()
3475 rfbLog("remote_cmd: setting -buttonmap to:\n\t'%s'\n", p); in process_remote_cmd()
3476 initialize_pointer_map(p); in process_remote_cmd()
3479 if (!strcmp(p, "dragging")) { in process_remote_cmd()
3481 snprintf(buf, bufn, "ans=%s:%d", p, show_dragging); in process_remote_cmd()
3488 if (!strcmp(p, "nodragging")) { in process_remote_cmd()
3490 snprintf(buf, bufn, "ans=%s:%d", p, !show_dragging); in process_remote_cmd()
3498 if (!strcmp(p, "ncache_cr")) { in process_remote_cmd()
3500 snprintf(buf, bufn, "ans=%s:%d", p, ncache_copyrect); in process_remote_cmd()
3507 if (!strcmp(p, "noncache_cr")) { in process_remote_cmd()
3509 snprintf(buf, bufn, "ans=%s:%d", p, !ncache_copyrect); in process_remote_cmd()
3517 if (!strcmp(p, "ncache_no_moveraise")) { in process_remote_cmd()
3519 snprintf(buf, bufn, "ans=%s:%d", p, !ncache_wf_raises); in process_remote_cmd()
3526 if (!strcmp(p, "noncache_no_moveraise")) { in process_remote_cmd()
3528 snprintf(buf, bufn, "ans=%s:%d", p, ncache_wf_raises); in process_remote_cmd()
3535 if (!strcmp(p, "ncache_no_dtchange")) { in process_remote_cmd()
3537 snprintf(buf, bufn, "ans=%s:%d", p, !ncache_dt_change); in process_remote_cmd()
3544 if (!strcmp(p, "noncache_no_dtchange")) { in process_remote_cmd()
3546 snprintf(buf, bufn, "ans=%s:%d", p, ncache_dt_change); in process_remote_cmd()
3553 if (!strcmp(p, "ncache_no_rootpixmap")) { in process_remote_cmd()
3556 snprintf(buf, bufn, "ans=%s:%d", p, !ncache_xrootpmap); in process_remote_cmd()
3566 if (!strcmp(p, "noncache_no_rootpixmap")) { in process_remote_cmd()
3569 snprintf(buf, bufn, "ans=%s:%d", p, ncache_xrootpmap); in process_remote_cmd()
3579 if (!strcmp(p, "ncache_reset_rootpixmap") || !strcmp(p, "ncrp")) { in process_remote_cmd()
3581 snprintf(buf, bufn, "ans=%s:%d", p, !ncache_xrootpmap); in process_remote_cmd()
3590 if (!strcmp(p, "ncache_keep_anims")) { in process_remote_cmd()
3592 snprintf(buf, bufn, "ans=%s:%d", p, ncache_keep_anims); in process_remote_cmd()
3600 if (!strcmp(p, "noncache_keep_anims")) { in process_remote_cmd()
3602 snprintf(buf, bufn, "ans=%s:%d", p, !ncache_keep_anims); in process_remote_cmd()
3610 if (!strcmp(p, "ncache_old_wm")) { in process_remote_cmd()
3612 snprintf(buf, bufn, "ans=%s:%d", p, ncache_old_wm); in process_remote_cmd()
3619 if (!strcmp(p, "noncache_old_wm")) { in process_remote_cmd()
3621 snprintf(buf, bufn, "ans=%s:%d", p, !ncache_old_wm); in process_remote_cmd()
3628 if (strstr(p, "ncache_pad") == p) { in process_remote_cmd()
3632 snprintf(buf, bufn, "ans=%s%s%d", p, co, ncache_pad); in process_remote_cmd()
3635 p += strlen("ncache_pad:"); in process_remote_cmd()
3636 n = atoi(p); in process_remote_cmd()
3641 if (!strcmp(p, "ncache")) { in process_remote_cmd()
3643 snprintf(buf, bufn, "ans=%s:%d", p, !!ncache); in process_remote_cmd()
3650 if (!strcmp(p, "noncache")) { in process_remote_cmd()
3652 snprintf(buf, bufn, "ans=%s:%d", p, !ncache); in process_remote_cmd()
3659 if (strstr(p, "ncache_size") == p) { in process_remote_cmd()
3663 snprintf(buf, bufn, "ans=%s%s%d", p, co, ncache); in process_remote_cmd()
3666 p += strlen("ncache_size:"); in process_remote_cmd()
3667 n = atoi(p); in process_remote_cmd()
3679 if (!strcmp(p, "debug_ncache")) { in process_remote_cmd()
3681 snprintf(buf, bufn, "ans=%s:%d", p, ncdb); in process_remote_cmd()
3688 if (!strcmp(p, "nodebug_ncache")) { in process_remote_cmd()
3690 snprintf(buf, bufn, "ans=%s:%d", p, !ncdb); in process_remote_cmd()
3698 if (strstr(p, "wireframe_mode") == p) { in process_remote_cmd()
3701 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3705 p += strlen("wireframe_mode:"); in process_remote_cmd()
3706 if (*p) { in process_remote_cmd()
3710 wireframe_str = strdup(p); in process_remote_cmd()
3717 if (strstr(p, "wireframe:") == p) { /* skip-cmd-list */ in process_remote_cmd()
3720 snprintf(buf, bufn, "ans=%s%s%d", p, co, wireframe); in process_remote_cmd()
3723 p += strlen("wireframe:"); in process_remote_cmd()
3724 if (*p) { in process_remote_cmd()
3728 wireframe_str = strdup(p); in process_remote_cmd()
3735 if (strstr(p, "wf:") == p) { /* skip-cmd-list */ in process_remote_cmd()
3738 snprintf(buf, bufn, "ans=%s%s%d", p, co, wireframe); in process_remote_cmd()
3741 p += strlen("wf:"); in process_remote_cmd()
3742 if (*p) { in process_remote_cmd()
3746 wireframe_str = strdup(p); in process_remote_cmd()
3753 if (!strcmp(p, "wireframe") || !strcmp(p, "wf")) { in process_remote_cmd()
3755 snprintf(buf, bufn, "ans=%s:%d", p, wireframe); in process_remote_cmd()
3762 if (!strcmp(p, "nowireframe") || !strcmp(p, "nowf")) { in process_remote_cmd()
3764 snprintf(buf, bufn, "ans=%s:%d", p, !wireframe); in process_remote_cmd()
3771 if (!strcmp(p, "wireframelocal") || !strcmp(p, "wfl")) { in process_remote_cmd()
3773 snprintf(buf, bufn, "ans=%s:%d", p, wireframe_local); in process_remote_cmd()
3780 if (!strcmp(p, "nowireframelocal") || !strcmp(p, "nowfl")) { in process_remote_cmd()
3782 snprintf(buf, bufn, "ans=%s:%d", p, !wireframe_local); in process_remote_cmd()
3789 if (strstr(p, "wirecopyrect") == p) { in process_remote_cmd()
3792 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3796 p += strlen("wirecopyrect:"); in process_remote_cmd()
3798 set_wirecopyrect_mode(p); in process_remote_cmd()
3804 if (strstr(p, "wcr") == p) { in process_remote_cmd()
3807 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3811 p += strlen("wcr:"); in process_remote_cmd()
3813 set_wirecopyrect_mode(p); in process_remote_cmd()
3819 if (!strcmp(p, "nowirecopyrect") || !strcmp(p, "nowcr")) { in process_remote_cmd()
3821 snprintf(buf, bufn, "ans=%s:%s", p, in process_remote_cmd()
3831 if (strstr(p, "scr_area") == p) { in process_remote_cmd()
3834 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
3838 p += strlen("scr_area:"); in process_remote_cmd()
3840 scrollcopyrect_min_area = atoi(p); in process_remote_cmd()
3845 if (strstr(p, "scr_skip") == p) { in process_remote_cmd()
3850 snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s)); in process_remote_cmd()
3853 p += strlen("scr_skip:"); in process_remote_cmd()
3858 scroll_skip_str = strdup(p); in process_remote_cmd()
3864 if (strstr(p, "scr_inc") == p) { in process_remote_cmd()
3869 snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s)); in process_remote_cmd()
3872 p += strlen("scr_inc:"); in process_remote_cmd()
3877 scroll_good_str = strdup(p); in process_remote_cmd()
3883 if (strstr(p, "scr_keys") == p) { in process_remote_cmd()
3886 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3890 p += strlen("scr_keys:"); in process_remote_cmd()
3895 scroll_key_list_str = strdup(p); in process_remote_cmd()
3901 if (strstr(p, "scr_term") == p) { in process_remote_cmd()
3906 snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s)); in process_remote_cmd()
3909 p += strlen("scr_term:"); in process_remote_cmd()
3914 scroll_term_str = strdup(p); in process_remote_cmd()
3920 if (strstr(p, "scr_keyrepeat") == p) { in process_remote_cmd()
3925 snprintf(buf, bufn, "ans=%s%s%s", p, co, NONUL(s)); in process_remote_cmd()
3928 p += strlen("scr_keyrepeat:"); in process_remote_cmd()
3933 max_keyrepeat_str = strdup(p); in process_remote_cmd()
3939 if (strstr(p, "scr_parms") == p) { in process_remote_cmd()
3942 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3947 p += strlen("scr_parms:"); in process_remote_cmd()
3948 if (*p) { in process_remote_cmd()
3953 scroll_copyrect_str = strdup(p); in process_remote_cmd()
3961 if (strstr(p, "scrollcopyrect") == p) { in process_remote_cmd()
3964 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3968 p += strlen("scrollcopyrect:"); in process_remote_cmd()
3970 set_scrollcopyrect_mode(p); in process_remote_cmd()
3976 if (!strcmp(p, "scr") || in process_remote_cmd()
3977 strstr(p, "scr:") == p) { /* skip-cmd-list */ in process_remote_cmd()
3980 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
3984 p += strlen("scr:"); in process_remote_cmd()
3986 set_scrollcopyrect_mode(p); in process_remote_cmd()
3992 if (!strcmp(p, "noscrollcopyrect") || !strcmp(p, "noscr")) { in process_remote_cmd()
3994 snprintf(buf, bufn, "ans=%s:%s", p, in process_remote_cmd()
4004 if (strstr(p, "fixscreen") == p) { in process_remote_cmd()
4007 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
4011 p += strlen("fixscreen:"); in process_remote_cmd()
4015 screen_fixup_str = strdup(p); in process_remote_cmd()
4021 if (!strcmp(p, "noxrecord")) { in process_remote_cmd()
4024 snprintf(buf, bufn, "ans=%s:%d", p, noxrecord); in process_remote_cmd()
4034 if (!strcmp(p, "xrecord")) { in process_remote_cmd()
4037 snprintf(buf, bufn, "ans=%s:%d", p, !noxrecord); in process_remote_cmd()
4047 if (!strcmp(p, "reset_record")) { in process_remote_cmd()
4057 if (strstr(p, "pointer_mode") == p) { in process_remote_cmd()
4061 snprintf(buf, bufn, "ans=%s%s%d", p, co, pointer_mode); in process_remote_cmd()
4064 p += strlen("pointer_mode:"); in process_remote_cmd()
4065 pm = atoi(p); in process_remote_cmd()
4075 if (strstr(p, "pm") == p) { in process_remote_cmd()
4079 snprintf(buf, bufn, "ans=%s%s%d", p, co, pointer_mode); in process_remote_cmd()
4082 p += strlen("pm:"); in process_remote_cmd()
4083 pm = atoi(p); in process_remote_cmd()
4093 if (strstr(p, "input_skip") == p) { in process_remote_cmd()
4097 snprintf(buf, bufn, "ans=%s%s%d", p, co, ui_skip); in process_remote_cmd()
4100 p += strlen("input_skip:"); in process_remote_cmd()
4101 is = atoi(p); in process_remote_cmd()
4106 if (!strcmp(p, "allinput")) { in process_remote_cmd()
4108 snprintf(buf, bufn, "ans=%s:%d", p, all_input); in process_remote_cmd()
4119 if (!strcmp(p, "noallinput")) { in process_remote_cmd()
4121 snprintf(buf, bufn, "ans=%s:%d", p, !all_input); in process_remote_cmd()
4128 if (!strcmp(p, "input_eagerly")) { in process_remote_cmd()
4130 snprintf(buf, bufn, "ans=%s:%d", p, handle_events_eagerly); in process_remote_cmd()
4141 if (!strcmp(p, "noinput_eagerly")) { in process_remote_cmd()
4143 snprintf(buf, bufn, "ans=%s:%d", p, !handle_events_eagerly); in process_remote_cmd()
4150 if (strstr(p, "input") == p) { in process_remote_cmd()
4154 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
4158 p += strlen("input:"); in process_remote_cmd()
4159 if (allowed_input_str && !strcmp(p, allowed_input_str)) { /* skip-cmd-list */ in process_remote_cmd()
4162 rfbLog("remote_cmd: setting input %s\n", p); in process_remote_cmd()
4164 if (*p == '\0') { in process_remote_cmd()
4167 allowed_input_str = strdup(p); in process_remote_cmd()
4174 if (!strcmp(p, "grabkbd")) { in process_remote_cmd()
4176 snprintf(buf, bufn, "ans=%s:%d", p, grab_kbd); in process_remote_cmd()
4186 if (!strcmp(p, "nograbkbd")) { in process_remote_cmd()
4189 snprintf(buf, bufn, "ans=%s:%d", p, !grab_kbd); in process_remote_cmd()
4204 if (!strcmp(p, "grabptr")) { in process_remote_cmd()
4206 snprintf(buf, bufn, "ans=%s:%d", p, grab_ptr); in process_remote_cmd()
4216 if (!strcmp(p, "ungrabboth")) { in process_remote_cmd()
4218 snprintf(buf, bufn, "ans=%s:%d", p, ungrab_both); in process_remote_cmd()
4225 if (!strcmp(p, "noungrabboth")) { in process_remote_cmd()
4227 snprintf(buf, bufn, "ans=%s:%d", p, !ungrab_both); in process_remote_cmd()
4234 if (!strcmp(p, "nograbptr")) { in process_remote_cmd()
4237 snprintf(buf, bufn, "ans=%s:%d", p, !grab_ptr); in process_remote_cmd()
4251 if (!strcmp(p, "grabalways")) { in process_remote_cmd()
4253 snprintf(buf, bufn, "ans=%s:%d", p, grab_always); in process_remote_cmd()
4263 if (!strcmp(p, "nograbalways")) { in process_remote_cmd()
4266 snprintf(buf, bufn, "ans=%s:%d", p, !grab_always); in process_remote_cmd()
4284 if (strstr(p, "grablocal") == p) { in process_remote_cmd()
4287 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
4291 p += strlen("grablocal:"); in process_remote_cmd()
4293 grab_local = atoi(p); in process_remote_cmd()
4298 if (strstr(p, "client_input") == p) { in process_remote_cmd()
4301 p += strlen("client_input:"); in process_remote_cmd()
4302 set_client_input(p); in process_remote_cmd()
4305 if (strstr(p, "ssltimeout") == p) { in process_remote_cmd()
4309 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
4313 p += strlen("ssltimeout:"); in process_remote_cmd()
4314 is = atoi(p); in process_remote_cmd()
4319 if (strstr(p, "speeds") == p) { in process_remote_cmd()
4322 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
4326 p += strlen("speeds:"); in process_remote_cmd()
4328 speeds_str = strdup(p); in process_remote_cmd()
4330 rfbLog("remote_cmd: setting -speeds to:\n\t'%s'\n", p); in process_remote_cmd()
4334 if (strstr(p, "wmdt") == p) { in process_remote_cmd()
4337 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
4341 p += strlen("wmdt:"); in process_remote_cmd()
4343 wmdt_str = strdup(p); in process_remote_cmd()
4345 rfbLog("remote_cmd: setting -wmdt to: %s\n", p); in process_remote_cmd()
4348 if (!strcmp(p, "debug_pointer") || !strcmp(p, "dp")) { in process_remote_cmd()
4350 snprintf(buf, bufn, "ans=%s:%d", p, debug_pointer); in process_remote_cmd()
4357 if (!strcmp(p, "nodebug_pointer") || !strcmp(p, "nodp")) { in process_remote_cmd()
4359 snprintf(buf, bufn, "ans=%s:%d", p, !debug_pointer); in process_remote_cmd()
4366 if (!strcmp(p, "debug_keyboard") || !strcmp(p, "dk")) { in process_remote_cmd()
4368 snprintf(buf, bufn, "ans=%s:%d", p, debug_keyboard); in process_remote_cmd()
4375 if (!strcmp(p, "nodebug_keyboard") || !strcmp(p, "nodk")) { in process_remote_cmd()
4377 snprintf(buf, bufn, "ans=%s:%d", p, !debug_keyboard); in process_remote_cmd()
4384 if (strstr(p, "keycode") == p) { in process_remote_cmd()
4389 p += strlen("keycode:"); in process_remote_cmd()
4390 kc = atoi(p); in process_remote_cmd()
4393 c = strchr(p, ','); in process_remote_cmd()
4421 if (strstr(p, "keysym") == p) { in process_remote_cmd()
4428 p += strlen("keysym:"); in process_remote_cmd()
4430 c = strchr(p, ','); in process_remote_cmd()
4436 if (sscanf(p, "0x%x", &in) == 1) { in process_remote_cmd()
4438 } else if (sscanf(p, "%u", &in) == 1) { in process_remote_cmd()
4440 } else if ((ks = XStringToKeysym(p)) != NoSymbol) { in process_remote_cmd()
4443 rfbLog("remote_cmd: bad keysym: %s\n", p); in process_remote_cmd()
4448 rfbLog("remote_cmd: insert keysym %s 0x%x '%s' down=%d\n", p, ks, str, down); in process_remote_cmd()
4458 if (strstr(p, "ptr") == p) { in process_remote_cmd()
4462 p += strlen("ptr:"); in process_remote_cmd()
4463 rfbLog("remote_cmd: insert pointer event: %s\n", p); in process_remote_cmd()
4464 if (sscanf(p, "%d,%d,%d", &x, &y, &m) == 3) { in process_remote_cmd()
4466 } else if (sscanf(p, "%d,%d", &x, &y) == 2) { in process_remote_cmd()
4474 if (strstr(p, "fakebuttonevent") == p) { in process_remote_cmd()
4478 p += strlen("fakebuttonevent:"); in process_remote_cmd()
4479 rfbLog("remote_cmd: insert fakebuttonevent: %s\n", p); in process_remote_cmd()
4480 if (sscanf(p, "%d,%d", &mb, &down) == 2) { in process_remote_cmd()
4490 if (strstr(p, "sleep") == p) { in process_remote_cmd()
4493 p += strlen("sleep:"); in process_remote_cmd()
4494 rfbLog("remote_cmd: sleeping: %s\n", p); in process_remote_cmd()
4495 usleep((int) (1.0e+6 * atof(p))); in process_remote_cmd()
4499 if (strstr(p, "get_xprop") == p) { in process_remote_cmd()
4506 if (strstr(p, "get_xprop:") != p) { /* skip-cmd-list */ in process_remote_cmd()
4507 snprintf(buf, bufn, "ans=%s:N/A", p); in process_remote_cmd()
4510 p += strlen("get_xprop:"); in process_remote_cmd()
4512 if (strstr(p, "id=") == p) { /* skip-cmd-list */ in process_remote_cmd()
4513 p += strlen("id="); in process_remote_cmd()
4514 if (scan_hexdec(p, &id)) { in process_remote_cmd()
4517 if (strchr(p, ':')) { in process_remote_cmd()
4518 p = strchr(p, ':') + 1; in process_remote_cmd()
4522 res = get_xprop(p, win); in process_remote_cmd()
4526 snprintf(buf, bufn, "ans=get_xprop:%s:%s", p, res); in process_remote_cmd()
4531 if (strstr(p, "set_xprop") == p) { in process_remote_cmd()
4539 if (strstr(p, "set_xprop:") != p) { /* skip-cmd-list */ in process_remote_cmd()
4540 snprintf(buf, bufn, "ans=%s:N/A", p); in process_remote_cmd()
4543 p += strlen("set_xprop:"); in process_remote_cmd()
4545 if (strstr(p, "id=") == p) { /* skip-cmd-list */ in process_remote_cmd()
4546 p += strlen("id="); in process_remote_cmd()
4547 if (scan_hexdec(p, &id)) { in process_remote_cmd()
4550 if (strchr(p, ':')) { in process_remote_cmd()
4551 p = strchr(p, ':') + 1; in process_remote_cmd()
4555 q = strchr(p, ':'); in process_remote_cmd()
4558 rc = set_xprop(p, win, q+1); in process_remote_cmd()
4561 snprintf(buf, bufn, "ans=set_xprop:%s:%d", p, rc); in process_remote_cmd()
4565 if (strstr(p, "wininfo") == p) { in process_remote_cmd()
4573 if (strstr(p, "wininfo:") != p) { /* skip-cmd-list */ in process_remote_cmd()
4574 snprintf(buf, bufn, "ans=%s:N/A", p); in process_remote_cmd()
4577 p += strlen("wininfo:"); in process_remote_cmd()
4579 if (p[0] == '+') { in process_remote_cmd()
4582 p++; in process_remote_cmd()
4584 if (!strcmp(p, "root")) { /* skip-cmd-list */ in process_remote_cmd()
4586 } else if (scan_hexdec(p, &id)) { in process_remote_cmd()
4594 snprintf(buf, bufn, "ans=wininfo:%s%s:%s", t, p, res); in process_remote_cmd()
4599 if (strstr(p, "bcx_xattach") == p) { in process_remote_cmd()
4606 if (strstr(p, "bcx_xattach:") != p) { /* skip-cmd-list */ in process_remote_cmd()
4607 snprintf(buf, bufn, "ans=%s:N/A", p); in process_remote_cmd()
4610 p += strlen("bcx_xattach:"); in process_remote_cmd()
4612 if (strstr(p, "retry=")) { /* skip-cmd-list */ in process_remote_cmd()
4614 char *q = strstr(p, "retry="); /* skip-cmd-list */ in process_remote_cmd()
4623 res = bcx_xattach(p, &pg_init, &kg_init); in process_remote_cmd()
4628 rfbLog("bcx_xattach: failed grab check for '%s': %s. Final state OK, not Retrying.\n", p, res); in process_remote_cmd()
4630 rfbLog("bcx_xattach: failed grab check for '%s': %s. Retrying[%d]...\n", p, res, try); in process_remote_cmd()
4655 snprintf(buf, bufn, "ans=bcx_xattach:%s:%s", p, res); in process_remote_cmd()
4660 if (strstr(p, "deferupdate") == p) { in process_remote_cmd()
4669 snprintf(buf, bufn, "ans=%s%s%d", p, co, d); in process_remote_cmd()
4672 p += strlen("deferupdate:"); in process_remote_cmd()
4673 d = atoi(p); in process_remote_cmd()
4682 if (strstr(p, "defer") == p) { in process_remote_cmd()
4691 snprintf(buf, bufn, "ans=%s%s%d", p, co, d); in process_remote_cmd()
4694 p += strlen("defer:"); in process_remote_cmd()
4695 d = atoi(p); in process_remote_cmd()
4704 if (strstr(p, "setdefer") == p) { in process_remote_cmd()
4707 snprintf(buf, bufn, "ans=%s%s%d", p, co, set_defer); in process_remote_cmd()
4710 p += strlen("setdefer:"); in process_remote_cmd()
4711 set_defer = atoi(p); in process_remote_cmd()
4715 if (strstr(p, "extra_fbur") == p) { in process_remote_cmd()
4718 snprintf(buf, bufn, "ans=%s%s%d", p, co, extra_fbur); in process_remote_cmd()
4721 p += strlen("extra_fbur:"); in process_remote_cmd()
4722 extra_fbur = atoi(p); in process_remote_cmd()
4726 if (strstr(p, "wait_ui") == p) { in process_remote_cmd()
4730 snprintf(buf, bufn, "ans=%s%s%.2f", p, co, wait_ui); in process_remote_cmd()
4733 p += strlen("wait_ui:"); in process_remote_cmd()
4734 w = atof(p); in process_remote_cmd()
4741 if (!strcmp(p, "wait_bog")) { in process_remote_cmd()
4743 snprintf(buf, bufn, "ans=%s:%d", p, wait_bog); in process_remote_cmd()
4750 if (!strcmp(p, "nowait_bog")) { in process_remote_cmd()
4752 snprintf(buf, bufn, "ans=%s:%d", p, !wait_bog); in process_remote_cmd()
4759 if (strstr(p, "slow_fb") == p) { in process_remote_cmd()
4763 snprintf(buf, bufn, "ans=%s%s%.2f", p, co, slow_fb); in process_remote_cmd()
4766 p += strlen("slow_fb:"); in process_remote_cmd()
4767 w = atof(p); in process_remote_cmd()
4774 if (strstr(p, "xrefresh") == p) { in process_remote_cmd()
4778 snprintf(buf, bufn, "ans=%s%s%.2f", p, co, xrefresh); in process_remote_cmd()
4781 p += strlen("xrefresh:"); in process_remote_cmd()
4782 w = atof(p); in process_remote_cmd()
4789 if (strstr(p, "wait") == p) { in process_remote_cmd()
4793 snprintf(buf, bufn, "ans=%s%s%d", p, co, waitms); in process_remote_cmd()
4796 p += strlen("wait:"); in process_remote_cmd()
4797 w = atoi(p); in process_remote_cmd()
4803 if (strstr(p, "readtimeout") == p) { in process_remote_cmd()
4807 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
4811 p += strlen("readtimeout:"); in process_remote_cmd()
4812 w = atoi(p) * 1000; in process_remote_cmd()
4819 if (!strcmp(p, "nap")) { in process_remote_cmd()
4821 snprintf(buf, bufn, "ans=%s:%d", p, take_naps); in process_remote_cmd()
4828 if (!strcmp(p, "nonap")) { in process_remote_cmd()
4830 snprintf(buf, bufn, "ans=%s:%d", p, !take_naps); in process_remote_cmd()
4837 if (strstr(p, "sb") == p) { in process_remote_cmd()
4841 snprintf(buf, bufn, "ans=%s%s%d", p, co, screen_blank); in process_remote_cmd()
4844 p += strlen("sb:"); in process_remote_cmd()
4845 w = atoi(p); in process_remote_cmd()
4852 if (strstr(p, "screen_blank") == p) { in process_remote_cmd()
4856 snprintf(buf, bufn, "ans=%s%s%d", p, co, screen_blank); in process_remote_cmd()
4859 p += strlen("screen_blank:"); in process_remote_cmd()
4860 w = atoi(p); in process_remote_cmd()
4867 if (!strcmp(p, "fbpm")) { in process_remote_cmd()
4869 snprintf(buf, bufn, "ans=%s:%d", p, !watch_fbpm); in process_remote_cmd()
4876 if (!strcmp(p, "nofbpm")) { in process_remote_cmd()
4878 snprintf(buf, bufn, "ans=%s:%d", p, watch_fbpm); in process_remote_cmd()
4885 if (!strcmp(p, "dpms")) { in process_remote_cmd()
4887 snprintf(buf, bufn, "ans=%s:%d", p, !watch_dpms); in process_remote_cmd()
4894 if (!strcmp(p, "nodpms")) { in process_remote_cmd()
4896 snprintf(buf, bufn, "ans=%s:%d", p, watch_dpms); in process_remote_cmd()
4903 if (!strcmp(p, "clientdpms")) { in process_remote_cmd()
4905 snprintf(buf, bufn, "ans=%s:%d", p, client_dpms); in process_remote_cmd()
4912 if (!strcmp(p, "noclientdpms")) { in process_remote_cmd()
4914 snprintf(buf, bufn, "ans=%s:%d", p, !client_dpms); in process_remote_cmd()
4921 if (!strcmp(p, "forcedpms")) { in process_remote_cmd()
4923 snprintf(buf, bufn, "ans=%s:%d", p, force_dpms); in process_remote_cmd()
4930 if (!strcmp(p, "noforcedpms")) { in process_remote_cmd()
4932 snprintf(buf, bufn, "ans=%s:%d", p, !force_dpms); in process_remote_cmd()
4939 if (!strcmp(p, "noserverdpms")) { in process_remote_cmd()
4941 snprintf(buf, bufn, "ans=%s:%d", p, no_ultra_dpms); in process_remote_cmd()
4948 if (!strcmp(p, "serverdpms")) { in process_remote_cmd()
4950 snprintf(buf, bufn, "ans=%s:%d", p, !no_ultra_dpms); in process_remote_cmd()
4957 if (!strcmp(p, "noultraext")) { in process_remote_cmd()
4959 snprintf(buf, bufn, "ans=%s:%d", p, no_ultra_ext); in process_remote_cmd()
4966 if (!strcmp(p, "ultraext")) { in process_remote_cmd()
4968 snprintf(buf, bufn, "ans=%s:%d", p, !no_ultra_ext); in process_remote_cmd()
4975 if (!strcmp(p, "chatwindow")) { in process_remote_cmd()
4977 snprintf(buf, bufn, "ans=%s:%d", p, chat_window); in process_remote_cmd()
4984 if (!strcmp(p, "nochatwindow")) { in process_remote_cmd()
4986 snprintf(buf, bufn, "ans=%s:%d", p, !chat_window); in process_remote_cmd()
4993 if (!strcmp(p, "chaton")) { in process_remote_cmd()
4995 snprintf(buf, bufn, "ans=%s:%d", p, (chat_window_client != NULL)); in process_remote_cmd()
5003 if (!strcmp(p, "chatoff")) { in process_remote_cmd()
5005 snprintf(buf, bufn, "ans=%s:%d", p, (chat_window_client == NULL)); in process_remote_cmd()
5013 if (strstr(p, "fs") == p) { in process_remote_cmd()
5016 snprintf(buf, bufn, "ans=%s%s%f", p, co, fs_frac); in process_remote_cmd()
5019 p += strlen("fs:"); in process_remote_cmd()
5020 fs_frac = atof(p); in process_remote_cmd()
5024 if (strstr(p, "gaps") == p) { in process_remote_cmd()
5028 snprintf(buf, bufn, "ans=%s%s%d", p, co, gaps_fill); in process_remote_cmd()
5031 p += strlen("gaps:"); in process_remote_cmd()
5032 g = atoi(p); in process_remote_cmd()
5039 if (strstr(p, "grow") == p) { in process_remote_cmd()
5043 snprintf(buf, bufn, "ans=%s%s%d", p, co, grow_fill); in process_remote_cmd()
5046 p += strlen("grow:"); in process_remote_cmd()
5047 g = atoi(p); in process_remote_cmd()
5054 if (strstr(p, "fuzz") == p) { in process_remote_cmd()
5058 snprintf(buf, bufn, "ans=%s%s%d", p, co, tile_fuzz); in process_remote_cmd()
5061 p += strlen("fuzz:"); in process_remote_cmd()
5062 f = atoi(p); in process_remote_cmd()
5069 if (!strcmp(p, "snapfb")) { in process_remote_cmd()
5072 snprintf(buf, bufn, "ans=%s:%d", p, use_snapfb); in process_remote_cmd()
5082 if (!strcmp(p, "nosnapfb")) { in process_remote_cmd()
5085 snprintf(buf, bufn, "ans=%s:%d", p, !use_snapfb); in process_remote_cmd()
5096 if (strstr(p, "rawfb") == p) { in process_remote_cmd()
5099 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
5103 p += strlen("rawfb:"); in process_remote_cmd()
5105 raw_fb_str = strdup(p); in process_remote_cmd()
5106 if (safe_remote_only && strstr(p, "setup:") == p) { /* skip-cmd-list */ in process_remote_cmd()
5108 fprintf(stderr, "unsafe rawfb setup: %s\n", p); in process_remote_cmd()
5112 rfbLog("remote_cmd: setting -rawfb to:\n\t'%s'\n", p); in process_remote_cmd()
5139 if (strstr(p, "uinput_accel") == p) { in process_remote_cmd()
5142 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
5146 p += strlen("uinput_accel:"); in process_remote_cmd()
5147 rfbLog("set_uinput_accel: %s\n", p); in process_remote_cmd()
5148 set_uinput_accel(p); in process_remote_cmd()
5151 if (strstr(p, "uinput_thresh") == p) { in process_remote_cmd()
5154 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
5158 p += strlen("uinput_thresh:"); in process_remote_cmd()
5159 rfbLog("set_uinput_thresh: %s\n", p); in process_remote_cmd()
5160 set_uinput_thresh(p); in process_remote_cmd()
5163 if (strstr(p, "uinput_reset") == p) { in process_remote_cmd()
5166 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
5170 p += strlen("uinput_reset:"); in process_remote_cmd()
5171 rfbLog("set_uinput_reset: %s\n", p); in process_remote_cmd()
5172 set_uinput_reset(atoi(p)); in process_remote_cmd()
5175 if (strstr(p, "uinput_always") == p) { in process_remote_cmd()
5178 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
5182 p += strlen("uinput_always:"); in process_remote_cmd()
5183 rfbLog("set_uinput_always: %s\n", p); in process_remote_cmd()
5184 set_uinput_always(atoi(p)); in process_remote_cmd()
5187 if (strstr(p, "progressive") == p) { in process_remote_cmd()
5196 snprintf(buf, bufn, "ans=%s%s%d", p, co, f); in process_remote_cmd()
5199 p += strlen("progressive:"); in process_remote_cmd()
5200 f = atoi(p); in process_remote_cmd()
5208 if (strstr(p, "rfbport") == p) { in process_remote_cmd()
5212 snprintf(buf, bufn, "ans=%s%s%d", p, co, orig); in process_remote_cmd()
5215 p += strlen("rfbport:"); in process_remote_cmd()
5216 rp = atoi(p); in process_remote_cmd()
5220 if (!strcmp(p, "http")) { in process_remote_cmd()
5223 snprintf(buf, bufn, "ans=%s:%d", p, (ls > -1)); in process_remote_cmd()
5236 if (!strcmp(p, "nohttp")) { in process_remote_cmd()
5239 snprintf(buf, bufn, "ans=%s:%d", p, !(ls > -1)); in process_remote_cmd()
5252 if (strstr(p, "httpport") == p) { in process_remote_cmd()
5256 snprintf(buf, bufn, "ans=%s%s%d", p, co, orig); in process_remote_cmd()
5259 p += strlen("httpport:"); in process_remote_cmd()
5260 hp = atoi(p); in process_remote_cmd()
5264 if (strstr(p, "httpdir") == p) { in process_remote_cmd()
5267 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
5271 p += strlen("httpdir:"); in process_remote_cmd()
5272 if (http_dir && !strcmp(http_dir, p)) { in process_remote_cmd()
5278 http_dir = strdup(p); in process_remote_cmd()
5280 if (*p != '\0') { in process_remote_cmd()
5286 if (!strcmp(p, "enablehttpproxy")) { in process_remote_cmd()
5289 snprintf(buf, bufn, "ans=%s:%d", p, ht != 0); in process_remote_cmd()
5297 if (!strcmp(p, "noenablehttpproxy")) { in process_remote_cmd()
5300 snprintf(buf, bufn, "ans=%s:%d", p, ht == 0); in process_remote_cmd()
5307 if (!strcmp(p, "alwaysshared")) { in process_remote_cmd()
5310 snprintf(buf, bufn, "ans=%s:%d", p, t != 0); in process_remote_cmd()
5317 if (!strcmp(p, "noalwaysshared")) { in process_remote_cmd()
5320 snprintf(buf, bufn, "ans=%s:%d", p, t == 0); in process_remote_cmd()
5327 if (!strcmp(p, "nevershared")) { in process_remote_cmd()
5330 snprintf(buf, bufn, "ans=%s:%d", p, t != 0); in process_remote_cmd()
5337 if (!strcmp(p, "noalwaysshared")) { in process_remote_cmd()
5340 snprintf(buf, bufn, "ans=%s:%d", p, t == 0); in process_remote_cmd()
5347 if (!strcmp(p, "dontdisconnect")) { in process_remote_cmd()
5350 snprintf(buf, bufn, "ans=%s:%d", p, t != 0); in process_remote_cmd()
5357 if (!strcmp(p, "nodontdisconnect")) { in process_remote_cmd()
5360 snprintf(buf, bufn, "ans=%s:%d", p, t == 0); in process_remote_cmd()
5367 if (!strcmp(p, "desktop") || in process_remote_cmd()
5368 strstr(p, "desktop:") == p) { /* skip-cmd-list */ in process_remote_cmd()
5371 snprintf(buf, bufn, "ans=%s%s%s", p, co, in process_remote_cmd()
5375 p += strlen("desktop:"); in process_remote_cmd()
5379 rfb_desktop_name = strdup(p); in process_remote_cmd()
5386 if (!strcmp(p, "debug_xevents")) { in process_remote_cmd()
5388 snprintf(buf, bufn, "ans=%s:%d", p, debug_xevents); in process_remote_cmd()
5395 if (!strcmp(p, "nodebug_xevents")) { in process_remote_cmd()
5397 snprintf(buf, bufn, "ans=%s:%d", p, !debug_xevents); in process_remote_cmd()
5404 if (strstr(p, "debug_xevents") == p) { in process_remote_cmd()
5407 snprintf(buf, bufn, "ans=%s%s%d", p, co, debug_xevents); in process_remote_cmd()
5410 p += strlen("debug_xevents:"); in process_remote_cmd()
5411 debug_xevents = atoi(p); in process_remote_cmd()
5415 if (!strcmp(p, "debug_xdamage")) { in process_remote_cmd()
5417 snprintf(buf, bufn, "ans=%s:%d", p, debug_xdamage); in process_remote_cmd()
5424 if (!strcmp(p, "nodebug_xdamage")) { in process_remote_cmd()
5426 snprintf(buf, bufn, "ans=%s:%d", p, !debug_xdamage); in process_remote_cmd()
5433 if (strstr(p, "debug_xdamage") == p) { in process_remote_cmd()
5436 snprintf(buf, bufn, "ans=%s%s%d", p, co, debug_xdamage); in process_remote_cmd()
5439 p += strlen("debug_xdamage:"); in process_remote_cmd()
5440 debug_xdamage = atoi(p); in process_remote_cmd()
5444 if (!strcmp(p, "debug_wireframe")) { in process_remote_cmd()
5446 snprintf(buf, bufn, "ans=%s:%d", p, debug_wireframe); in process_remote_cmd()
5453 if (!strcmp(p, "nodebug_wireframe")) { in process_remote_cmd()
5455 snprintf(buf, bufn, "ans=%s:%d", p, !debug_wireframe); in process_remote_cmd()
5462 if (strstr(p, "debug_wireframe") == p) { in process_remote_cmd()
5465 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
5469 p += strlen("debug_wireframe:"); in process_remote_cmd()
5470 debug_wireframe = atoi(p); in process_remote_cmd()
5474 if (!strcmp(p, "debug_scroll")) { in process_remote_cmd()
5476 snprintf(buf, bufn, "ans=%s:%d", p, debug_scroll); in process_remote_cmd()
5483 if (!strcmp(p, "nodebug_scroll")) { in process_remote_cmd()
5485 snprintf(buf, bufn, "ans=%s:%d", p, !debug_scroll); in process_remote_cmd()
5492 if (strstr(p, "debug_scroll") == p) { in process_remote_cmd()
5495 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
5499 p += strlen("debug_scroll:"); in process_remote_cmd()
5500 debug_scroll = atoi(p); in process_remote_cmd()
5504 if (!strcmp(p, "debug_tiles") || !strcmp(p, "dbt")) { in process_remote_cmd()
5506 snprintf(buf, bufn, "ans=%s:%d", p, debug_tiles); in process_remote_cmd()
5513 if (!strcmp(p, "nodebug_tiles") || !strcmp(p, "nodbt")) { in process_remote_cmd()
5515 snprintf(buf, bufn, "ans=%s:%d", p, !debug_tiles); in process_remote_cmd()
5522 if (strstr(p, "debug_tiles") == p) { in process_remote_cmd()
5525 snprintf(buf, bufn, "ans=%s%s%d", p, co, in process_remote_cmd()
5529 p += strlen("debug_tiles:"); in process_remote_cmd()
5530 debug_tiles = atoi(p); in process_remote_cmd()
5534 if (!strcmp(p, "debug_grabs")) { in process_remote_cmd()
5536 snprintf(buf, bufn, "ans=%s:%d", p, debug_grabs); in process_remote_cmd()
5543 if (!strcmp(p, "nodebug_grabs")) { in process_remote_cmd()
5545 snprintf(buf, bufn, "ans=%s:%d", p, !debug_grabs); in process_remote_cmd()
5552 if (!strcmp(p, "debug_sel")) { in process_remote_cmd()
5554 snprintf(buf, bufn, "ans=%s:%d", p, debug_sel); in process_remote_cmd()
5561 if (!strcmp(p, "nodebug_sel")) { in process_remote_cmd()
5563 snprintf(buf, bufn, "ans=%s:%d", p, !debug_sel); in process_remote_cmd()
5570 if (!strcmp(p, "dbg")) { in process_remote_cmd()
5572 snprintf(buf, bufn, "ans=%s:%d", p, crash_debug); in process_remote_cmd()
5579 if (!strcmp(p, "nodbg")) { in process_remote_cmd()
5581 snprintf(buf, bufn, "ans=%s:%d", p, !crash_debug); in process_remote_cmd()
5588 if (!strcmp(p, "macnosaver")) { in process_remote_cmd()
5590 snprintf(buf, bufn, "ans=%s:%d", p, macosx_noscreensaver); goto qry; in process_remote_cmd()
5596 if (!strcmp(p, "macsaver") || !strcmp(p, "nomacnosaver")) { in process_remote_cmd()
5598 snprintf(buf, bufn, "ans=%s:%d", p, !macosx_noscreensaver); goto qry; in process_remote_cmd()
5604 if (!strcmp(p, "macnowait")) { in process_remote_cmd()
5606 snprintf(buf, bufn, "ans=%s:%d", p, !macosx_wait_for_switch); goto qry; in process_remote_cmd()
5612 if (!strcmp(p, "macwait") || !strcmp(p, "nomacnowait")) { in process_remote_cmd()
5614 snprintf(buf, bufn, "ans=%s:%d", p, macosx_wait_for_switch); goto qry; in process_remote_cmd()
5620 if (strstr(p, "macwheel") == p) { in process_remote_cmd()
5623 snprintf(buf, bufn, "ans=%s%s%d", p, co, macosx_mouse_wheel_speed); in process_remote_cmd()
5626 p += strlen("macwheel:"); in process_remote_cmd()
5627 macosx_mouse_wheel_speed = atoi(p); in process_remote_cmd()
5631 if (!strcmp(p, "macnoswap")) { in process_remote_cmd()
5633 snprintf(buf, bufn, "ans=%s:%d", p, !macosx_swap23); goto qry; in process_remote_cmd()
5639 if (!strcmp(p, "macswap") || !strcmp(p, "nomacnoswap")) { in process_remote_cmd()
5641 snprintf(buf, bufn, "ans=%s:%d", p, macosx_swap23); goto qry; in process_remote_cmd()
5647 if (!strcmp(p, "macnoresize")) { in process_remote_cmd()
5649 snprintf(buf, bufn, "ans=%s:%d", p, !macosx_resize); goto qry; in process_remote_cmd()
5655 if (!strcmp(p, "macresize") || !strcmp(p, "nomacnoresize")) { in process_remote_cmd()
5657 snprintf(buf, bufn, "ans=%s:%d", p, macosx_resize); goto qry; in process_remote_cmd()
5663 if (strstr(p, "maciconanim") == p) { in process_remote_cmd()
5666 snprintf(buf, bufn, "ans=%s%s%d", p, co, macosx_icon_anim_time); in process_remote_cmd()
5669 p += strlen("maciconanim:"); in process_remote_cmd()
5670 macosx_icon_anim_time = atoi(p); in process_remote_cmd()
5674 if (!strcmp(p, "macmenu")) { in process_remote_cmd()
5676 snprintf(buf, bufn, "ans=%s:%d", p, macosx_ncache_macmenu); goto qry; in process_remote_cmd()
5682 if (!strcmp(p, "macnomenu") || !strcmp(p, "nomacmenu")) { in process_remote_cmd()
5684 snprintf(buf, bufn, "ans=%s:%d", p, !macosx_ncache_macmenu); goto qry; in process_remote_cmd()
5690 if (!strcmp(p, "macuskbd")) { in process_remote_cmd()
5692 snprintf(buf, bufn, "ans=%s:%d", p, macosx_us_kbd); goto qry; in process_remote_cmd()
5698 if (!strcmp(p, "nomacuskbd")) { in process_remote_cmd()
5700 snprintf(buf, bufn, "ans=%s:%d", p, !macosx_us_kbd); goto qry; in process_remote_cmd()
5706 if (strstr(p, "hack") == p) { /* skip-cmd-list */ in process_remote_cmd()
5709 snprintf(buf, bufn, "ans=%s%s%d", p, co, hack_val); in process_remote_cmd()
5712 p += strlen("hack:"); in process_remote_cmd()
5713 hack_val = atoi(p); in process_remote_cmd()
5717 if (!strcmp(p, "noremote")) { in process_remote_cmd()
5719 snprintf(buf, bufn, "ans=%s:%d", p, in process_remote_cmd()
5727 if (strstr(p, "client_info_sock") == p) { /* skip-cmd-list */ in process_remote_cmd()
5729 p += strlen("client_info_sock:"); in process_remote_cmd()
5730 if (*p != '\0') { in process_remote_cmd()
5731 start_client_info_sock(p); in process_remote_cmd()
5735 if (strstr(p, "noop") == p) { in process_remote_cmd()
5740 if (icon_mode && !query && strstr(p, "passwd") == p) { /* skip-cmd-list */ in process_remote_cmd()
5745 p += strlen("passwd:"); in process_remote_cmd()
5747 passwds_new[0] = strdup(p); in process_remote_cmd()
5760 if (*p == '\0') { in process_remote_cmd()
5766 if (icon_mode && !query && strstr(p, "viewpasswd") == p) { /* skip-cmd-list */ in process_remote_cmd()
5771 p += strlen("viewpasswd:"); in process_remote_cmd()
5773 passwds_new[1] = strdup(p); in process_remote_cmd()
5786 if (*p == '\0') { in process_remote_cmd()
5794 if (strstr(p, "trayembed") == p) { /* skip-cmd-list */ in process_remote_cmd()
5799 p += strlen("trayembed:"); in process_remote_cmd()
5800 if (scan_hexdec(p, &id)) { in process_remote_cmd()
5808 if (strstr(p, "trayunembed") == p) { /* skip-cmd-list */ in process_remote_cmd()
5813 p += strlen("trayunembed:"); in process_remote_cmd()
5814 if (scan_hexdec(p, &id)) { in process_remote_cmd()
5825 if (!strcmp(p, "display")) { in process_remote_cmd()
5828 p, raw_fb_addr); in process_remote_cmd()
5830 snprintf(buf, bufn, "aro=%s:", p); in process_remote_cmd()
5836 snprintf(buf, bufn, "aro=%s:%s%s", p, in process_remote_cmd()
5839 snprintf(buf, bufn, "aro=%s:%s", p, d); in process_remote_cmd()
5844 if (!strcmp(p, "vncdisplay")) { in process_remote_cmd()
5845 snprintf(buf, bufn, "aro=%s:%s", p, in process_remote_cmd()
5849 if (!strcmp(p, "icon_mode")) { in process_remote_cmd()
5850 snprintf(buf, bufn, "aro=%s:%d", p, icon_mode); in process_remote_cmd()
5853 if (!strcmp(p, "autoport")) { in process_remote_cmd()
5854 snprintf(buf, bufn, "aro=%s:%d", p, auto_port); in process_remote_cmd()
5857 if (!strcmp(p, "loop") || !strcmp(p, "loopbg")) { in process_remote_cmd()
5858 snprintf(buf, bufn, "aro=%s:%d", p, 0); in process_remote_cmd()
5861 if (!strcmp(p, "desktopname")) { in process_remote_cmd()
5862 snprintf(buf, bufn, "aro=%s:%s", p, in process_remote_cmd()
5866 if (!strcmp(p, "guess_desktop")) { in process_remote_cmd()
5867 snprintf(buf, bufn, "aro=%s:%s", p, in process_remote_cmd()
5871 if (!strcmp(p, "guess_dbus")) { in process_remote_cmd()
5872 snprintf(buf, bufn, "aro=%s:%s", p, in process_remote_cmd()
5876 if (!strcmp(p, "http_url")) { in process_remote_cmd()
5878 snprintf(buf, bufn, "aro=%s:", p); in process_remote_cmd()
5880 snprintf(buf, bufn, "aro=%s:http://%s:%d", p, in process_remote_cmd()
5883 snprintf(buf, bufn, "aro=%s:%s", p, in process_remote_cmd()
5888 if (!strcmp(p, "auth") || !strcmp(p, "xauth")) { in process_remote_cmd()
5889 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(auth_file)); in process_remote_cmd()
5892 if (!strcmp(p, "users")) { in process_remote_cmd()
5893 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(users_list)); in process_remote_cmd()
5896 if (!strcmp(p, "rootshift")) { in process_remote_cmd()
5897 snprintf(buf, bufn, "aro=%s:%d", p, rootshift); in process_remote_cmd()
5900 if (!strcmp(p, "clipshift")) { in process_remote_cmd()
5901 snprintf(buf, bufn, "aro=%s:%d", p, clipshift); in process_remote_cmd()
5904 if (!strcmp(p, "scale_str")) { in process_remote_cmd()
5905 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(scale_str)); in process_remote_cmd()
5908 if (!strcmp(p, "scaled_x")) { in process_remote_cmd()
5909 snprintf(buf, bufn, "aro=%s:%d", p, scaled_x); in process_remote_cmd()
5912 if (!strcmp(p, "scaled_y")) { in process_remote_cmd()
5913 snprintf(buf, bufn, "aro=%s:%d", p, scaled_y); in process_remote_cmd()
5916 if (!strcmp(p, "scale_numer")) { in process_remote_cmd()
5917 snprintf(buf, bufn, "aro=%s:%d", p, scale_numer); in process_remote_cmd()
5920 if (!strcmp(p, "scale_denom")) { in process_remote_cmd()
5921 snprintf(buf, bufn, "aro=%s:%d", p, scale_denom); in process_remote_cmd()
5924 if (!strcmp(p, "scale_fac_x")) { in process_remote_cmd()
5925 snprintf(buf, bufn, "aro=%s:%f", p, scale_fac_x); in process_remote_cmd()
5928 if (!strcmp(p, "scale_fac_y")) { in process_remote_cmd()
5929 snprintf(buf, bufn, "aro=%s:%f", p, scale_fac_y); in process_remote_cmd()
5932 if (!strcmp(p, "scaling_blend")) { in process_remote_cmd()
5933 snprintf(buf, bufn, "aro=%s:%d", p, scaling_blend); in process_remote_cmd()
5936 if (!strcmp(p, "scaling_nomult4")) { in process_remote_cmd()
5937 snprintf(buf, bufn, "aro=%s:%d", p, scaling_nomult4); in process_remote_cmd()
5940 if (!strcmp(p, "scaling_pad")) { in process_remote_cmd()
5941 snprintf(buf, bufn, "aro=%s:%d", p, scaling_pad); in process_remote_cmd()
5944 if (!strcmp(p, "scaling_interpolate")) { in process_remote_cmd()
5945 snprintf(buf, bufn, "aro=%s:%d", p, in process_remote_cmd()
5949 if (!strcmp(p, "inetd")) { in process_remote_cmd()
5950 snprintf(buf, bufn, "aro=%s:%d", p, inetd); in process_remote_cmd()
5953 if (!strcmp(p, "privremote")) { in process_remote_cmd()
5954 snprintf(buf, bufn, "aro=%s:%d", p, priv_remote); in process_remote_cmd()
5957 if (!strcmp(p, "unsafe")) { in process_remote_cmd()
5958 snprintf(buf, bufn, "aro=%s:%d", p, !safe_remote_only); in process_remote_cmd()
5961 if (!strcmp(p, "safer")) { in process_remote_cmd()
5962 snprintf(buf, bufn, "aro=%s:%d", p, more_safe); in process_remote_cmd()
5965 if (!strcmp(p, "nocmds")) { in process_remote_cmd()
5966 snprintf(buf, bufn, "aro=%s:%d", p, no_external_cmds); in process_remote_cmd()
5969 if (!strcmp(p, "passwdfile")) { in process_remote_cmd()
5970 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(passwdfile)); in process_remote_cmd()
5973 if (!strcmp(p, "unixpw")) { in process_remote_cmd()
5974 snprintf(buf, bufn, "aro=%s:%d", p, unixpw); in process_remote_cmd()
5977 if (!strcmp(p, "unixpw_nis")) { in process_remote_cmd()
5978 snprintf(buf, bufn, "aro=%s:%d", p, unixpw_nis); in process_remote_cmd()
5981 if (!strcmp(p, "unixpw_list")) { in process_remote_cmd()
5982 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(unixpw_list)); in process_remote_cmd()
5985 if (!strcmp(p, "ssl")) { in process_remote_cmd()
5986 snprintf(buf, bufn, "aro=%s:%d", p, use_openssl); in process_remote_cmd()
5989 if (!strcmp(p, "ssl_pem")) { in process_remote_cmd()
5990 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(openssl_pem)); in process_remote_cmd()
5993 if (!strcmp(p, "sslverify")) { in process_remote_cmd()
5994 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(ssl_verify)); in process_remote_cmd()
5997 if (!strcmp(p, "stunnel")) { in process_remote_cmd()
5998 snprintf(buf, bufn, "aro=%s:%d", p, use_stunnel); in process_remote_cmd()
6001 if (!strcmp(p, "stunnel_pem")) { in process_remote_cmd()
6002 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(stunnel_pem)); in process_remote_cmd()
6005 if (!strcmp(p, "https")) { in process_remote_cmd()
6006 snprintf(buf, bufn, "aro=%s:%d", p, https_port_num); in process_remote_cmd()
6009 if (!strcmp(p, "httpsredir")) { in process_remote_cmd()
6010 snprintf(buf, bufn, "aro=%s:%d", p, https_port_redir); in process_remote_cmd()
6013 if (!strcmp(p, "usepw")) { in process_remote_cmd()
6014 snprintf(buf, bufn, "aro=%s:%d", p, usepw); in process_remote_cmd()
6017 if (!strcmp(p, "using_shm")) { in process_remote_cmd()
6018 snprintf(buf, bufn, "aro=%s:%d", p, !using_shm); in process_remote_cmd()
6021 if (!strcmp(p, "logfile") || !strcmp(p, "o")) { in process_remote_cmd()
6022 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(logfile)); in process_remote_cmd()
6025 if (!strcmp(p, "flag")) { in process_remote_cmd()
6026 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(flagfile)); in process_remote_cmd()
6029 if (!strcmp(p, "rmflag")) { in process_remote_cmd()
6030 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(rm_flagfile)); in process_remote_cmd()
6033 if (!strcmp(p, "rc")) { in process_remote_cmd()
6038 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(s)); in process_remote_cmd()
6041 if (!strcmp(p, "norc")) { in process_remote_cmd()
6042 snprintf(buf, bufn, "aro=%s:%d", p, got_norc); in process_remote_cmd()
6045 if (!strcmp(p, "h") || !strcmp(p, "help") || in process_remote_cmd()
6046 !strcmp(p, "V") || !strcmp(p, "version") || in process_remote_cmd()
6047 !strcmp(p, "lastmod")) { in process_remote_cmd()
6048 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(lastmod)); in process_remote_cmd()
6051 if (!strcmp(p, "bg")) { in process_remote_cmd()
6052 snprintf(buf, bufn, "aro=%s:%d", p, opts_bg); in process_remote_cmd()
6055 if (!strcmp(p, "sigpipe")) { in process_remote_cmd()
6056 snprintf(buf, bufn, "aro=%s:%s", p, NONUL(sigpipe)); in process_remote_cmd()
6059 if (!strcmp(p, "threads")) { in process_remote_cmd()
6060 snprintf(buf, bufn, "aro=%s:%d", p, use_threads); in process_remote_cmd()
6063 if (!strcmp(p, "readrate")) { in process_remote_cmd()
6064 snprintf(buf, bufn, "aro=%s:%d", p, get_read_rate()); in process_remote_cmd()
6067 if (!strcmp(p, "netrate")) { in process_remote_cmd()
6068 snprintf(buf, bufn, "aro=%s:%d", p, get_net_rate()); in process_remote_cmd()
6071 if (!strcmp(p, "netlatency")) { in process_remote_cmd()
6072 snprintf(buf, bufn, "aro=%s:%d", p, get_net_latency()); in process_remote_cmd()
6075 if (!strcmp(p, "pipeinput")) { in process_remote_cmd()
6076 snprintf(buf, bufn, "aro=%s:%s", p, in process_remote_cmd()
6080 if (!strcmp(p, "clients")) { in process_remote_cmd()
6082 snprintf(buf, bufn, "aro=%s:%s", p, str); in process_remote_cmd()
6086 if (!strcmp(p, "client_count")) { in process_remote_cmd()
6087 snprintf(buf, bufn, "aro=%s:%d", p, client_count); in process_remote_cmd()
6090 if (!strcmp(p, "pid")) { in process_remote_cmd()
6091 snprintf(buf, bufn, "aro=%s:%d", p, (int) getpid()); in process_remote_cmd()
6094 if (!strcmp(p, "ext_xtest")) { in process_remote_cmd()
6095 snprintf(buf, bufn, "aro=%s:%d", p, xtest_present); in process_remote_cmd()
6098 if (!strcmp(p, "ext_xtrap")) { in process_remote_cmd()
6099 snprintf(buf, bufn, "aro=%s:%d", p, xtrap_present); in process_remote_cmd()
6102 if (!strcmp(p, "ext_xrecord")) { in process_remote_cmd()
6103 snprintf(buf, bufn, "aro=%s:%d", p, xrecord_present); in process_remote_cmd()
6106 if (!strcmp(p, "ext_xkb")) { in process_remote_cmd()
6107 snprintf(buf, bufn, "aro=%s:%d", p, xkb_present); in process_remote_cmd()
6110 if (!strcmp(p, "ext_xshm")) { in process_remote_cmd()
6111 snprintf(buf, bufn, "aro=%s:%d", p, xshm_present); in process_remote_cmd()
6114 if (!strcmp(p, "ext_xinerama")) { in process_remote_cmd()
6115 snprintf(buf, bufn, "aro=%s:%d", p, xinerama_present); in process_remote_cmd()
6118 if (!strcmp(p, "ext_overlay")) { in process_remote_cmd()
6119 snprintf(buf, bufn, "aro=%s:%d", p, overlay_present); in process_remote_cmd()
6122 if (!strcmp(p, "ext_xfixes")) { in process_remote_cmd()
6123 snprintf(buf, bufn, "aro=%s:%d", p, xfixes_present); in process_remote_cmd()
6126 if (!strcmp(p, "ext_xdamage")) { in process_remote_cmd()
6127 snprintf(buf, bufn, "aro=%s:%d", p, xdamage_present); in process_remote_cmd()
6130 if (!strcmp(p, "ext_xrandr")) { in process_remote_cmd()
6131 snprintf(buf, bufn, "aro=%s:%d", p, xrandr_present); in process_remote_cmd()
6134 if (!strcmp(p, "rootwin")) { in process_remote_cmd()
6135 snprintf(buf, bufn, "aro=%s:0x%x", p, in process_remote_cmd()
6139 if (!strcmp(p, "num_buttons")) { in process_remote_cmd()
6140 snprintf(buf, bufn, "aro=%s:%d", p, num_buttons); in process_remote_cmd()
6143 if (!strcmp(p, "button_mask")) { in process_remote_cmd()
6144 snprintf(buf, bufn, "aro=%s:%d", p, button_mask); in process_remote_cmd()
6147 if (!strcmp(p, "mouse_x")) { in process_remote_cmd()
6148 snprintf(buf, bufn, "aro=%s:%d", p, cursor_x); in process_remote_cmd()
6151 if (!strcmp(p, "mouse_y")) { in process_remote_cmd()
6152 snprintf(buf, bufn, "aro=%s:%d", p, cursor_y); in process_remote_cmd()
6155 if (!strcmp(p, "grab_state")) { in process_remote_cmd()
6159 snprintf(buf, bufn, "aro=%s:%d,%d", p, ptr_grabbed, kbd_grabbed); in process_remote_cmd()
6165 …cmp(p, "pointer_pos") || !strcmp(p, "pointer_x") || !strcmp(p, "pointer_y") || !strcmp(p, "pointer… in process_remote_cmd()
6173 if (!strcmp(p, "pointer_pos")) { /* skip-cmd-list */ in process_remote_cmd()
6174 snprintf(buf, bufn, "aro=%s:%d,%d", p, px, py); in process_remote_cmd()
6175 } else if (!strcmp(p, "pointer_x")) { /* skip-cmd-list */ in process_remote_cmd()
6176 snprintf(buf, bufn, "aro=%s:%d", p, px); in process_remote_cmd()
6177 } else if (!strcmp(p, "pointer_y")) { /* skip-cmd-list */ in process_remote_cmd()
6178 snprintf(buf, bufn, "aro=%s:%d", p, py); in process_remote_cmd()
6179 } else if (!strcmp(p, "pointer_same")) { /* skip-cmd-list */ in process_remote_cmd()
6180 snprintf(buf, bufn, "aro=%s:%d", p, same_screen); in process_remote_cmd()
6181 } else if (!strcmp(p, "pointer_root")) { /* skip-cmd-list */ in process_remote_cmd()
6182 snprintf(buf, bufn, "aro=%s:0x%x", p, (unsigned int) rootwin); in process_remote_cmd()
6183 } else if (!strcmp(p, "pointer_mask")) { /* skip-cmd-list */ in process_remote_cmd()
6184 snprintf(buf, bufn, "aro=%s:0x%x", p, m); in process_remote_cmd()
6197 if (!strcmp(p, "pointer_pos")) { /* skip-cmd-list */ in process_remote_cmd()
6198 snprintf(buf, bufn, "aro=%s:%d,%d", p, px, py); in process_remote_cmd()
6199 } else if (!strcmp(p, "pointer_x")) { /* skip-cmd-list */ in process_remote_cmd()
6200 snprintf(buf, bufn, "aro=%s:%d", p, px); in process_remote_cmd()
6201 } else if (!strcmp(p, "pointer_y")) { /* skip-cmd-list */ in process_remote_cmd()
6202 snprintf(buf, bufn, "aro=%s:%d", p, py); in process_remote_cmd()
6203 } else if (!strcmp(p, "pointer_same")) { /* skip-cmd-list */ in process_remote_cmd()
6204 snprintf(buf, bufn, "aro=%s:%d", p, same_screen); in process_remote_cmd()
6205 } else if (!strcmp(p, "pointer_root")) { /* skip-cmd-list */ in process_remote_cmd()
6206 snprintf(buf, bufn, "aro=%s:0x%x", p, (unsigned int) r); in process_remote_cmd()
6207 } else if (!strcmp(p, "pointer_mask")) { /* skip-cmd-list */ in process_remote_cmd()
6208 snprintf(buf, bufn, "aro=%s:0x%x", p, m); in process_remote_cmd()
6211 rfbLog("remote_cmd: %s: %s\n", p, buf); in process_remote_cmd()
6215 if (!strcmp(p, "bpp")) { in process_remote_cmd()
6216 snprintf(buf, bufn, "aro=%s:%d", p, bpp); in process_remote_cmd()
6219 if (!strcmp(p, "depth")) { in process_remote_cmd()
6220 snprintf(buf, bufn, "aro=%s:%d", p, depth); in process_remote_cmd()
6223 if (!strcmp(p, "indexed_color")) { in process_remote_cmd()
6224 snprintf(buf, bufn, "aro=%s:%d", p, indexed_color); in process_remote_cmd()
6227 if (!strcmp(p, "dpy_x")) { in process_remote_cmd()
6228 snprintf(buf, bufn, "aro=%s:%d", p, dpy_x); in process_remote_cmd()
6231 if (!strcmp(p, "dpy_y")) { in process_remote_cmd()
6232 snprintf(buf, bufn, "aro=%s:%d", p, dpy_y); in process_remote_cmd()
6235 if (!strcmp(p, "wdpy_x")) { in process_remote_cmd()
6236 snprintf(buf, bufn, "aro=%s:%d", p, wdpy_x); in process_remote_cmd()
6239 if (!strcmp(p, "wdpy_y")) { in process_remote_cmd()
6240 snprintf(buf, bufn, "aro=%s:%d", p, wdpy_y); in process_remote_cmd()
6243 if (!strcmp(p, "off_x")) { in process_remote_cmd()
6244 snprintf(buf, bufn, "aro=%s:%d", p, off_x); in process_remote_cmd()
6247 if (!strcmp(p, "off_y")) { in process_remote_cmd()
6248 snprintf(buf, bufn, "aro=%s:%d", p, off_y); in process_remote_cmd()
6251 if (!strcmp(p, "cdpy_x")) { in process_remote_cmd()
6252 snprintf(buf, bufn, "aro=%s:%d", p, cdpy_x); in process_remote_cmd()
6255 if (!strcmp(p, "cdpy_y")) { in process_remote_cmd()
6256 snprintf(buf, bufn, "aro=%s:%d", p, cdpy_y); in process_remote_cmd()
6259 if (!strcmp(p, "coff_x")) { in process_remote_cmd()
6260 snprintf(buf, bufn, "aro=%s:%d", p, coff_x); in process_remote_cmd()
6263 if (!strcmp(p, "coff_y")) { in process_remote_cmd()
6264 snprintf(buf, bufn, "aro=%s:%d", p, coff_y); in process_remote_cmd()
6267 if (!strcmp(p, "rfbauth")) { in process_remote_cmd()
6271 if (!strcmp(p, "passwd")) { in process_remote_cmd()
6275 if (!strcmp(p, "viewpasswd")) { in process_remote_cmd()
6289 strncpy(tmp, p, 90); in process_remote_cmd()