guacamole-server-0.9.9/ 0000775 0001751 0001751 00000000000 12645400336 012002 5 0000000 0000000 guacamole-server-0.9.9/test-driver 0000755 0001751 0001751 00000010277 12645400276 014130 0000000 0000000 #! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2013-07-13.22; # UTC
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
estatus=1
fi
case $estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
guacamole-server-0.9.9/README 0000664 0001751 0001751 00000010424 12612226234 012600 0000000 0000000
------------------------------------------------------------
About this README
------------------------------------------------------------
This README is intended to provide quick and to-the-point documentation for
technical users intending to compile parts of Guacamole themselves.
Source archives are available from the files section of the main project page:
http://sourceforge.net/projects/guacamole/files/
A full manual is provided on the Guacamole web site:
http://guac-dev.org/
------------------------------------------------------------
What is guacamole-server?
------------------------------------------------------------
The guacamole-server package is a set of software which forms the basis of the
Guacamole stack. It consists of guacd, libguac, and several protocol support
libraries.
guacd is the Guacamole proxy daemon used by the Guacamole web application and
framework. As JavaScript cannot handle binary protocols (like VNC and remote
desktop) efficiently, a new test-based protocol was developed which would
contain a common superset of the operations needed for efficient remote desktop
access, but would be easy for JavaScript programs to process. guacd is the
proxy which translates between arbitrary protocols and the Guacamole protocol.
------------------------------------------------------------
Compiling and installing guacd, libguac, etc.
------------------------------------------------------------
All software within guacamole-server is built using the popular GNU Automake,
and thus provides the standard configure script. Before compiling, you need to
have compiled and installed libguac, the core Guacamole library. This is
available from the main Guacamole site at http://guac-dev.org/.
1) Run configure
$ ./configure
Assuming all dependencies have been installed, this should succeed without
errors. If you wish to install the init script as well, you need to specify
the location where your system init scripts are located (typically
/etc/init.d):
$ ./configure --with-init-dir=/etc/init.d
Running configure in this manner will cause the "make install" step to
install an init script to the specified directory, which you can then
activate using the service management mechanism provided by your
distribution).
2) Run make
$ make
guacd, libguac, and any available protocol support libraries will now
compile.
3) Install (as root)
# make install
All software that was just built, including documentation, will be
installed.
guacd will install to your /usr/local/sbin directory by default. You can
change the install location by using the --prefix option for configure.
------------------------------------------------------------
Running guacd
------------------------------------------------------------
If you installed the init script during compile and install, you should be
able to start guacd through the service management utilities provided by
your distribution (if any) or by running the init script directly (as root):
# /etc/init.d/guacd start
Root access is needed to write the pidfile /var/run/guacd.pid. You can also run
guacd itself directly without the init script (as any user):
$ guacd
guacd currently takes several command-line options:
-b HOST
Changes the host or address that guacd listens on.
-l PORT
Changes the port that guacd listens on (the default is port 4822).
-p PIDFILE
Causes guacd to write the PID of the daemon process to the specified
file. This is useful for init scripts and is used by the provided init
script.
-L LEVEL
Sets the maximum level at which guacd will log messages to syslog and,
if running in the foreground, the console. Legal values are debug,
info, warning, and error. The default value is info.
-f
Causes guacd to run in the foreground, rather than automatically
forking into the background.
Additional information can be found in the guacd man page:
$ man guacd
------------------------------------------------------------
Reporting problems
------------------------------------------------------------
Please report any bugs encountered by opening a new issue in the JIRA system
hosted at:
http://glyptodon.org/jira/
guacamole-server-0.9.9/tests/ 0000775 0001751 0001751 00000000000 12645400336 013144 5 0000000 0000000 guacamole-server-0.9.9/tests/protocol/ 0000775 0001751 0001751 00000000000 12645400336 015005 5 0000000 0000000 guacamole-server-0.9.9/tests/protocol/suite.c 0000664 0001751 0001751 00000004000 12536405625 016221 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "suite.h"
#include
int protocol_suite_init() {
return 0;
}
int protocol_suite_cleanup() {
return 0;
}
int register_protocol_suite() {
/* Add protocol test suite */
CU_pSuite suite = CU_add_suite("protocol",
protocol_suite_init, protocol_suite_cleanup);
if (suite == NULL) {
CU_cleanup_registry();
return CU_get_error();
}
/* Add tests */
if (
CU_add_test(suite, "base64-decode", test_base64_decode) == NULL
|| CU_add_test(suite, "instruction-parse", test_instruction_parse) == NULL
|| CU_add_test(suite, "instruction-read", test_instruction_read) == NULL
|| CU_add_test(suite, "instruction-write", test_instruction_write) == NULL
|| CU_add_test(suite, "nest-write", test_nest_write) == NULL
) {
CU_cleanup_registry();
return CU_get_error();
}
return 0;
}
guacamole-server-0.9.9/tests/protocol/instruction_read.c 0000664 0001751 0001751 00000006457 12643542623 020465 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "suite.h"
#include
#include
#include
#include
#include
#include
#include
#include
void test_instruction_read() {
int rfd, wfd;
int fd[2], childpid;
char test_string[] = "4.test,6.a" UTF8_4 "b,"
"5.12345,10.a" UTF8_8 "c;"
"5.test2,10.hellohello,15.worldworldworld;";
/* Create pipe */
CU_ASSERT_EQUAL_FATAL(pipe(fd), 0);
/* File descriptors */
rfd = fd[0];
wfd = fd[1];
/* Fork */
if ((childpid = fork()) == -1) {
/* ERROR */
perror("fork");
return;
}
/* Child (pipe writer) */
if (childpid != 0) {
close(rfd);
CU_ASSERT_EQUAL(
write(wfd, test_string, sizeof(test_string)),
sizeof(test_string)
);
exit(0);
}
/* Parent (unit test) */
else {
guac_socket* socket;
guac_instruction* instruction;
close(wfd);
/* Open guac socket */
socket = guac_socket_open(rfd);
CU_ASSERT_PTR_NOT_NULL_FATAL(socket);
/* Read instruction */
instruction = guac_instruction_read(socket, 1000000);
CU_ASSERT_PTR_NOT_NULL_FATAL(instruction);
/* Validate contents */
CU_ASSERT_STRING_EQUAL(instruction->opcode, "test");
CU_ASSERT_EQUAL_FATAL(instruction->argc, 3);
CU_ASSERT_STRING_EQUAL(instruction->argv[0], "a" UTF8_4 "b");
CU_ASSERT_STRING_EQUAL(instruction->argv[1], "12345");
CU_ASSERT_STRING_EQUAL(instruction->argv[2], "a" UTF8_8 "c");
/* Read another instruction */
guac_instruction_free(instruction);
instruction = guac_instruction_read(socket, 1000000);
/* Validate contents */
CU_ASSERT_STRING_EQUAL(instruction->opcode, "test2");
CU_ASSERT_EQUAL_FATAL(instruction->argc, 2);
CU_ASSERT_STRING_EQUAL(instruction->argv[0], "hellohello");
CU_ASSERT_STRING_EQUAL(instruction->argv[1], "worldworldworld");
guac_instruction_free(instruction);
guac_socket_free(socket);
}
}
guacamole-server-0.9.9/tests/protocol/base64_decode.c 0000664 0001751 0001751 00000004263 12536405625 017472 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "suite.h"
#include
#include
#include
#include
#include
void test_base64_decode() {
/* Test strings */
char test_HELLO[] = "SEVMTE8=";
char test_AVOCADO[] = "QVZPQ0FETw==";
char test_GUACAMOLE[] = "R1VBQ0FNT0xF";
/* Invalid strings */
char invalid1[] = "====";
char invalid2[] = "";
/* Test one character of padding */
CU_ASSERT_EQUAL(guac_protocol_decode_base64(test_HELLO), 5);
CU_ASSERT_NSTRING_EQUAL(test_HELLO, "HELLO", 5);
/* Test two characters of padding */
CU_ASSERT_EQUAL(guac_protocol_decode_base64(test_AVOCADO), 7);
CU_ASSERT_NSTRING_EQUAL(test_AVOCADO, "AVOCADO", 7);
/* Test three characters of padding */
CU_ASSERT_EQUAL(guac_protocol_decode_base64(test_GUACAMOLE), 9);
CU_ASSERT_NSTRING_EQUAL(test_GUACAMOLE, "GUACAMOLE", 9);
/* Verify invalid strings stop early as expected */
CU_ASSERT_EQUAL(guac_protocol_decode_base64(invalid1), 0);
CU_ASSERT_EQUAL(guac_protocol_decode_base64(invalid2), 0);
}
guacamole-server-0.9.9/tests/protocol/nest_write.c 0000664 0001751 0001751 00000005753 12643542623 017272 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "suite.h"
#include
#include
#include
#include
#include
#include
#include
#include
void test_nest_write() {
int rfd, wfd;
int fd[2], childpid;
/* Create pipe */
CU_ASSERT_EQUAL_FATAL(pipe(fd), 0);
/* File descriptors */
rfd = fd[0];
wfd = fd[1];
/* Fork */
if ((childpid = fork()) == -1) {
/* ERROR */
perror("fork");
return;
}
/* Child (pipe writer) */
if (childpid != 0) {
guac_socket* nested_socket;
guac_socket* socket;
close(rfd);
/* Open guac socket */
socket = guac_socket_open(wfd);
/* Nest socket */
nested_socket = guac_socket_nest(socket, 0);
/* Write instruction */
guac_protocol_send_name(nested_socket, "a" UTF8_4 "b" UTF8_4 "c");
guac_protocol_send_sync(nested_socket, 12345);
guac_socket_flush(nested_socket);
guac_socket_flush(socket);
guac_socket_free(nested_socket);
guac_socket_free(socket);
exit(0);
}
/* Parent (unit test) */
else {
char expected[] =
"4.nest,1.0,37."
"4.name,11.a" UTF8_4 "b" UTF8_4 "c;"
"4.sync,5.12345;"
";";
int numread;
char buffer[1024];
int offset = 0;
close(wfd);
/* Read everything available into buffer */
while ((numread =
read(rfd,
&(buffer[offset]),
sizeof(buffer)-offset)) != 0) {
offset += numread;
}
/* Add NULL terminator */
buffer[offset] = '\0';
/* Read value should be equal to expected value */
CU_ASSERT_STRING_EQUAL(buffer, expected);
}
}
guacamole-server-0.9.9/tests/protocol/instruction_write.c 0000664 0001751 0001751 00000005350 12643542623 020673 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "suite.h"
#include
#include
#include
#include
#include
#include
#include
#include
void test_instruction_write() {
int rfd, wfd;
int fd[2], childpid;
/* Create pipe */
CU_ASSERT_EQUAL_FATAL(pipe(fd), 0);
/* File descriptors */
rfd = fd[0];
wfd = fd[1];
/* Fork */
if ((childpid = fork()) == -1) {
/* ERROR */
perror("fork");
return;
}
/* Child (pipe writer) */
if (childpid != 0) {
guac_socket* socket;
close(rfd);
/* Open guac socket */
socket = guac_socket_open(wfd);
/* Write instruction */
guac_protocol_send_name(socket, "a" UTF8_4 "b" UTF8_4 "c");
guac_protocol_send_sync(socket, 12345);
guac_socket_flush(socket);
guac_socket_free(socket);
exit(0);
}
/* Parent (unit test) */
else {
char expected[] =
"4.name,11.a" UTF8_4 "b" UTF8_4 "c;"
"4.sync,5.12345;";
int numread;
char buffer[1024];
int offset = 0;
close(wfd);
/* Read everything available into buffer */
while ((numread =
read(rfd,
&(buffer[offset]),
sizeof(buffer)-offset)) != 0) {
offset += numread;
}
/* Add NULL terminator */
buffer[offset] = '\0';
/* Read value should be equal to expected value */
CU_ASSERT_STRING_EQUAL(buffer, expected);
}
}
guacamole-server-0.9.9/tests/protocol/instruction_parse.c 0000664 0001751 0001751 00000005416 12643542623 020656 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "suite.h"
#include
#include
#include
#include
#include
void test_instruction_parse() {
/* Allocate instruction space */
guac_instruction* instruction = guac_instruction_alloc();
CU_ASSERT_PTR_NOT_NULL_FATAL(instruction);
/* Instruction input */
char buffer[] = "4.test,8.testdata,5.zxcvb,13.guacamoletest;XXXXXXXXXXXXXXXXXX";
char* current = buffer;
/* While data remains */
int remaining = sizeof(buffer)-1;
while (remaining > 18) {
/* Parse more data */
int parsed = guac_instruction_append(instruction, current, remaining);
if (parsed == 0)
break;
current += parsed;
remaining -= parsed;
}
CU_ASSERT_EQUAL(remaining, 18);
CU_ASSERT_EQUAL(instruction->state, GUAC_INSTRUCTION_PARSE_COMPLETE);
/* Parse is complete - no more data should be read */
CU_ASSERT_EQUAL(guac_instruction_append(instruction, current, 18), 0);
CU_ASSERT_EQUAL(instruction->state, GUAC_INSTRUCTION_PARSE_COMPLETE);
/* Validate resulting structure */
CU_ASSERT_EQUAL(instruction->argc, 3);
CU_ASSERT_PTR_NOT_NULL_FATAL(instruction->opcode);
CU_ASSERT_PTR_NOT_NULL_FATAL(instruction->argv[0]);
CU_ASSERT_PTR_NOT_NULL_FATAL(instruction->argv[1]);
CU_ASSERT_PTR_NOT_NULL_FATAL(instruction->argv[2]);
/* Validate resulting content */
CU_ASSERT_STRING_EQUAL(instruction->opcode, "test");
CU_ASSERT_STRING_EQUAL(instruction->argv[0], "testdata");
CU_ASSERT_STRING_EQUAL(instruction->argv[1], "zxcvb");
CU_ASSERT_STRING_EQUAL(instruction->argv[2], "guacamoletest");
}
guacamole-server-0.9.9/tests/protocol/suite.h 0000664 0001751 0001751 00000003326 12536405625 016240 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TEST_PROTOCOL_SUITE_H
#define _GUAC_TEST_PROTOCOL_SUITE_H
#include "config.h"
/* Unicode (UTF-8) strings */
#define UTF8_1 "\xe7\x8a\xac" /* One character */
#define UTF8_2 UTF8_1 "\xf0\x90\xac\x80" /* Two characters */
#define UTF8_3 UTF8_2 "z" /* Three characters */
#define UTF8_4 UTF8_3 "\xc3\xa1" /* Four characters */
#define UTF8_8 UTF8_4 UTF8_4 /* Eight characters */
int register_protocol_suite();
void test_base64_decode();
void test_instruction_parse();
void test_instruction_read();
void test_instruction_write();
void test_nest_write();
#endif
guacamole-server-0.9.9/tests/Makefile.in 0000664 0001751 0001751 00000226716 12645400276 015152 0000000 0000000 # Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 2015 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
TESTS = test_libguac$(EXEEXT)
check_PROGRAMS = test_libguac$(EXEEXT)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp $(noinst_HEADERS) \
$(top_srcdir)/test-driver
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__dirstamp = $(am__leading_dot)dirstamp
am_test_libguac_OBJECTS = test_libguac-test_libguac.$(OBJEXT) \
client/test_libguac-client_suite.$(OBJEXT) \
client/test_libguac-buffer_pool.$(OBJEXT) \
client/test_libguac-layer_pool.$(OBJEXT) \
common/test_libguac-common_suite.$(OBJEXT) \
common/test_libguac-guac_iconv.$(OBJEXT) \
common/test_libguac-guac_string.$(OBJEXT) \
common/test_libguac-guac_rect.$(OBJEXT) \
protocol/test_libguac-suite.$(OBJEXT) \
protocol/test_libguac-base64_decode.$(OBJEXT) \
protocol/test_libguac-instruction_parse.$(OBJEXT) \
protocol/test_libguac-instruction_read.$(OBJEXT) \
protocol/test_libguac-instruction_write.$(OBJEXT) \
protocol/test_libguac-nest_write.$(OBJEXT) \
util/test_libguac-util_suite.$(OBJEXT) \
util/test_libguac-guac_pool.$(OBJEXT) \
util/test_libguac-guac_unicode.$(OBJEXT)
test_libguac_OBJECTS = $(am_test_libguac_OBJECTS)
test_libguac_DEPENDENCIES =
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
test_libguac_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_libguac_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(test_libguac_SOURCES)
DIST_SOURCES = $(test_libguac_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
am__tty_colors = { \
$(am__tty_colors_dummy); \
if test "X$(AM_COLOR_TESTS)" = Xno; then \
am__color_tests=no; \
elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
am__color_tests=yes; \
elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
am__color_tests=yes; \
fi; \
if test $$am__color_tests = yes; then \
red='[0;31m'; \
grn='[0;32m'; \
lgn='[1;32m'; \
blu='[1;34m'; \
mgn='[0;35m'; \
brg='[1m'; \
std='[m'; \
fi; \
}
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__recheck_rx = ^[ ]*:recheck:[ ]*
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
# A command that, given a newline-separated list of test names on the
# standard input, print the name of the tests that are to be re-run
# upon "make recheck".
am__list_recheck_tests = $(AWK) '{ \
recheck = 1; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
{ \
if ((getline line2 < ($$0 ".log")) < 0) \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
{ \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
{ \
break; \
} \
}; \
if (recheck) \
print $$0; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# A command that, given a newline-separated list of test names on the
# standard input, create the global log from their .trs and .log files.
am__create_global_log = $(AWK) ' \
function fatal(msg) \
{ \
print "fatal: making $@: " msg | "cat >&2"; \
exit 1; \
} \
function rst_section(header) \
{ \
print header; \
len = length(header); \
for (i = 1; i <= len; i = i + 1) \
printf "="; \
printf "\n\n"; \
} \
{ \
copy_in_global_log = 1; \
global_test_result = "RUN"; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".trs"); \
if (line ~ /$(am__global_test_result_rx)/) \
{ \
sub("$(am__global_test_result_rx)", "", line); \
sub("[ ]*$$", "", line); \
global_test_result = line; \
} \
else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
copy_in_global_log = 0; \
}; \
if (copy_in_global_log) \
{ \
rst_section(global_test_result ": " $$0); \
while ((rc = (getline line < ($$0 ".log"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".log"); \
print line; \
}; \
printf "\n"; \
}; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# Restructured Text title.
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
# Solaris 10 'make', and several other traditional 'make' implementations,
# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
# by disabling -e (using the XSI extension "set +e") if it's set.
am__sh_e_setup = case $$- in *e*) set +e;; esac
# Default flags passed to test drivers.
am__common_driver_flags = \
--color-tests "$$am__color_tests" \
--enable-hard-errors "$$am__enable_hard_errors" \
--expect-failure "$$am__expect_failure"
# To be inserted before the command running the test. Creates the
# directory for the log if needed. Stores in $dir the directory
# containing $f, in $tst the test, in $log the log. Executes the
# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
# will run the test scripts (or their associated LOG_COMPILER, if
# thy have one).
am__check_pre = \
$(am__sh_e_setup); \
$(am__vpath_adj_setup) $(am__vpath_adj) \
$(am__tty_colors); \
srcdir=$(srcdir); export srcdir; \
case "$@" in \
*/*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
*) am__odir=.;; \
esac; \
test "x$$am__odir" = x"." || test -d "$$am__odir" \
|| $(MKDIR_P) "$$am__odir" || exit $$?; \
if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; \
if test -n '$(DISABLE_HARD_ERRORS)'; then \
am__enable_hard_errors=no; \
else \
am__enable_hard_errors=yes; \
fi; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
am__expect_failure=yes;; \
*) \
am__expect_failure=no;; \
esac; \
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
# A shell command to get the names of the tests scripts with any registered
# extension removed (i.e., equivalently, the names of the test logs, with
# the '.log' extension removed). The result is saved in the shell variable
# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
# since that might cause problem with VPATH rewrites for suffix-less tests.
# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
am__set_b = \
case '$@' in \
*/*) \
case '$*' in \
*/*) b='$*';; \
*) b=`echo '$@' | sed 's/\.log$$//'`; \
esac;; \
*) \
b='$*';; \
esac
am__test_logs1 = $(TESTS:=.log)
am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
TEST_LOGS = $(am__test_logs2:.test.log=.log)
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CAIRO_LIBS = @CAIRO_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMMON_INCLUDE = @COMMON_INCLUDE@
COMMON_LTLIB = @COMMON_LTLIB@
COMMON_SSH_INCLUDE = @COMMON_SSH_INCLUDE@
COMMON_SSH_LTLIB = @COMMON_SSH_LTLIB@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CUNIT_LIBS = @CUNIT_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JPEG_LIBS = @JPEG_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBADD_DLOPEN = @LIBADD_DLOPEN@
LIBGUAC_INCLUDE = @LIBGUAC_INCLUDE@
LIBGUAC_LTLIB = @LIBGUAC_LTLIB@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PANGOCAIRO_CFLAGS = @PANGOCAIRO_CFLAGS@
PANGOCAIRO_LIBS = @PANGOCAIRO_LIBS@
PANGO_CFLAGS = @PANGO_CFLAGS@
PANGO_LIBS = @PANGO_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PNG_LIBS = @PNG_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
PULSE_LIBS = @PULSE_LIBS@
RANLIB = @RANLIB@
RDP_LIBS = @RDP_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SSH_LIBS = @SSH_LIBS@
SSL_LIBS = @SSL_LIBS@
STRIP = @STRIP@
TELNET_LIBS = @TELNET_LIBS@
TERMINAL_INCLUDE = @TERMINAL_INCLUDE@
TERMINAL_LTLIB = @TERMINAL_LTLIB@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
VNC_LIBS = @VNC_LIBS@
VORBIS_LIBS = @VORBIS_LIBS@
WEBP_LIBS = @WEBP_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
init_dir = @init_dir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
noinst_HEADERS = \
client/client_suite.h \
common/common_suite.h \
protocol/suite.h \
util/util_suite.h
test_libguac_SOURCES = \
test_libguac.c \
client/client_suite.c \
client/buffer_pool.c \
client/layer_pool.c \
common/common_suite.c \
common/guac_iconv.c \
common/guac_string.c \
common/guac_rect.c \
protocol/suite.c \
protocol/base64_decode.c \
protocol/instruction_parse.c \
protocol/instruction_read.c \
protocol/instruction_write.c \
protocol/nest_write.c \
util/util_suite.c \
util/guac_pool.c \
util/guac_unicode.c
test_libguac_CFLAGS = \
-Werror -Wall -pedantic \
@COMMON_INCLUDE@ \
@LIBGUAC_INCLUDE@
test_libguac_LDADD = \
@COMMON_LTLIB@ \
@CUNIT_LIBS@ \
@LIBGUAC_LTLIB@
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
client/$(am__dirstamp):
@$(MKDIR_P) client
@: > client/$(am__dirstamp)
client/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) client/$(DEPDIR)
@: > client/$(DEPDIR)/$(am__dirstamp)
client/test_libguac-client_suite.$(OBJEXT): client/$(am__dirstamp) \
client/$(DEPDIR)/$(am__dirstamp)
client/test_libguac-buffer_pool.$(OBJEXT): client/$(am__dirstamp) \
client/$(DEPDIR)/$(am__dirstamp)
client/test_libguac-layer_pool.$(OBJEXT): client/$(am__dirstamp) \
client/$(DEPDIR)/$(am__dirstamp)
common/$(am__dirstamp):
@$(MKDIR_P) common
@: > common/$(am__dirstamp)
common/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) common/$(DEPDIR)
@: > common/$(DEPDIR)/$(am__dirstamp)
common/test_libguac-common_suite.$(OBJEXT): common/$(am__dirstamp) \
common/$(DEPDIR)/$(am__dirstamp)
common/test_libguac-guac_iconv.$(OBJEXT): common/$(am__dirstamp) \
common/$(DEPDIR)/$(am__dirstamp)
common/test_libguac-guac_string.$(OBJEXT): common/$(am__dirstamp) \
common/$(DEPDIR)/$(am__dirstamp)
common/test_libguac-guac_rect.$(OBJEXT): common/$(am__dirstamp) \
common/$(DEPDIR)/$(am__dirstamp)
protocol/$(am__dirstamp):
@$(MKDIR_P) protocol
@: > protocol/$(am__dirstamp)
protocol/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) protocol/$(DEPDIR)
@: > protocol/$(DEPDIR)/$(am__dirstamp)
protocol/test_libguac-suite.$(OBJEXT): protocol/$(am__dirstamp) \
protocol/$(DEPDIR)/$(am__dirstamp)
protocol/test_libguac-base64_decode.$(OBJEXT): \
protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp)
protocol/test_libguac-instruction_parse.$(OBJEXT): \
protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp)
protocol/test_libguac-instruction_read.$(OBJEXT): \
protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp)
protocol/test_libguac-instruction_write.$(OBJEXT): \
protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp)
protocol/test_libguac-nest_write.$(OBJEXT): protocol/$(am__dirstamp) \
protocol/$(DEPDIR)/$(am__dirstamp)
util/$(am__dirstamp):
@$(MKDIR_P) util
@: > util/$(am__dirstamp)
util/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) util/$(DEPDIR)
@: > util/$(DEPDIR)/$(am__dirstamp)
util/test_libguac-util_suite.$(OBJEXT): util/$(am__dirstamp) \
util/$(DEPDIR)/$(am__dirstamp)
util/test_libguac-guac_pool.$(OBJEXT): util/$(am__dirstamp) \
util/$(DEPDIR)/$(am__dirstamp)
util/test_libguac-guac_unicode.$(OBJEXT): util/$(am__dirstamp) \
util/$(DEPDIR)/$(am__dirstamp)
test_libguac$(EXEEXT): $(test_libguac_OBJECTS) $(test_libguac_DEPENDENCIES) $(EXTRA_test_libguac_DEPENDENCIES)
@rm -f test_libguac$(EXEEXT)
$(AM_V_CCLD)$(test_libguac_LINK) $(test_libguac_OBJECTS) $(test_libguac_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
-rm -f client/*.$(OBJEXT)
-rm -f common/*.$(OBJEXT)
-rm -f protocol/*.$(OBJEXT)
-rm -f util/*.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libguac-test_libguac.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/test_libguac-buffer_pool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/test_libguac-client_suite.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/test_libguac-layer_pool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/test_libguac-common_suite.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/test_libguac-guac_iconv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/test_libguac-guac_rect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/test_libguac-guac_string.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/test_libguac-base64_decode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/test_libguac-instruction_parse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/test_libguac-instruction_read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/test_libguac-instruction_write.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/test_libguac-nest_write.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/test_libguac-suite.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/test_libguac-guac_pool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/test_libguac-guac_unicode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/test_libguac-util_suite.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
test_libguac-test_libguac.o: test_libguac.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT test_libguac-test_libguac.o -MD -MP -MF $(DEPDIR)/test_libguac-test_libguac.Tpo -c -o test_libguac-test_libguac.o `test -f 'test_libguac.c' || echo '$(srcdir)/'`test_libguac.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libguac-test_libguac.Tpo $(DEPDIR)/test_libguac-test_libguac.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libguac.c' object='test_libguac-test_libguac.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o test_libguac-test_libguac.o `test -f 'test_libguac.c' || echo '$(srcdir)/'`test_libguac.c
test_libguac-test_libguac.obj: test_libguac.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT test_libguac-test_libguac.obj -MD -MP -MF $(DEPDIR)/test_libguac-test_libguac.Tpo -c -o test_libguac-test_libguac.obj `if test -f 'test_libguac.c'; then $(CYGPATH_W) 'test_libguac.c'; else $(CYGPATH_W) '$(srcdir)/test_libguac.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libguac-test_libguac.Tpo $(DEPDIR)/test_libguac-test_libguac.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libguac.c' object='test_libguac-test_libguac.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o test_libguac-test_libguac.obj `if test -f 'test_libguac.c'; then $(CYGPATH_W) 'test_libguac.c'; else $(CYGPATH_W) '$(srcdir)/test_libguac.c'; fi`
client/test_libguac-client_suite.o: client/client_suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT client/test_libguac-client_suite.o -MD -MP -MF client/$(DEPDIR)/test_libguac-client_suite.Tpo -c -o client/test_libguac-client_suite.o `test -f 'client/client_suite.c' || echo '$(srcdir)/'`client/client_suite.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) client/$(DEPDIR)/test_libguac-client_suite.Tpo client/$(DEPDIR)/test_libguac-client_suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client/client_suite.c' object='client/test_libguac-client_suite.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o client/test_libguac-client_suite.o `test -f 'client/client_suite.c' || echo '$(srcdir)/'`client/client_suite.c
client/test_libguac-client_suite.obj: client/client_suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT client/test_libguac-client_suite.obj -MD -MP -MF client/$(DEPDIR)/test_libguac-client_suite.Tpo -c -o client/test_libguac-client_suite.obj `if test -f 'client/client_suite.c'; then $(CYGPATH_W) 'client/client_suite.c'; else $(CYGPATH_W) '$(srcdir)/client/client_suite.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) client/$(DEPDIR)/test_libguac-client_suite.Tpo client/$(DEPDIR)/test_libguac-client_suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client/client_suite.c' object='client/test_libguac-client_suite.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o client/test_libguac-client_suite.obj `if test -f 'client/client_suite.c'; then $(CYGPATH_W) 'client/client_suite.c'; else $(CYGPATH_W) '$(srcdir)/client/client_suite.c'; fi`
client/test_libguac-buffer_pool.o: client/buffer_pool.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT client/test_libguac-buffer_pool.o -MD -MP -MF client/$(DEPDIR)/test_libguac-buffer_pool.Tpo -c -o client/test_libguac-buffer_pool.o `test -f 'client/buffer_pool.c' || echo '$(srcdir)/'`client/buffer_pool.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) client/$(DEPDIR)/test_libguac-buffer_pool.Tpo client/$(DEPDIR)/test_libguac-buffer_pool.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client/buffer_pool.c' object='client/test_libguac-buffer_pool.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o client/test_libguac-buffer_pool.o `test -f 'client/buffer_pool.c' || echo '$(srcdir)/'`client/buffer_pool.c
client/test_libguac-buffer_pool.obj: client/buffer_pool.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT client/test_libguac-buffer_pool.obj -MD -MP -MF client/$(DEPDIR)/test_libguac-buffer_pool.Tpo -c -o client/test_libguac-buffer_pool.obj `if test -f 'client/buffer_pool.c'; then $(CYGPATH_W) 'client/buffer_pool.c'; else $(CYGPATH_W) '$(srcdir)/client/buffer_pool.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) client/$(DEPDIR)/test_libguac-buffer_pool.Tpo client/$(DEPDIR)/test_libguac-buffer_pool.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client/buffer_pool.c' object='client/test_libguac-buffer_pool.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o client/test_libguac-buffer_pool.obj `if test -f 'client/buffer_pool.c'; then $(CYGPATH_W) 'client/buffer_pool.c'; else $(CYGPATH_W) '$(srcdir)/client/buffer_pool.c'; fi`
client/test_libguac-layer_pool.o: client/layer_pool.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT client/test_libguac-layer_pool.o -MD -MP -MF client/$(DEPDIR)/test_libguac-layer_pool.Tpo -c -o client/test_libguac-layer_pool.o `test -f 'client/layer_pool.c' || echo '$(srcdir)/'`client/layer_pool.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) client/$(DEPDIR)/test_libguac-layer_pool.Tpo client/$(DEPDIR)/test_libguac-layer_pool.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client/layer_pool.c' object='client/test_libguac-layer_pool.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o client/test_libguac-layer_pool.o `test -f 'client/layer_pool.c' || echo '$(srcdir)/'`client/layer_pool.c
client/test_libguac-layer_pool.obj: client/layer_pool.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT client/test_libguac-layer_pool.obj -MD -MP -MF client/$(DEPDIR)/test_libguac-layer_pool.Tpo -c -o client/test_libguac-layer_pool.obj `if test -f 'client/layer_pool.c'; then $(CYGPATH_W) 'client/layer_pool.c'; else $(CYGPATH_W) '$(srcdir)/client/layer_pool.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) client/$(DEPDIR)/test_libguac-layer_pool.Tpo client/$(DEPDIR)/test_libguac-layer_pool.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client/layer_pool.c' object='client/test_libguac-layer_pool.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o client/test_libguac-layer_pool.obj `if test -f 'client/layer_pool.c'; then $(CYGPATH_W) 'client/layer_pool.c'; else $(CYGPATH_W) '$(srcdir)/client/layer_pool.c'; fi`
common/test_libguac-common_suite.o: common/common_suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-common_suite.o -MD -MP -MF common/$(DEPDIR)/test_libguac-common_suite.Tpo -c -o common/test_libguac-common_suite.o `test -f 'common/common_suite.c' || echo '$(srcdir)/'`common/common_suite.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-common_suite.Tpo common/$(DEPDIR)/test_libguac-common_suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/common_suite.c' object='common/test_libguac-common_suite.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-common_suite.o `test -f 'common/common_suite.c' || echo '$(srcdir)/'`common/common_suite.c
common/test_libguac-common_suite.obj: common/common_suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-common_suite.obj -MD -MP -MF common/$(DEPDIR)/test_libguac-common_suite.Tpo -c -o common/test_libguac-common_suite.obj `if test -f 'common/common_suite.c'; then $(CYGPATH_W) 'common/common_suite.c'; else $(CYGPATH_W) '$(srcdir)/common/common_suite.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-common_suite.Tpo common/$(DEPDIR)/test_libguac-common_suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/common_suite.c' object='common/test_libguac-common_suite.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-common_suite.obj `if test -f 'common/common_suite.c'; then $(CYGPATH_W) 'common/common_suite.c'; else $(CYGPATH_W) '$(srcdir)/common/common_suite.c'; fi`
common/test_libguac-guac_iconv.o: common/guac_iconv.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-guac_iconv.o -MD -MP -MF common/$(DEPDIR)/test_libguac-guac_iconv.Tpo -c -o common/test_libguac-guac_iconv.o `test -f 'common/guac_iconv.c' || echo '$(srcdir)/'`common/guac_iconv.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-guac_iconv.Tpo common/$(DEPDIR)/test_libguac-guac_iconv.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/guac_iconv.c' object='common/test_libguac-guac_iconv.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-guac_iconv.o `test -f 'common/guac_iconv.c' || echo '$(srcdir)/'`common/guac_iconv.c
common/test_libguac-guac_iconv.obj: common/guac_iconv.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-guac_iconv.obj -MD -MP -MF common/$(DEPDIR)/test_libguac-guac_iconv.Tpo -c -o common/test_libguac-guac_iconv.obj `if test -f 'common/guac_iconv.c'; then $(CYGPATH_W) 'common/guac_iconv.c'; else $(CYGPATH_W) '$(srcdir)/common/guac_iconv.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-guac_iconv.Tpo common/$(DEPDIR)/test_libguac-guac_iconv.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/guac_iconv.c' object='common/test_libguac-guac_iconv.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-guac_iconv.obj `if test -f 'common/guac_iconv.c'; then $(CYGPATH_W) 'common/guac_iconv.c'; else $(CYGPATH_W) '$(srcdir)/common/guac_iconv.c'; fi`
common/test_libguac-guac_string.o: common/guac_string.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-guac_string.o -MD -MP -MF common/$(DEPDIR)/test_libguac-guac_string.Tpo -c -o common/test_libguac-guac_string.o `test -f 'common/guac_string.c' || echo '$(srcdir)/'`common/guac_string.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-guac_string.Tpo common/$(DEPDIR)/test_libguac-guac_string.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/guac_string.c' object='common/test_libguac-guac_string.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-guac_string.o `test -f 'common/guac_string.c' || echo '$(srcdir)/'`common/guac_string.c
common/test_libguac-guac_string.obj: common/guac_string.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-guac_string.obj -MD -MP -MF common/$(DEPDIR)/test_libguac-guac_string.Tpo -c -o common/test_libguac-guac_string.obj `if test -f 'common/guac_string.c'; then $(CYGPATH_W) 'common/guac_string.c'; else $(CYGPATH_W) '$(srcdir)/common/guac_string.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-guac_string.Tpo common/$(DEPDIR)/test_libguac-guac_string.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/guac_string.c' object='common/test_libguac-guac_string.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-guac_string.obj `if test -f 'common/guac_string.c'; then $(CYGPATH_W) 'common/guac_string.c'; else $(CYGPATH_W) '$(srcdir)/common/guac_string.c'; fi`
common/test_libguac-guac_rect.o: common/guac_rect.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-guac_rect.o -MD -MP -MF common/$(DEPDIR)/test_libguac-guac_rect.Tpo -c -o common/test_libguac-guac_rect.o `test -f 'common/guac_rect.c' || echo '$(srcdir)/'`common/guac_rect.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-guac_rect.Tpo common/$(DEPDIR)/test_libguac-guac_rect.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/guac_rect.c' object='common/test_libguac-guac_rect.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-guac_rect.o `test -f 'common/guac_rect.c' || echo '$(srcdir)/'`common/guac_rect.c
common/test_libguac-guac_rect.obj: common/guac_rect.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT common/test_libguac-guac_rect.obj -MD -MP -MF common/$(DEPDIR)/test_libguac-guac_rect.Tpo -c -o common/test_libguac-guac_rect.obj `if test -f 'common/guac_rect.c'; then $(CYGPATH_W) 'common/guac_rect.c'; else $(CYGPATH_W) '$(srcdir)/common/guac_rect.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) common/$(DEPDIR)/test_libguac-guac_rect.Tpo common/$(DEPDIR)/test_libguac-guac_rect.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common/guac_rect.c' object='common/test_libguac-guac_rect.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o common/test_libguac-guac_rect.obj `if test -f 'common/guac_rect.c'; then $(CYGPATH_W) 'common/guac_rect.c'; else $(CYGPATH_W) '$(srcdir)/common/guac_rect.c'; fi`
protocol/test_libguac-suite.o: protocol/suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-suite.o -MD -MP -MF protocol/$(DEPDIR)/test_libguac-suite.Tpo -c -o protocol/test_libguac-suite.o `test -f 'protocol/suite.c' || echo '$(srcdir)/'`protocol/suite.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-suite.Tpo protocol/$(DEPDIR)/test_libguac-suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/suite.c' object='protocol/test_libguac-suite.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-suite.o `test -f 'protocol/suite.c' || echo '$(srcdir)/'`protocol/suite.c
protocol/test_libguac-suite.obj: protocol/suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-suite.obj -MD -MP -MF protocol/$(DEPDIR)/test_libguac-suite.Tpo -c -o protocol/test_libguac-suite.obj `if test -f 'protocol/suite.c'; then $(CYGPATH_W) 'protocol/suite.c'; else $(CYGPATH_W) '$(srcdir)/protocol/suite.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-suite.Tpo protocol/$(DEPDIR)/test_libguac-suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/suite.c' object='protocol/test_libguac-suite.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-suite.obj `if test -f 'protocol/suite.c'; then $(CYGPATH_W) 'protocol/suite.c'; else $(CYGPATH_W) '$(srcdir)/protocol/suite.c'; fi`
protocol/test_libguac-base64_decode.o: protocol/base64_decode.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-base64_decode.o -MD -MP -MF protocol/$(DEPDIR)/test_libguac-base64_decode.Tpo -c -o protocol/test_libguac-base64_decode.o `test -f 'protocol/base64_decode.c' || echo '$(srcdir)/'`protocol/base64_decode.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-base64_decode.Tpo protocol/$(DEPDIR)/test_libguac-base64_decode.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/base64_decode.c' object='protocol/test_libguac-base64_decode.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-base64_decode.o `test -f 'protocol/base64_decode.c' || echo '$(srcdir)/'`protocol/base64_decode.c
protocol/test_libguac-base64_decode.obj: protocol/base64_decode.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-base64_decode.obj -MD -MP -MF protocol/$(DEPDIR)/test_libguac-base64_decode.Tpo -c -o protocol/test_libguac-base64_decode.obj `if test -f 'protocol/base64_decode.c'; then $(CYGPATH_W) 'protocol/base64_decode.c'; else $(CYGPATH_W) '$(srcdir)/protocol/base64_decode.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-base64_decode.Tpo protocol/$(DEPDIR)/test_libguac-base64_decode.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/base64_decode.c' object='protocol/test_libguac-base64_decode.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-base64_decode.obj `if test -f 'protocol/base64_decode.c'; then $(CYGPATH_W) 'protocol/base64_decode.c'; else $(CYGPATH_W) '$(srcdir)/protocol/base64_decode.c'; fi`
protocol/test_libguac-instruction_parse.o: protocol/instruction_parse.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-instruction_parse.o -MD -MP -MF protocol/$(DEPDIR)/test_libguac-instruction_parse.Tpo -c -o protocol/test_libguac-instruction_parse.o `test -f 'protocol/instruction_parse.c' || echo '$(srcdir)/'`protocol/instruction_parse.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-instruction_parse.Tpo protocol/$(DEPDIR)/test_libguac-instruction_parse.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/instruction_parse.c' object='protocol/test_libguac-instruction_parse.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-instruction_parse.o `test -f 'protocol/instruction_parse.c' || echo '$(srcdir)/'`protocol/instruction_parse.c
protocol/test_libguac-instruction_parse.obj: protocol/instruction_parse.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-instruction_parse.obj -MD -MP -MF protocol/$(DEPDIR)/test_libguac-instruction_parse.Tpo -c -o protocol/test_libguac-instruction_parse.obj `if test -f 'protocol/instruction_parse.c'; then $(CYGPATH_W) 'protocol/instruction_parse.c'; else $(CYGPATH_W) '$(srcdir)/protocol/instruction_parse.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-instruction_parse.Tpo protocol/$(DEPDIR)/test_libguac-instruction_parse.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/instruction_parse.c' object='protocol/test_libguac-instruction_parse.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-instruction_parse.obj `if test -f 'protocol/instruction_parse.c'; then $(CYGPATH_W) 'protocol/instruction_parse.c'; else $(CYGPATH_W) '$(srcdir)/protocol/instruction_parse.c'; fi`
protocol/test_libguac-instruction_read.o: protocol/instruction_read.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-instruction_read.o -MD -MP -MF protocol/$(DEPDIR)/test_libguac-instruction_read.Tpo -c -o protocol/test_libguac-instruction_read.o `test -f 'protocol/instruction_read.c' || echo '$(srcdir)/'`protocol/instruction_read.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-instruction_read.Tpo protocol/$(DEPDIR)/test_libguac-instruction_read.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/instruction_read.c' object='protocol/test_libguac-instruction_read.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-instruction_read.o `test -f 'protocol/instruction_read.c' || echo '$(srcdir)/'`protocol/instruction_read.c
protocol/test_libguac-instruction_read.obj: protocol/instruction_read.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-instruction_read.obj -MD -MP -MF protocol/$(DEPDIR)/test_libguac-instruction_read.Tpo -c -o protocol/test_libguac-instruction_read.obj `if test -f 'protocol/instruction_read.c'; then $(CYGPATH_W) 'protocol/instruction_read.c'; else $(CYGPATH_W) '$(srcdir)/protocol/instruction_read.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-instruction_read.Tpo protocol/$(DEPDIR)/test_libguac-instruction_read.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/instruction_read.c' object='protocol/test_libguac-instruction_read.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-instruction_read.obj `if test -f 'protocol/instruction_read.c'; then $(CYGPATH_W) 'protocol/instruction_read.c'; else $(CYGPATH_W) '$(srcdir)/protocol/instruction_read.c'; fi`
protocol/test_libguac-instruction_write.o: protocol/instruction_write.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-instruction_write.o -MD -MP -MF protocol/$(DEPDIR)/test_libguac-instruction_write.Tpo -c -o protocol/test_libguac-instruction_write.o `test -f 'protocol/instruction_write.c' || echo '$(srcdir)/'`protocol/instruction_write.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-instruction_write.Tpo protocol/$(DEPDIR)/test_libguac-instruction_write.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/instruction_write.c' object='protocol/test_libguac-instruction_write.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-instruction_write.o `test -f 'protocol/instruction_write.c' || echo '$(srcdir)/'`protocol/instruction_write.c
protocol/test_libguac-instruction_write.obj: protocol/instruction_write.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-instruction_write.obj -MD -MP -MF protocol/$(DEPDIR)/test_libguac-instruction_write.Tpo -c -o protocol/test_libguac-instruction_write.obj `if test -f 'protocol/instruction_write.c'; then $(CYGPATH_W) 'protocol/instruction_write.c'; else $(CYGPATH_W) '$(srcdir)/protocol/instruction_write.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-instruction_write.Tpo protocol/$(DEPDIR)/test_libguac-instruction_write.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/instruction_write.c' object='protocol/test_libguac-instruction_write.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-instruction_write.obj `if test -f 'protocol/instruction_write.c'; then $(CYGPATH_W) 'protocol/instruction_write.c'; else $(CYGPATH_W) '$(srcdir)/protocol/instruction_write.c'; fi`
protocol/test_libguac-nest_write.o: protocol/nest_write.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-nest_write.o -MD -MP -MF protocol/$(DEPDIR)/test_libguac-nest_write.Tpo -c -o protocol/test_libguac-nest_write.o `test -f 'protocol/nest_write.c' || echo '$(srcdir)/'`protocol/nest_write.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-nest_write.Tpo protocol/$(DEPDIR)/test_libguac-nest_write.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/nest_write.c' object='protocol/test_libguac-nest_write.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-nest_write.o `test -f 'protocol/nest_write.c' || echo '$(srcdir)/'`protocol/nest_write.c
protocol/test_libguac-nest_write.obj: protocol/nest_write.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT protocol/test_libguac-nest_write.obj -MD -MP -MF protocol/$(DEPDIR)/test_libguac-nest_write.Tpo -c -o protocol/test_libguac-nest_write.obj `if test -f 'protocol/nest_write.c'; then $(CYGPATH_W) 'protocol/nest_write.c'; else $(CYGPATH_W) '$(srcdir)/protocol/nest_write.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/test_libguac-nest_write.Tpo protocol/$(DEPDIR)/test_libguac-nest_write.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/nest_write.c' object='protocol/test_libguac-nest_write.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o protocol/test_libguac-nest_write.obj `if test -f 'protocol/nest_write.c'; then $(CYGPATH_W) 'protocol/nest_write.c'; else $(CYGPATH_W) '$(srcdir)/protocol/nest_write.c'; fi`
util/test_libguac-util_suite.o: util/util_suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT util/test_libguac-util_suite.o -MD -MP -MF util/$(DEPDIR)/test_libguac-util_suite.Tpo -c -o util/test_libguac-util_suite.o `test -f 'util/util_suite.c' || echo '$(srcdir)/'`util/util_suite.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/test_libguac-util_suite.Tpo util/$(DEPDIR)/test_libguac-util_suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/util_suite.c' object='util/test_libguac-util_suite.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o util/test_libguac-util_suite.o `test -f 'util/util_suite.c' || echo '$(srcdir)/'`util/util_suite.c
util/test_libguac-util_suite.obj: util/util_suite.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT util/test_libguac-util_suite.obj -MD -MP -MF util/$(DEPDIR)/test_libguac-util_suite.Tpo -c -o util/test_libguac-util_suite.obj `if test -f 'util/util_suite.c'; then $(CYGPATH_W) 'util/util_suite.c'; else $(CYGPATH_W) '$(srcdir)/util/util_suite.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/test_libguac-util_suite.Tpo util/$(DEPDIR)/test_libguac-util_suite.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/util_suite.c' object='util/test_libguac-util_suite.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o util/test_libguac-util_suite.obj `if test -f 'util/util_suite.c'; then $(CYGPATH_W) 'util/util_suite.c'; else $(CYGPATH_W) '$(srcdir)/util/util_suite.c'; fi`
util/test_libguac-guac_pool.o: util/guac_pool.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT util/test_libguac-guac_pool.o -MD -MP -MF util/$(DEPDIR)/test_libguac-guac_pool.Tpo -c -o util/test_libguac-guac_pool.o `test -f 'util/guac_pool.c' || echo '$(srcdir)/'`util/guac_pool.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/test_libguac-guac_pool.Tpo util/$(DEPDIR)/test_libguac-guac_pool.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/guac_pool.c' object='util/test_libguac-guac_pool.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o util/test_libguac-guac_pool.o `test -f 'util/guac_pool.c' || echo '$(srcdir)/'`util/guac_pool.c
util/test_libguac-guac_pool.obj: util/guac_pool.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT util/test_libguac-guac_pool.obj -MD -MP -MF util/$(DEPDIR)/test_libguac-guac_pool.Tpo -c -o util/test_libguac-guac_pool.obj `if test -f 'util/guac_pool.c'; then $(CYGPATH_W) 'util/guac_pool.c'; else $(CYGPATH_W) '$(srcdir)/util/guac_pool.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/test_libguac-guac_pool.Tpo util/$(DEPDIR)/test_libguac-guac_pool.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/guac_pool.c' object='util/test_libguac-guac_pool.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o util/test_libguac-guac_pool.obj `if test -f 'util/guac_pool.c'; then $(CYGPATH_W) 'util/guac_pool.c'; else $(CYGPATH_W) '$(srcdir)/util/guac_pool.c'; fi`
util/test_libguac-guac_unicode.o: util/guac_unicode.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT util/test_libguac-guac_unicode.o -MD -MP -MF util/$(DEPDIR)/test_libguac-guac_unicode.Tpo -c -o util/test_libguac-guac_unicode.o `test -f 'util/guac_unicode.c' || echo '$(srcdir)/'`util/guac_unicode.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/test_libguac-guac_unicode.Tpo util/$(DEPDIR)/test_libguac-guac_unicode.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/guac_unicode.c' object='util/test_libguac-guac_unicode.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o util/test_libguac-guac_unicode.o `test -f 'util/guac_unicode.c' || echo '$(srcdir)/'`util/guac_unicode.c
util/test_libguac-guac_unicode.obj: util/guac_unicode.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -MT util/test_libguac-guac_unicode.obj -MD -MP -MF util/$(DEPDIR)/test_libguac-guac_unicode.Tpo -c -o util/test_libguac-guac_unicode.obj `if test -f 'util/guac_unicode.c'; then $(CYGPATH_W) 'util/guac_unicode.c'; else $(CYGPATH_W) '$(srcdir)/util/guac_unicode.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/test_libguac-guac_unicode.Tpo util/$(DEPDIR)/test_libguac-guac_unicode.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/guac_unicode.c' object='util/test_libguac-guac_unicode.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libguac_CFLAGS) $(CFLAGS) -c -o util/test_libguac-guac_unicode.obj `if test -f 'util/guac_unicode.c'; then $(CYGPATH_W) 'util/guac_unicode.c'; else $(CYGPATH_W) '$(srcdir)/util/guac_unicode.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
# Recover from deleted '.trs' file; this should ensure that
# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
# to avoid problems with "make -n".
.log.trs:
rm -f $< $@
$(MAKE) $(AM_MAKEFLAGS) $<
# Leading 'am--fnord' is there to ensure the list of targets does not
# expand to empty, as could happen e.g. with make check TESTS=''.
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
am--force-recheck:
@:
$(TEST_SUITE_LOG): $(TEST_LOGS)
@$(am__set_TESTS_bases); \
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
redo_bases=`for i in $$bases; do \
am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
done`; \
if test -n "$$redo_bases"; then \
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
if $(am__make_dryrun); then :; else \
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
fi; \
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
else \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
st=0; \
errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
for i in $$redo_bases; do \
test -f $$i.trs && test -r $$i.trs \
|| { echo "$$errmsg $$i.trs" >&2; st=1; }; \
test -f $$i.log && test -r $$i.log \
|| { echo "$$errmsg $$i.log" >&2; st=1; }; \
done; \
test $$st -eq 0 || exit 1; \
fi
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
ws='[ ]'; \
results=`for b in $$bases; do echo $$b.trs; done`; \
test -n "$$results" || results=/dev/null; \
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
success=true; \
else \
success=false; \
fi; \
br='==================='; br=$$br$$br$$br$$br; \
result_count () \
{ \
if test x"$$1" = x"--maybe-color"; then \
maybe_colorize=yes; \
elif test x"$$1" = x"--no-color"; then \
maybe_colorize=no; \
else \
echo "$@: invalid 'result_count' usage" >&2; exit 4; \
fi; \
shift; \
desc=$$1 count=$$2; \
if test $$maybe_colorize = yes && test $$count -gt 0; then \
color_start=$$3 color_end=$$std; \
else \
color_start= color_end=; \
fi; \
echo "$${color_start}# $$desc $$count$${color_end}"; \
}; \
create_testsuite_report () \
{ \
result_count $$1 "TOTAL:" $$all "$$brg"; \
result_count $$1 "PASS: " $$pass "$$grn"; \
result_count $$1 "SKIP: " $$skip "$$blu"; \
result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
result_count $$1 "FAIL: " $$fail "$$red"; \
result_count $$1 "XPASS:" $$xpass "$$red"; \
result_count $$1 "ERROR:" $$error "$$mgn"; \
}; \
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
create_testsuite_report --no-color; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
for b in $$bases; do echo $$b; done \
| $(am__create_global_log); \
} >$(TEST_SUITE_LOG).tmp || exit 1; \
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
if $$success; then \
col="$$grn"; \
else \
col="$$red"; \
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
if $$success; then :; else \
echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
if test -n "$(PACKAGE_BUGREPORT)"; then \
echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
fi; \
echo "$$col$$br$$std"; \
fi; \
$$success || exit 1
check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
log_list=`for i in $$bases; do echo $$i.log; done`; \
trs_list=`for i in $$bases; do echo $$i.trs; done`; \
log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
exit $$?;
recheck: all $(check_PROGRAMS)
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
bases=`for i in $$bases; do echo $$i; done \
| $(am__list_recheck_tests)` || exit 1; \
log_list=`for i in $$bases; do echo $$i.log; done`; \
log_list=`echo $$log_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
test_libguac.log: test_libguac$(EXEEXT)
@p='test_libguac$(EXEEXT)'; \
b='test_libguac'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
@p='$<'; \
$(am__set_b); \
$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
@am__EXEEXT_TRUE@.test$(EXEEXT).log:
@am__EXEEXT_TRUE@ @p='$<'; \
@am__EXEEXT_TRUE@ $(am__set_b); \
@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f client/$(DEPDIR)/$(am__dirstamp)
-rm -f client/$(am__dirstamp)
-rm -f common/$(DEPDIR)/$(am__dirstamp)
-rm -f common/$(am__dirstamp)
-rm -f protocol/$(DEPDIR)/$(am__dirstamp)
-rm -f protocol/$(am__dirstamp)
-rm -f util/$(DEPDIR)/$(am__dirstamp)
-rm -f util/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR) client/$(DEPDIR) common/$(DEPDIR) protocol/$(DEPDIR) util/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR) client/$(DEPDIR) common/$(DEPDIR) protocol/$(DEPDIR) util/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
recheck tags tags-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
guacamole-server-0.9.9/tests/common/ 0000775 0001751 0001751 00000000000 12645400336 014434 5 0000000 0000000 guacamole-server-0.9.9/tests/common/guac_string.c 0000664 0001751 0001751 00000004435 12536405625 017040 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "common_suite.h"
#include "guac_string.h"
#include
#include
void test_guac_string() {
char** tokens;
/* Test occurrence counting */
CU_ASSERT_EQUAL(4, guac_count_occurrences("this is a test string", 's'));
CU_ASSERT_EQUAL(3, guac_count_occurrences("this is a test string", 'i'));
CU_ASSERT_EQUAL(0, guac_count_occurrences("", 's'));
/* Split test string */
tokens = guac_split("this is a test string", ' ');
CU_ASSERT_PTR_NOT_NULL(tokens);
/* Check resulting tokens */
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[0]);
CU_ASSERT_STRING_EQUAL("this", tokens[0]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[1]);
CU_ASSERT_STRING_EQUAL("is", tokens[1]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[2]);
CU_ASSERT_STRING_EQUAL("a", tokens[2]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[3]);
CU_ASSERT_STRING_EQUAL("test", tokens[3]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[4]);
CU_ASSERT_STRING_EQUAL("string", tokens[4]);
CU_ASSERT_PTR_NULL(tokens[5]);
/* Clean up */
free(tokens[0]);
free(tokens[1]);
free(tokens[2]);
free(tokens[3]);
free(tokens[4]);
free(tokens);
}
guacamole-server-0.9.9/tests/common/guac_rect.c 0000664 0001751 0001751 00000022343 12626133327 016462 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "common_suite.h"
#include "guac_rect.h"
#include
#include
#include
void test_guac_rect() {
guac_common_rect max;
/*
* Test init method
*/
guac_common_rect_init(&max, 0, 0, 100, 100);
CU_ASSERT_EQUAL(0, max.x);
CU_ASSERT_EQUAL(0, max.y);
CU_ASSERT_EQUAL(100, max.width);
CU_ASSERT_EQUAL(100, max.height);
/*
* Test constrain method
*/
guac_common_rect rect;
guac_common_rect_init(&rect, -10, -10, 110, 110);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_constrain(&rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(100, rect.width);
CU_ASSERT_EQUAL(100, rect.height);
/*
* Test extend method
*/
guac_common_rect_init(&rect, 10, 10, 90, 90);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_extend(&rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(100, rect.width);
CU_ASSERT_EQUAL(100, rect.height);
/*
* Test adjust method
*/
int cell_size = 16;
/* Simple adjustment */
guac_common_rect_init(&rect, 0, 0, 25, 25);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(32, rect.width);
CU_ASSERT_EQUAL(32, rect.height);
/* Adjustment with moving of rect */
guac_common_rect_init(&rect, 75, 75, 25, 25);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(max.width - 32, rect.x);
CU_ASSERT_EQUAL(max.height - 32, rect.y);
CU_ASSERT_EQUAL(32, rect.width);
CU_ASSERT_EQUAL(32, rect.height);
guac_common_rect_init(&rect, -5, -5, 25, 25);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(32, rect.width);
CU_ASSERT_EQUAL(32, rect.height);
/* Adjustment with moving and clamping of rect */
guac_common_rect_init(&rect, 0, 0, 25, 15);
guac_common_rect_init(&max, 0, 5, 32, 15);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(max.x, rect.x);
CU_ASSERT_EQUAL(max.y, rect.y);
CU_ASSERT_EQUAL(max.width, rect.width);
CU_ASSERT_EQUAL(max.height, rect.height);
/*
* Rectangle intersection tests
*/
guac_common_rect min;
guac_common_rect_init(&min, 10, 10, 10, 10);
/* Rectangle intersection - empty
* rectangle is outside */
guac_common_rect_init(&rect, 25, 25, 5, 5);
int res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(0, res);
/* Rectangle intersection - complete
* rectangle is completely inside */
guac_common_rect_init(&rect, 11, 11, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(2, res);
/* Rectangle intersection - partial
* rectangle intersects UL */
guac_common_rect_init(&rect, 8, 8, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - partial
* rectangle intersects LR */
guac_common_rect_init(&rect, 18, 18, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - complete
* rect intersects along UL but inside */
guac_common_rect_init(&rect, 10, 10, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(2, res);
/* Rectangle intersection - partial
* rectangle intersects along L but outside */
guac_common_rect_init(&rect, 5, 10, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - complete
* rectangle intersects along LR but rest is inside */
guac_common_rect_init(&rect, 15, 15, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(2, res);
/* Rectangle intersection - partial
* rectangle intersects along R but rest is outside */
guac_common_rect_init(&rect, 20, 10, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - partial
* rectangle encloses min; which is a partial intersection */
guac_common_rect_init(&rect, 5, 5, 20, 20);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/*
* Basic test of clip and split method
*/
guac_common_rect_init(&min, 10, 10, 10, 10);
guac_common_rect cut;
/* Clip top */
guac_common_rect_init(&rect, 10, 5, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(10, cut.x);
CU_ASSERT_EQUAL(5, cut.y);
CU_ASSERT_EQUAL(10, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(10, rect.width);
CU_ASSERT_EQUAL(5, rect.height);
/* Clip bottom */
guac_common_rect_init(&rect, 10, 15, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(10, cut.x);
CU_ASSERT_EQUAL(20, cut.y);
CU_ASSERT_EQUAL(10, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(15, rect.y);
CU_ASSERT_EQUAL(10, rect.width);
CU_ASSERT_EQUAL(5, rect.height);
/* Clip left */
guac_common_rect_init(&rect, 5, 10, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(5, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(10, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(5, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/* Clip right */
guac_common_rect_init(&rect, 15, 10, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(20, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(10, cut.height);
CU_ASSERT_EQUAL(15, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(5, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/*
* Test a rectangle which completely covers the hole.
* Clip and split until done.
*/
guac_common_rect_init(&rect, 5, 5, 20, 20);
/* Clip top */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(5, cut.x);
CU_ASSERT_EQUAL(5, cut.y);
CU_ASSERT_EQUAL(20, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(5, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(20, rect.width);
CU_ASSERT_EQUAL(15, rect.height);
/* Clip left */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(5, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(15, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(15, rect.width);
CU_ASSERT_EQUAL(15, rect.height);
/* Clip bottom */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(10, cut.x);
CU_ASSERT_EQUAL(20, cut.y);
CU_ASSERT_EQUAL(15, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(15, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/* Clip right */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(20, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(10, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(10, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/* Make sure nothing is left to do */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(0, res);
}
guacamole-server-0.9.9/tests/common/guac_iconv.c 0000664 0001751 0001751 00000010637 12536405625 016651 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "common_suite.h"
#include "guac_iconv.h"
#include
#include
static void test_conversion(
guac_iconv_read* reader, unsigned char* in_string, int in_length,
guac_iconv_write* writer, unsigned char* out_string, int out_length) {
char output[4096];
char input[4096];
const char* current_input = input;
char* current_output = output;
memcpy(input, in_string, in_length);
guac_iconv(reader, ¤t_input, sizeof(input),
writer, ¤t_output, sizeof(output));
/* Verify output length */
CU_ASSERT_EQUAL(out_length, current_output - output);
/* Verify entire input read */
CU_ASSERT_EQUAL(in_length, current_input - input);
/* Verify output content */
CU_ASSERT_EQUAL(0, memcmp(output, out_string, out_length));
}
void test_guac_iconv() {
/* UTF8 for "papà è bello" */
unsigned char test_string_utf8[] = {
'p', 'a', 'p', 0xC3, 0xA0, ' ',
0xC3, 0xA8, ' ',
'b', 'e', 'l', 'l', 'o',
0x00
};
/* UTF16 for "papà è bello" */
unsigned char test_string_utf16[] = {
'p', 0x00, 'a', 0x00, 'p', 0x00, 0xE0, 0x00, ' ', 0x00,
0xE8, 0x00, ' ', 0x00,
'b', 0x00, 'e', 0x00, 'l', 0x00, 'l', 0x00, 'o', 0x00,
0x00, 0x00
};
/* ISO-8859-1 for "papà è bello" */
unsigned char test_string_iso8859_1[] = {
'p', 'a', 'p', 0xE0, ' ',
0xE8, ' ',
'b', 'e', 'l', 'l', 'o',
0x00
};
/* CP1252 for "papà è bello" */
unsigned char test_string_cp1252[] = {
'p', 'a', 'p', 0xE0, ' ',
0xE8, ' ',
'b', 'e', 'l', 'l', 'o',
0x00
};
/* UTF8 identity */
test_conversion(
GUAC_READ_UTF8, test_string_utf8, sizeof(test_string_utf8),
GUAC_WRITE_UTF8, test_string_utf8, sizeof(test_string_utf8));
/* UTF16 identity */
test_conversion(
GUAC_READ_UTF16, test_string_utf16, sizeof(test_string_utf16),
GUAC_WRITE_UTF16, test_string_utf16, sizeof(test_string_utf16));
/* UTF8 to UTF16 */
test_conversion(
GUAC_READ_UTF8, test_string_utf8, sizeof(test_string_utf8),
GUAC_WRITE_UTF16, test_string_utf16, sizeof(test_string_utf16));
/* UTF16 to UTF8 */
test_conversion(
GUAC_READ_UTF16, test_string_utf16, sizeof(test_string_utf16),
GUAC_WRITE_UTF8, test_string_utf8, sizeof(test_string_utf8));
/* UTF16 to ISO-8859-1 */
test_conversion(
GUAC_READ_UTF16, test_string_utf16, sizeof(test_string_utf16),
GUAC_WRITE_ISO8859_1, test_string_iso8859_1, sizeof(test_string_iso8859_1));
/* UTF16 to CP1252 */
test_conversion(
GUAC_READ_UTF16, test_string_utf16, sizeof(test_string_utf16),
GUAC_WRITE_CP1252, test_string_cp1252, sizeof(test_string_cp1252));
/* CP1252 to UTF8 */
test_conversion(
GUAC_READ_CP1252, test_string_cp1252, sizeof(test_string_cp1252),
GUAC_WRITE_UTF8, test_string_utf8, sizeof(test_string_utf8));
/* ISO-8859-1 to UTF8 */
test_conversion(
GUAC_READ_ISO8859_1, test_string_iso8859_1, sizeof(test_string_iso8859_1),
GUAC_WRITE_UTF8, test_string_utf8, sizeof(test_string_utf8));
}
guacamole-server-0.9.9/tests/common/common_suite.c 0000664 0001751 0001751 00000003510 12626133327 017222 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "common_suite.h"
#include
int common_suite_init() {
return 0;
}
int common_suite_cleanup() {
return 0;
}
int register_common_suite() {
/* Add common test suite */
CU_pSuite suite = CU_add_suite("common",
common_suite_init, common_suite_cleanup);
if (suite == NULL) {
CU_cleanup_registry();
return CU_get_error();
}
/* Add tests */
if (
CU_add_test(suite, "guac-iconv", test_guac_iconv) == NULL
|| CU_add_test(suite, "guac-string", test_guac_string) == NULL
|| CU_add_test(suite, "guac-rect", test_guac_rect) == NULL
) {
CU_cleanup_registry();
return CU_get_error();
}
return 0;
}
guacamole-server-0.9.9/tests/common/common_suite.h 0000664 0001751 0001751 00000003337 12626133327 017236 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TEST_COMMON_SUITE_H
#define _GUAC_TEST_COMMON_SUITE_H
/**
* Test suite containing unit tests for the "common" utility library included
* for the sake of simplifying guacamole-server development, but not included
* as part of libguac.
*
* @file common_suite.h
*/
#include "config.h"
/**
* Registers the common test suite with CUnit.
*/
int register_common_suite();
/**
* Unit test for string utility functions.
*/
void test_guac_string();
/**
* Unit test for character conversion functions.
*/
void test_guac_iconv();
/**
* Unit test for rectangle calculation functions.
*/
void test_guac_rect();
#endif
guacamole-server-0.9.9/tests/client/ 0000775 0001751 0001751 00000000000 12645400336 014422 5 0000000 0000000 guacamole-server-0.9.9/tests/client/client_suite.h 0000664 0001751 0001751 00000002422 12536405625 017207 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TEST_CLIENT_SUITE_H
#define _GUAC_TEST_CLIENT_SUITE_H
#include "config.h"
int register_client_suite();
void test_layer_pool();
void test_buffer_pool();
#endif
guacamole-server-0.9.9/tests/client/layer_pool.c 0000664 0001751 0001751 00000004705 12536405625 016666 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client_suite.h"
#include
#include
#include
void test_layer_pool() {
guac_client* client;
int i;
int seen[GUAC_BUFFER_POOL_INITIAL_SIZE] = {0};
guac_layer* layer;
/* Get client */
client = guac_client_alloc();
CU_ASSERT_PTR_NOT_NULL_FATAL(client);
/* Fill pool */
for (i=0; iindex > 0);
CU_ASSERT_FATAL(layer->index <= GUAC_BUFFER_POOL_INITIAL_SIZE);
/* This should be a layer we have not seen yet */
CU_ASSERT_FALSE(seen[layer->index - 1]);
seen[layer->index - 1] = 1;
guac_client_free_layer(client, layer);
}
/* Now that pool is filled, we should get a previously seen layer */
layer = guac_client_alloc_layer(client);
CU_ASSERT_FATAL(layer->index > 0);
CU_ASSERT_FATAL(layer->index <= GUAC_BUFFER_POOL_INITIAL_SIZE);
CU_ASSERT_TRUE(seen[layer->index - 1]);
/* Free client */
guac_client_free(client);
}
guacamole-server-0.9.9/tests/client/buffer_pool.c 0000664 0001751 0001751 00000004715 12536405625 017024 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client_suite.h"
#include
#include
#include
void test_buffer_pool() {
guac_client* client;
int i;
int seen[GUAC_BUFFER_POOL_INITIAL_SIZE] = {0};
guac_layer* layer;
/* Get client */
client = guac_client_alloc();
CU_ASSERT_PTR_NOT_NULL_FATAL(client);
/* Fill pool */
for (i=0; iindex < 0);
CU_ASSERT_FATAL(layer->index >= -GUAC_BUFFER_POOL_INITIAL_SIZE);
/* This should be a layer we have not seen yet */
CU_ASSERT_FALSE(seen[-layer->index - 1]);
seen[-layer->index - 1] = 1;
guac_client_free_buffer(client, layer);
}
/* Now that pool is filled, we should get a previously seen layer */
layer = guac_client_alloc_buffer(client);
CU_ASSERT_FATAL(layer->index < 0);
CU_ASSERT_FATAL(layer->index >= -GUAC_BUFFER_POOL_INITIAL_SIZE);
CU_ASSERT_TRUE(seen[-layer->index - 1]);
/* Free client */
guac_client_free(client);
}
guacamole-server-0.9.9/tests/client/client_suite.c 0000664 0001751 0001751 00000003407 12536405625 017206 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client_suite.h"
#include
int client_suite_init() {
return 0;
}
int client_suite_cleanup() {
return 0;
}
int register_client_suite() {
/* Add client test suite */
CU_pSuite suite = CU_add_suite("client",
client_suite_init, client_suite_cleanup);
if (suite == NULL) {
CU_cleanup_registry();
return CU_get_error();
}
/* Add tests */
if (
CU_add_test(suite, "layer-pool", test_layer_pool) == NULL
|| CU_add_test(suite, "buffer-pool", test_buffer_pool) == NULL
) {
CU_cleanup_registry();
return CU_get_error();
}
return 0;
}
guacamole-server-0.9.9/tests/test_libguac.c 0000664 0001751 0001751 00000003237 12536405625 015707 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client/client_suite.h"
#include "common/common_suite.h"
#include "protocol/suite.h"
#include "util/util_suite.h"
#include
int main() {
/* Init registry */
if (CU_initialize_registry() != CUE_SUCCESS)
return CU_get_error();
/* Register suites */
register_protocol_suite();
register_client_suite();
register_util_suite();
register_common_suite();
/* Run tests */
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
return CU_get_error();
}
guacamole-server-0.9.9/tests/Makefile.am 0000664 0001751 0001751 00000004160 12626133327 015123 0000000 0000000 #
# Copyright (C) 2015 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
TESTS = test_libguac
check_PROGRAMS = test_libguac
noinst_HEADERS = \
client/client_suite.h \
common/common_suite.h \
protocol/suite.h \
util/util_suite.h
test_libguac_SOURCES = \
test_libguac.c \
client/client_suite.c \
client/buffer_pool.c \
client/layer_pool.c \
common/common_suite.c \
common/guac_iconv.c \
common/guac_string.c \
common/guac_rect.c \
protocol/suite.c \
protocol/base64_decode.c \
protocol/instruction_parse.c \
protocol/instruction_read.c \
protocol/instruction_write.c \
protocol/nest_write.c \
util/util_suite.c \
util/guac_pool.c \
util/guac_unicode.c
test_libguac_CFLAGS = \
-Werror -Wall -pedantic \
@COMMON_INCLUDE@ \
@LIBGUAC_INCLUDE@
test_libguac_LDADD = \
@COMMON_LTLIB@ \
@CUNIT_LIBS@ \
@LIBGUAC_LTLIB@
guacamole-server-0.9.9/tests/util/ 0000775 0001751 0001751 00000000000 12645400336 014121 5 0000000 0000000 guacamole-server-0.9.9/tests/util/util_suite.h 0000664 0001751 0001751 00000004733 12536405625 016414 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TEST_UTIL_SUITE_H
#define _GUAC_TEST_UTIL_SUITE_H
/**
* Test suite containing unit tests for utility functions built into libguac.
* These utility functions are included for convenience rather as integral
* requirements of the core.
*
* @file util_suite.h
*/
#include "config.h"
/**
* A single Unicode character encoded as one byte with UTF-8.
*/
#define UTF8_1b "g"
/**
* A single Unicode character encoded as two bytes with UTF-8.
*/
#define UTF8_2b "\xc4\xa3"
/**
* A single Unicode character encoded as three bytes with UTF-8.
*/
#define UTF8_3b "\xe7\x8a\xac"
/**
* A single Unicode character encoded as four bytes with UTF-8.
*/
#define UTF8_4b "\xf0\x90\x84\xa3"
/**
* Registers the utility test suite with CUnit.
*/
int register_util_suite();
/**
* Unit test for the guac_pool structure and related functions. The guac_pool
* structure provides a consistent source of pooled integers. This unit test
* checks that the associated functions behave as documented (returning
* integers in the proper order, allocating new integers as necessary, etc.).
*/
void test_guac_pool();
/**
* Unit test for libguac's Unicode convenience functions. This test checks that
* the functions provided for determining string length, character length, and
* for reading and writing UTF-8 behave as specified in the documentation.
*/
void test_guac_unicode();
#endif
guacamole-server-0.9.9/tests/util/util_suite.c 0000664 0001751 0001751 00000003403 12536405625 016400 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "util_suite.h"
#include
int util_suite_init() {
return 0;
}
int util_suite_cleanup() {
return 0;
}
int register_util_suite() {
/* Add util test suite */
CU_pSuite suite = CU_add_suite("util",
util_suite_init, util_suite_cleanup);
if (suite == NULL) {
CU_cleanup_registry();
return CU_get_error();
}
/* Add tests */
if (
CU_add_test(suite, "guac-pool", test_guac_pool) == NULL
|| CU_add_test(suite, "guac-unicode", test_guac_unicode) == NULL
) {
CU_cleanup_registry();
return CU_get_error();
}
return 0;
}
guacamole-server-0.9.9/tests/util/guac_unicode.c 0000664 0001751 0001751 00000006611 12536405625 016643 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "util_suite.h"
#include
#include
void test_guac_unicode() {
int codepoint;
char buffer[16];
/* Test character length */
CU_ASSERT_EQUAL(1, guac_utf8_charsize(UTF8_1b[0]));
CU_ASSERT_EQUAL(2, guac_utf8_charsize(UTF8_2b[0]));
CU_ASSERT_EQUAL(3, guac_utf8_charsize(UTF8_3b[0]));
CU_ASSERT_EQUAL(4, guac_utf8_charsize(UTF8_4b[0]));
/* Test string length */
CU_ASSERT_EQUAL(0, guac_utf8_strlen(""));
CU_ASSERT_EQUAL(1, guac_utf8_strlen(UTF8_4b));
CU_ASSERT_EQUAL(2, guac_utf8_strlen(UTF8_4b UTF8_1b));
CU_ASSERT_EQUAL(2, guac_utf8_strlen(UTF8_2b UTF8_3b));
CU_ASSERT_EQUAL(3, guac_utf8_strlen(UTF8_1b UTF8_3b UTF8_4b));
CU_ASSERT_EQUAL(3, guac_utf8_strlen(UTF8_2b UTF8_1b UTF8_3b));
CU_ASSERT_EQUAL(3, guac_utf8_strlen(UTF8_4b UTF8_2b UTF8_1b));
CU_ASSERT_EQUAL(3, guac_utf8_strlen(UTF8_3b UTF8_4b UTF8_2b));
CU_ASSERT_EQUAL(5, guac_utf8_strlen("hello"));
CU_ASSERT_EQUAL(9, guac_utf8_strlen("guacamole"));
/* Test writes */
CU_ASSERT_EQUAL(1, guac_utf8_write(0x00065, &(buffer[0]), 10));
CU_ASSERT_EQUAL(2, guac_utf8_write(0x00654, &(buffer[1]), 9));
CU_ASSERT_EQUAL(3, guac_utf8_write(0x00876, &(buffer[3]), 7));
CU_ASSERT_EQUAL(4, guac_utf8_write(0x12345, &(buffer[6]), 4));
CU_ASSERT_EQUAL(0, guac_utf8_write(0x00066, &(buffer[10]), 0));
/* Test result of write */
CU_ASSERT(memcmp("\x65", &(buffer[0]), 1) == 0); /* U+0065 */
CU_ASSERT(memcmp("\xD9\x94", &(buffer[1]), 2) == 0); /* U+0654 */
CU_ASSERT(memcmp("\xE0\xA1\xB6", &(buffer[3]), 3) == 0); /* U+0876 */
CU_ASSERT(memcmp("\xF0\x92\x8D\x85", &(buffer[6]), 4) == 0); /* U+12345 */
/* Test reads */
CU_ASSERT_EQUAL(1, guac_utf8_read(&(buffer[0]), 10, &codepoint));
CU_ASSERT_EQUAL(0x0065, codepoint);
CU_ASSERT_EQUAL(2, guac_utf8_read(&(buffer[1]), 9, &codepoint));
CU_ASSERT_EQUAL(0x0654, codepoint);
CU_ASSERT_EQUAL(3, guac_utf8_read(&(buffer[3]), 7, &codepoint));
CU_ASSERT_EQUAL(0x0876, codepoint);
CU_ASSERT_EQUAL(4, guac_utf8_read(&(buffer[6]), 4, &codepoint));
CU_ASSERT_EQUAL(0x12345, codepoint);
CU_ASSERT_EQUAL(0, guac_utf8_read(&(buffer[10]), 0, &codepoint));
CU_ASSERT_EQUAL(0x12345, codepoint);
}
guacamole-server-0.9.9/tests/util/guac_pool.c 0000664 0001751 0001751 00000005214 12536405625 016164 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "util_suite.h"
#include
#include
#define UNSEEN 0
#define SEEN_PHASE_1 1
#define SEEN_PHASE_2 2
#define POOL_SIZE 128
void test_guac_pool() {
guac_pool* pool;
int i;
int seen[POOL_SIZE] = {0};
int value;
/* Get pool */
pool = guac_pool_alloc(POOL_SIZE);
CU_ASSERT_PTR_NOT_NULL_FATAL(pool);
/* Fill pool */
for (i=0; i= 0);
CU_ASSERT_FATAL(value < POOL_SIZE);
/* This should be an integer we have not seen yet */
CU_ASSERT_EQUAL(UNSEEN, seen[value]);
seen[value] = SEEN_PHASE_1;
/* Return value to pool */
guac_pool_free_int(pool, value);
}
/* Now that pool is filled, we should get ONLY previously seen integers */
for (i=0; i= 0);
CU_ASSERT_FATAL(value < POOL_SIZE);
/* This should be an integer we have seen already */
CU_ASSERT_EQUAL(SEEN_PHASE_1, seen[value]);
seen[value] = SEEN_PHASE_2;
}
/* Pool is filled to minimum now. Next value should be equal to size. */
value = guac_pool_next_int(pool);
CU_ASSERT_EQUAL(POOL_SIZE, value);
/* Free pool */
guac_pool_free(pool);
}
guacamole-server-0.9.9/depcomp 0000755 0001751 0001751 00000056016 12645400276 013310 0000000 0000000 #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva .
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
guacamole-server-0.9.9/doc/ 0000775 0001751 0001751 00000000000 12645400336 012547 5 0000000 0000000 guacamole-server-0.9.9/doc/Doxyfile 0000664 0001751 0001751 00000001423 12637656315 014210 0000000 0000000
#
# Project name / version
#
PROJECT_NAME = libguac
PROJECT_NUMBER = 0.9.9
#
# Warn about undocumented parameters and return values, but do not fill output
# with verbose progress info.
#
QUIET = YES
WARN_NO_PARAMDOC = YES
#
# Output format
#
ALPHABETICAL_INDEX = YES
GENERATE_HTML = YES
GENERATE_LATEX = NO
IGNORE_PREFIX = guac_ vguac_
OPTIMIZE_OUTPUT_FOR_C = YES
OUTPUT_DIRECTORY = doxygen-output
RECURSIVE = YES
SHOW_INCLUDE_FILES = NO
#
# Input format
#
CASE_SENSE_NAMES = YES
EXCLUDE_SYMBOLS = __* guac_palette*
FILE_PATTERNS = *.h
INPUT = ../src/libguac/guacamole
JAVADOC_AUTOBRIEF = YES
STRIP_FROM_PATH = ../src/libguac
TAB_SIZE = 4
TYPEDEF_HIDES_STRUCT = YES
guacamole-server-0.9.9/src/ 0000775 0001751 0001751 00000000000 12645400336 012571 5 0000000 0000000 guacamole-server-0.9.9/src/terminal/ 0000775 0001751 0001751 00000000000 12645400336 014404 5 0000000 0000000 guacamole-server-0.9.9/src/terminal/cursor.c 0000664 0001751 0001751 00000003724 12643542623 016017 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "cursor.h"
#include
#include
#include
guac_terminal_cursor* guac_terminal_cursor_alloc(guac_client* client) {
/* Alloc new cursor, initialize buffer */
guac_terminal_cursor* cursor = malloc(sizeof(guac_terminal_cursor));
cursor->buffer = guac_client_alloc_buffer(client);
return cursor;
}
void guac_terminal_cursor_free(guac_client* client, guac_terminal_cursor* cursor) {
/* Free buffer */
guac_client_free_buffer(client, cursor->buffer);
/* Free cursor */
free(cursor);
}
void guac_terminal_set_cursor(guac_client* client, guac_terminal_cursor* cursor) {
/* Set cursor */
guac_protocol_send_cursor(client->socket,
cursor->hotspot_x, cursor->hotspot_y,
cursor->buffer,
0, 0, cursor->width, cursor->height);
}
guacamole-server-0.9.9/src/terminal/char_mappings.c 0000664 0001751 0001751 00000015107 12536405625 017314 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
const int vt100_map[] = {
' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
0x25C6, 0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x00B0, 0x00B1, 0x2424, 0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA,
0x23BB, 0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C, 0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00B7, 0x007F,
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
};
const int null_map[] = {
' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 0x007F,
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229,
0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x000A
};
const int user_map[] = {
' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
0x00A7, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 0x00C4, 0x00D6, 0x00DC, '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0x00E4, 0x00F6, 0x00FC, 0x00DF, 0x007F,
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
};
guacamole-server-0.9.9/src/terminal/ibar.c 0000664 0001751 0001751 00000005661 12643542623 015421 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "cursor.h"
#include
#include
#include
#include
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define U 0x80,0x80,0x80,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
/* Dimensions */
const int guac_terminal_ibar_width = 7;
const int guac_terminal_ibar_height = 16;
/* Format */
const cairo_format_t guac_terminal_ibar_format = CAIRO_FORMAT_ARGB32;
const int guac_terminal_ibar_stride = 28;
/* Embedded pointer graphic */
unsigned char guac_terminal_ibar[] = {
X,X,X,X,X,X,X,
X,O,O,U,O,O,X,
X,X,X,O,X,X,X,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
X,X,X,O,X,X,X,
X,O,O,U,O,O,X,
X,X,X,X,X,X,X
};
guac_terminal_cursor* guac_terminal_create_ibar(guac_client* client) {
guac_socket* socket = client->socket;
guac_terminal_cursor* cursor = guac_terminal_cursor_alloc(client);
/* Draw to buffer */
cairo_surface_t* graphic = cairo_image_surface_create_for_data(
guac_terminal_ibar,
guac_terminal_ibar_format,
guac_terminal_ibar_width,
guac_terminal_ibar_height,
guac_terminal_ibar_stride);
guac_client_stream_png(client, socket, GUAC_COMP_SRC, cursor->buffer,
0, 0, graphic);
cairo_surface_destroy(graphic);
/* Initialize cursor properties */
cursor->width = guac_terminal_ibar_width;
cursor->height = guac_terminal_ibar_height;
cursor->hotspot_x = guac_terminal_ibar_width / 2;
cursor->hotspot_y = guac_terminal_ibar_height / 2;
return cursor;
}
guacamole-server-0.9.9/src/terminal/common.h 0000664 0001751 0001751 00000004775 12626133327 016004 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_COMMON_H
#define _GUAC_TERMINAL_COMMON_H
#include "config.h"
#include
/**
* Returns the closest value to the value given that is also
* within the given range.
*/
int guac_terminal_fit_to_range(int value, int min, int max);
/**
* Encodes the given codepoint as UTF-8, storing the result within the
* provided buffer, and returning the number of bytes stored.
*/
int guac_terminal_encode_utf8(int codepoint, char* utf8);
/**
* Returns whether a codepoint has a corresponding glyph, or is rendered
* as a blank space.
*/
bool guac_terminal_has_glyph(int codepoint);
/**
* Similar to write, but automatically retries the write operation until
* an error occurs.
*/
int guac_terminal_write_all(int fd, const char* buffer, int size);
/**
* Similar to read, but automatically retries the read until an error occurs,
* filling all available space within the buffer. Unless it is known that the
* given amount of space is available on the file descriptor, there is a good
* chance this function will block.
*
* @param fd
* The file descriptor to read data from.
*
* @param buffer
* The buffer to store data within.
*
* @param size
* The number of bytes available within the buffer.
*
* @return
* The number of bytes read if successful, or a negative value if an error
* occurs.
*/
int guac_terminal_fill_buffer(int fd, char* buffer, int size);
#endif
guacamole-server-0.9.9/src/terminal/terminal.h 0000664 0001751 0001751 00000043771 12645364210 016324 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_H
#define _GUAC_TERMINAL_H
#include "config.h"
#include "buffer.h"
#include "cursor.h"
#include "display.h"
#include "guac_clipboard.h"
#include "scrollbar.h"
#include "types.h"
#include
#include
#include
#include
/**
* The maximum duration of a single frame, in milliseconds.
*/
#define GUAC_TERMINAL_FRAME_DURATION 40
/**
* The maximum amount of time to wait for more data before declaring a frame
* complete, in milliseconds.
*/
#define GUAC_TERMINAL_FRAME_TIMEOUT 10
/**
* The maximum number of custom tab stops.
*/
#define GUAC_TERMINAL_MAX_TABS 16
/**
* The number of rows to scroll per scroll wheel event.
*/
#define GUAC_TERMINAL_WHEEL_SCROLL_AMOUNT 3
/**
* The maximum number of bytes to allow within the clipboard.
*/
#define GUAC_TERMINAL_CLIPBOARD_MAX_LENGTH 262144
/**
* The name of the color scheme having black foreground and white background.
*/
#define GUAC_TERMINAL_SCHEME_BLACK_WHITE "black-white"
/**
* The name of the color scheme having gray foreground and black background.
*/
#define GUAC_TERMINAL_SCHEME_GRAY_BLACK "gray-black"
/**
* The name of the color scheme having green foreground and black background.
*/
#define GUAC_TERMINAL_SCHEME_GREEN_BLACK "green-black"
/**
* The name of the color scheme having white foreground and black background.
*/
#define GUAC_TERMINAL_SCHEME_WHITE_BLACK "white-black"
typedef struct guac_terminal guac_terminal;
/**
* Handler for characters printed to the terminal. When a character is printed,
* the current char handler for the terminal is called and given that
* character.
*/
typedef int guac_terminal_char_handler(guac_terminal* term, unsigned char c);
/**
* Handler for setting the destination path for file uploads.
*/
typedef void guac_terminal_upload_path_handler(guac_client* client, char* path);
/**
* Handler for creating an outbound file download stream for a specified file.
*/
typedef guac_stream* guac_terminal_file_download_handler(guac_client* client, char* filename);
/**
* Represents a terminal emulator which uses a given Guacamole client to
* render itself.
*/
struct guac_terminal {
/**
* The Guacamole client this terminal emulator will use for rendering.
*/
guac_client* client;
/**
* Called whenever the necessary terminal codes are sent to change
* the path for future file uploads.
*/
guac_terminal_upload_path_handler* upload_path_handler;
/**
* Called whenever the necessary terminal codes are sent to initiate
* a download of a given remote file.
*/
guac_terminal_file_download_handler* file_download_handler;
/**
* Lock which restricts simultaneous access to this terminal via the root
* guac_terminal_* functions.
*/
pthread_mutex_t lock;
/**
* Pipe which should be written to (and read from) to provide output to
* this terminal. Another thread should read from this pipe when writing
* data to the terminal. It would make sense for the terminal to provide
* this thread, but for simplicity, that logic is left to the guac
* message handler (to give the message handler something to block with).
*/
int stdout_pipe_fd[2];
/**
* Pipe which will be the source of user input. When a terminal code
* generates synthesized user input, that data will be written to
* this pipe.
*/
int stdin_pipe_fd[2];
/**
* Graphical representation of the current scroll state.
*/
guac_terminal_scrollbar* scrollbar;
/**
* The relative offset of the display. A positive value indicates that
* many rows have been scrolled into view, zero indicates that no
* scrolling has occurred. Negative values are illegal.
*/
int scroll_offset;
/**
* The width of the terminal, in characters.
*/
int term_width;
/**
* The height of the terminal, in characters.
*/
int term_height;
/**
* The index of the first row in the scrolling region.
*/
int scroll_start;
/**
* The index of the last row in the scrolling region.
*/
int scroll_end;
/**
* The current row location of the cursor.
*/
int cursor_row;
/**
* The current column location of the cursor.
*/
int cursor_col;
/**
* The row of the rendered cursor.
*/
int visible_cursor_row;
/**
* The column of the rendered cursor.
*/
int visible_cursor_col;
/**
* The row of the saved cursor (ESC 7).
*/
int saved_cursor_row;
/**
* The column of the saved cursor (ESC 7).
*/
int saved_cursor_col;
/**
* The attributes which will be applied to future characters.
*/
guac_terminal_attributes current_attributes;
/**
* The character whose attributes dictate the default attributes
* of all characters. When new screen space is allocated, this
* character fills the gaps.
*/
guac_terminal_char default_char;
/**
* Handler which will receive all printed characters, updating the terminal
* accordingly.
*/
guac_terminal_char_handler* char_handler;
/**
* The difference between the currently-rendered screen and the current
* state of the terminal.
*/
guac_terminal_display* display;
/**
* Current terminal display state. All characters present on the screen
* are within this buffer. This has nothing to do with the display, which
* facilitates transfer of a set of changes to the remote display.
*/
guac_terminal_buffer* buffer;
/**
* Automatically place a tabstop every N characters. If zero, then no
* tabstops exist automatically.
*/
int tab_interval;
/**
* Array of all tabs set. Each entry is the column number of a tab + 1,
* or 0 if that tab cell is unset.
*/
int custom_tabs[GUAC_TERMINAL_MAX_TABS];
/**
* Array of arrays of mapped characters, where the character N is located at the N-32
* position within the array. Each element in a contained array is the corresponding Unicode
* codepoint. If NULL, a direct mapping from Unicode is used. The entries of the main array
* correspond to the character set in use (G0, G1, etc.)
*/
const int* char_mapping[2];
/**
* The active character set. For example, 0 for G0, 1 for G1, etc.
*/
int active_char_set;
/**
* Whether text is being selected.
*/
bool text_selected;
/**
* The row that the selection starts at.
*/
int selection_start_row;
/**
* The column that the selection starts at.
*/
int selection_start_column;
/**
* The width of the character at selection start.
*/
int selection_start_width;
/**
* The row that the selection ends at.
*/
int selection_end_row;
/**
* The column that the selection ends at.
*/
int selection_end_column;
/**
* The width of the character at selection end.
*/
int selection_end_width;
/**
* Whether the cursor (arrow) keys should send cursor sequences
* or application sequences (DECCKM).
*/
bool application_cursor_keys;
/**
* Whether a CR should automatically follow a LF, VT, or FF.
*/
bool automatic_carriage_return;
/**
* Whether insert mode is enabled (DECIM).
*/
bool insert_mode;
/**
* Whether the alt key is currently being held down.
*/
int mod_alt;
/**
* Whether the control key is currently being held down.
*/
int mod_ctrl;
/**
* Whether the shift key is currently being held down.
*/
int mod_shift;
/**
* The current mouse button state.
*/
int mouse_mask;
/**
* The cached pointer cursor.
*/
guac_terminal_cursor* pointer_cursor;
/**
* The cached I-bar cursor.
*/
guac_terminal_cursor* ibar_cursor;
/**
* The cached invisible (blank) cursor.
*/
guac_terminal_cursor* blank_cursor;
/**
* The current cursor, used to avoid re-setting the cursor.
*/
guac_terminal_cursor* current_cursor;
/**
* The current contents of the clipboard.
*/
guac_common_clipboard* clipboard;
};
/**
* Creates a new guac_terminal, having the given width and height, and
* rendering to the given client.
*
* @param client
* The client to which the terminal will be rendered.
*
* @param font_name
* The name of the font to use when rendering glyphs.
*
* @param font_size
* The size of each glyph, in points.
*
* @param dpi
* The DPI of the display. The given font size will be adjusted to produce
* glyphs at the given DPI.
*
* @param width
* The width of the terminal, in pixels.
*
* @param height
* The height of the terminal, in pixels.
*
* @param color_scheme
* The name of the color scheme to use. This string must be one of the
* names defined by the GUAC_TERMINAL_SCHEME_* constants. If blank or NULL,
* the default scheme of GUAC_TERMINAL_SCHEME_GRAY_BLACK will be used. If
* invalid, a warning will be logged, and the terminal will fall back on
* GUAC_TERMINAL_SCHEME_GRAY_BLACK.
*
* @return
* A new guac_terminal having the given font, dimensions, and attributes
* which renders all text to the given client.
*/
guac_terminal* guac_terminal_create(guac_client* client,
const char* font_name, int font_size, int dpi,
int width, int height, const char* color_scheme);
/**
* Frees all resources associated with the given terminal.
*/
void guac_terminal_free(guac_terminal* term);
/**
* Renders a single frame of terminal data. If data is not yet available,
* this function will block until data is written.
*/
int guac_terminal_render_frame(guac_terminal* terminal);
/**
* Reads from this terminal's STDIN. Input comes from key and mouse events
* supplied by calls to guac_terminal_send_key() and
* guac_terminal_send_mouse(). If input is not yet available, this function
* will block.
*/
int guac_terminal_read_stdin(guac_terminal* terminal, char* c, int size);
/**
* Writes to this terminal's STDOUT. This function may block until space
* is freed in the output buffer by guac_terminal_render_frame().
*/
int guac_terminal_write_stdout(guac_terminal* terminal, const char* c, int size);
/**
* Notifies the terminal that an event has occurred and the terminal should
* flush itself when reasonable.
*
* @param terminal
* The terminal to notify.
*
* @return
* Zero if notification succeeded, non-zero if an error occurred while
* notifying the terminal.
*/
int guac_terminal_notify(guac_terminal* terminal);
/**
* Reads a single line from this terminal's STDIN. Input is retrieved in
* the same manner as guac_terminal_read_stdin() and the same restrictions
* apply.
*/
void guac_terminal_prompt(guac_terminal* terminal, const char* title, char* str, int size, bool echo);
/**
* Writes the given format string and arguments to this terminal's STDOUT in
* the same manner as printf(). This function may block until space is
* freed in the output buffer by guac_terminal_render_frame().
*/
int guac_terminal_printf(guac_terminal* terminal, const char* format, ...);
/**
* Handles the given key event, sending data, scrolling, pasting clipboard
* data, etc. as necessary.
*/
int guac_terminal_send_key(guac_terminal* term, int keysym, int pressed);
/**
* Handles the given mouse event, sending data, scrolling, pasting clipboard
* data, etc. as necessary.
*/
int guac_terminal_send_mouse(guac_terminal* term, int x, int y, int mask);
/**
* Handles a scroll event received from the scrollbar associated with a
* terminal.
*
* @param scrollbar
* The scrollbar that has been scrolled.
*
* @param value
* The new value that should be stored within the scrollbar, and
* represented within the terminal display.
*/
void guac_terminal_scroll_handler(guac_terminal_scrollbar* scrollbar, int value);
/**
* Clears the current clipboard contents and sets the mimetype for future
* contents.
*/
void guac_terminal_clipboard_reset(guac_terminal* term, const char* mimetype);
/**
* Appends the given data to the current clipboard.
*/
void guac_terminal_clipboard_append(guac_terminal* term, const void* data, int length);
/* INTERNAL FUNCTIONS */
/**
* Acquires exclusive access to the terminal. Note that enforcing this
* exclusive access requires that ALL users of the terminal call this
* function before making further calls to the terminal.
*/
void guac_terminal_lock(guac_terminal* terminal);
/**
* Releases exclusive access to the terminal.
*/
void guac_terminal_unlock(guac_terminal* terminal);
/**
* Resets the state of the given terminal, as if it were just allocated.
*/
void guac_terminal_reset(guac_terminal* term);
/**
* Writes the given string of characters to the terminal.
*/
int guac_terminal_write(guac_terminal* term, const char* c, int size);
/**
* Sets the character at the given row and column to the specified value.
*/
int guac_terminal_set(guac_terminal* term, int row, int col, int codepoint);
/**
* Clears the given region within a single row.
*/
int guac_terminal_clear_columns(guac_terminal* term,
int row, int start_col, int end_col);
/**
* Clears the given region from right-to-left, top-to-bottom, replacing
* all characters with the current background color and attributes.
*/
int guac_terminal_clear_range(guac_terminal* term,
int start_row, int start_col,
int end_row, int end_col);
/**
* Scrolls the terminal's current scroll region up by one row.
*/
int guac_terminal_scroll_up(guac_terminal* term,
int start_row, int end_row, int amount);
/**
* Scrolls the terminal's current scroll region down by one row.
*/
int guac_terminal_scroll_down(guac_terminal* term,
int start_row, int end_row, int amount);
/**
* Commits the current cursor location, updating the visible cursor
* on the screen.
*/
void guac_terminal_commit_cursor(guac_terminal* term);
/**
* Scroll down the display by the given amount, replacing the new space with
* data from the buffer. If not enough data is available, the maximum
* amount will be scrolled.
*/
void guac_terminal_scroll_display_down(guac_terminal* terminal, int amount);
/**
* Scroll up the display by the given amount, replacing the new space with data
* from either the buffer or the terminal buffer. If not enough data is
* available, the maximum amount will be scrolled.
*/
void guac_terminal_scroll_display_up(guac_terminal* terminal, int amount);
/**
* Marks the start of text selection at the given row and column.
*/
void guac_terminal_select_start(guac_terminal* terminal, int row, int column);
/**
* Updates the end of text selection at the given row and column.
*/
void guac_terminal_select_update(guac_terminal* terminal, int row, int column);
/**
* Ends text selection, removing any highlight. Character data is stored in the
* string buffer provided.
*/
void guac_terminal_select_end(guac_terminal* terminal, char* string);
/* LOW-LEVEL TERMINAL OPERATIONS */
/**
* Copies the given range of columns to a new location, offset from
* the original by the given number of columns.
*/
void guac_terminal_copy_columns(guac_terminal* terminal, int row,
int start_column, int end_column, int offset);
/**
* Copies the given range of rows to a new location, offset from the
* original by the given number of rows.
*/
void guac_terminal_copy_rows(guac_terminal* terminal,
int start_row, int end_row, int offset);
/**
* Sets the given range of columns within the given row to the given
* character.
*/
void guac_terminal_set_columns(guac_terminal* terminal, int row,
int start_column, int end_column, guac_terminal_char* character);
/**
* Resize the terminal to the given dimensions.
*/
int guac_terminal_resize(guac_terminal* term, int width, int height);
/**
* Flushes all pending operations within the given guac_terminal.
*/
void guac_terminal_flush(guac_terminal* terminal);
/**
* Sends the given string as if typed by the user.
*/
int guac_terminal_send_data(guac_terminal* term, const char* data, int length);
/**
* Sends the given string as if typed by the user.
*/
int guac_terminal_send_string(guac_terminal* term, const char* data);
/**
* Sends data through STDIN as if typed by the user, using the format
* string given and any args (similar to printf).
*/
int guac_terminal_sendf(guac_terminal* term, const char* format, ...);
/**
* Sets a tabstop in the given column.
*/
void guac_terminal_set_tab(guac_terminal* term, int column);
/**
* Removes the tabstop at the given column.
*/
void guac_terminal_unset_tab(guac_terminal* term, int column);
/**
* Removes all tabstops.
*/
void guac_terminal_clear_tabs(guac_terminal* term);
/**
* Given a column within the given terminal, returns the location of the
* next tabstop (or the rightmost character, if no more tabstops exist).
*/
int guac_terminal_next_tab(guac_terminal* term, int column);
#endif
guacamole-server-0.9.9/src/terminal/blank.c 0000664 0001751 0001751 00000003505 12643542623 015566 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "cursor.h"
#include
#include
#include
#include
guac_terminal_cursor* guac_terminal_create_blank(guac_client* client) {
guac_socket* socket = client->socket;
guac_terminal_cursor* cursor = guac_terminal_cursor_alloc(client);
/* Set buffer to a single 1x1 transparent rectangle */
guac_protocol_send_rect(socket, cursor->buffer, 0, 0, 1, 1);
guac_protocol_send_cfill(socket, GUAC_COMP_SRC, cursor->buffer,
0x00, 0x00, 0x00, 0x00);
/* Initialize cursor properties */
cursor->width = 1;
cursor->height = 1;
cursor->hotspot_x = 0;
cursor->hotspot_y = 0;
return cursor;
}
guacamole-server-0.9.9/src/terminal/ibar.h 0000664 0001751 0001751 00000004043 12643542623 015417 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_IBAR_H
#define _GUAC_TERMINAL_IBAR_H
#include "config.h"
#include
#include
/**
* Width of the embedded mouse cursor graphic.
*/
extern const int guac_terminal_ibar_width;
/**
* Height of the embedded mouse cursor graphic.
*/
extern const int guac_terminal_ibar_height;
/**
* Number of bytes in each row of the embedded mouse cursor graphic.
*/
extern const int guac_terminal_ibar_stride;
/**
* The Cairo grapic format of the mouse cursor graphic.
*/
extern const cairo_format_t guac_terminal_ibar_format;
/**
* Embedded mouse cursor graphic.
*/
extern unsigned char guac_terminal_ibar[];
/**
* Creates a new I-bar cursor, returning the corresponding cursor object.
*
* @param client The guac_client to send the cursor to.
* @return A new cursor which must be free'd via guac_terminal_cursor_free()/
*/
guac_terminal_cursor* guac_terminal_create_ibar(guac_client* client);
#endif
guacamole-server-0.9.9/src/terminal/packet.h 0000664 0001751 0001751 00000005667 12626133327 015764 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_TERMINAL_PACKET_H
#define GUAC_TERMINAL_PACKET_H
/**
* The maximum size of a packet written or read by the
* guac_terminal_packet_write() or guac_terminal_packet_read() functions.
*/
#define GUAC_TERMINAL_PACKET_SIZE 4096
/**
* An arbitrary data packet with minimal framing.
*/
typedef struct guac_terminal_packet {
/**
* The number of bytes in the data portion of this packet.
*/
int length;
/**
* Arbitrary data.
*/
char data[GUAC_TERMINAL_PACKET_SIZE];
} guac_terminal_packet;
/**
* Writes a single packet of data to the given file descriptor. The provided
* length MUST be no greater than GUAC_TERMINAL_PACKET_SIZE. Zero-length
* writes are legal and do result in a packet being written to the file
* descriptor.
*
* @param fd
* The file descriptor to write to.
*
* @param data
* A buffer containing the data to write.
*
* @param length
* The number of bytes to write to the file descriptor.
*
* @return
* The number of bytes written on success, which may be zero if the data
* length is zero, or a negative value on error.
*/
int guac_terminal_packet_write(int fd, const void* data, int length);
/**
* Reads a single packet of data from the given file descriptor. The provided
* length MUST be at least GUAC_TERMINAL_PACKET_SIZE to ensure any packet
* read will fit in the buffer. Zero-length reads are possible if a zero-length
* packet was written.
*
* @param fd
* The file descriptor to read from.
*
* @param data
* The buffer to store data within.
*
* @param length
* The number of bytes available within the buffer.
*
* @return
* The number of bytes read on success, which may be zero if the read
* packet had a length of zero, or a negative value on error.
*/
int guac_terminal_packet_read(int fd, void* data, int length);
#endif
guacamole-server-0.9.9/src/terminal/packet.c 0000664 0001751 0001751 00000004140 12626133327 015740 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "common.h"
#include "packet.h"
#include
int guac_terminal_packet_write(int fd, const void* data, int length) {
guac_terminal_packet out;
/* Do not attempt to write packets beyond maximum size */
if (length > GUAC_TERMINAL_PACKET_SIZE)
return -1;
/* Calculate final packet length */
int packet_length = sizeof(int) + length;
/* Copy data into packet */
out.length = length;
memcpy(out.data, data, length);
/* Write packet */
return guac_terminal_write_all(fd, (const char*) &out, packet_length);
}
int guac_terminal_packet_read(int fd, void* data, int length) {
int bytes;
/* Read buffers MUST be at least GUAC_TERMINAL_PACKET_SIZE */
if (length < GUAC_TERMINAL_PACKET_SIZE)
return -1;
/* Read length */
if (guac_terminal_fill_buffer(fd, (char*) &bytes, sizeof(int)) < 0)
return -1;
/* Read body */
if (guac_terminal_fill_buffer(fd, (char*) data, bytes) < 0)
return -1;
return bytes;
}
guacamole-server-0.9.9/src/terminal/terminal.c 0000664 0001751 0001751 00000154243 12645364210 016314 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "buffer.h"
#include "blank.h"
#include "common.h"
#include "cursor.h"
#include "display.h"
#include "ibar.h"
#include "guac_clipboard.h"
#include "packet.h"
#include "pointer.h"
#include "scrollbar.h"
#include "terminal.h"
#include "terminal_handlers.h"
#include "types.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/**
* Sets the given range of columns to the given character.
*/
static void __guac_terminal_set_columns(guac_terminal* terminal, int row,
int start_column, int end_column, guac_terminal_char* character) {
guac_terminal_display_set_columns(terminal->display, row + terminal->scroll_offset,
start_column, end_column, character);
guac_terminal_buffer_set_columns(terminal->buffer, row,
start_column, end_column, character);
}
/**
* Enforces a character break at the given edge, ensuring that the left side
* of the edge is the final column of a character, and the right side of the
* edge is the initial column of a DIFFERENT character.
*
* For a character in a column N, the left edge number is N, and the right
* edge is N+1.
*/
static void __guac_terminal_force_break(guac_terminal* terminal, int row, int edge) {
guac_terminal_buffer_row* buffer_row = guac_terminal_buffer_get_row(terminal->buffer, row, 0);
/* Ensure character to left of edge is unbroken */
if (edge > 0) {
int end_column = edge - 1;
int start_column = end_column;
guac_terminal_char* start_char = &(buffer_row->characters[start_column]);
/* Determine start column */
while (start_column > 0 && start_char->value == GUAC_CHAR_CONTINUATION) {
start_char--;
start_column--;
}
/* Advance to start of broken character if necessary */
if (start_char->value != GUAC_CHAR_CONTINUATION && start_char->width < end_column - start_column + 1) {
start_column += start_char->width;
start_char += start_char->width;
}
/* Clear character if broken */
if (start_char->value == GUAC_CHAR_CONTINUATION || start_char->width != end_column - start_column + 1) {
guac_terminal_char cleared_char;
cleared_char.value = ' ';
cleared_char.attributes = start_char->attributes;
cleared_char.width = 1;
__guac_terminal_set_columns(terminal, row, start_column, end_column, &cleared_char);
}
}
/* Ensure character to right of edge is unbroken */
if (edge >= 0 && edge < buffer_row->length) {
int start_column = edge;
int end_column = start_column;
guac_terminal_char* start_char = &(buffer_row->characters[start_column]);
guac_terminal_char* end_char = &(buffer_row->characters[end_column]);
/* Determine end column */
while (end_column+1 < buffer_row->length && (end_char+1)->value == GUAC_CHAR_CONTINUATION) {
end_char++;
end_column++;
}
/* Advance to start of broken character if necessary */
if (start_char->value != GUAC_CHAR_CONTINUATION && start_char->width < end_column - start_column + 1) {
start_column += start_char->width;
start_char += start_char->width;
}
/* Clear character if broken */
if (start_char->value == GUAC_CHAR_CONTINUATION || start_char->width != end_column - start_column + 1) {
guac_terminal_char cleared_char;
cleared_char.value = ' ';
cleared_char.attributes = start_char->attributes;
cleared_char.width = 1;
__guac_terminal_set_columns(terminal, row, start_column, end_column, &cleared_char);
}
}
}
void guac_terminal_reset(guac_terminal* term) {
int row;
/* Set current state */
term->char_handler = guac_terminal_echo;
term->active_char_set = 0;
term->char_mapping[0] =
term->char_mapping[1] = NULL;
/* Reset cursor location */
term->cursor_row = term->visible_cursor_row = term->saved_cursor_row = 0;
term->cursor_col = term->visible_cursor_col = term->saved_cursor_col = 0;
/* Clear scrollback, buffer, and scroll region */
term->buffer->top = 0;
term->buffer->length = 0;
term->scroll_start = 0;
term->scroll_end = term->term_height - 1;
term->scroll_offset = 0;
/* Reset scrollbar bounds */
guac_terminal_scrollbar_set_bounds(term->scrollbar, term->term_height - term->buffer->length, 0);
guac_terminal_scrollbar_set_value(term->scrollbar, -term->scroll_offset);
/* Reset flags */
term->text_selected = false;
term->application_cursor_keys = false;
term->automatic_carriage_return = false;
term->insert_mode = false;
/* Reset tabs */
term->tab_interval = 8;
memset(term->custom_tabs, 0, sizeof(term->custom_tabs));
/* Clear terminal */
for (row=0; rowterm_height; row++)
guac_terminal_set_columns(term, row, 0, term->term_width, &(term->default_char));
}
/**
* Paints or repaints the background of the terminal display. This painting
* occurs beneath the actual terminal and scrollbar layers, and thus will not
* overwrite any text or other content currently on the screen. This is only
* necessary to paint over parts of the terminal background which may otherwise
* be transparent (the default layer background).
*
* @param terminal
* The terminal whose background should be painted or repainted.
*
* @param width
* The width of the background to draw, in pixels.
*
* @param height
* The height of the background to draw, in pixels.
*/
static void guac_terminal_paint_background(guac_terminal* terminal,
int width, int height) {
guac_terminal_display* display = terminal->display;
guac_client* client = display->client;
guac_socket* socket = client->socket;
/* Get background color */
const guac_terminal_color* color =
&guac_terminal_palette[display->default_background];
/* Paint background color */
guac_protocol_send_rect(socket, GUAC_DEFAULT_LAYER, 0, 0, width, height);
guac_protocol_send_cfill(socket, GUAC_COMP_OVER, GUAC_DEFAULT_LAYER,
color->red, color->green, color->blue, 0xFF);
}
guac_terminal* guac_terminal_create(guac_client* client,
const char* font_name, int font_size, int dpi,
int width, int height, const char* color_scheme) {
int default_foreground;
int default_background;
/* Default to "gray-black" color scheme if no scheme provided */
if (color_scheme == NULL || color_scheme[0] == '\0') {
default_foreground = GUAC_TERMINAL_COLOR_GRAY;
default_background = GUAC_TERMINAL_COLOR_BLACK;
}
/* Otherwise, parse color scheme */
else if (strcmp(color_scheme, GUAC_TERMINAL_SCHEME_GRAY_BLACK) == 0) {
default_foreground = GUAC_TERMINAL_COLOR_GRAY;
default_background = GUAC_TERMINAL_COLOR_BLACK;
}
else if (strcmp(color_scheme, GUAC_TERMINAL_SCHEME_BLACK_WHITE) == 0) {
default_foreground = GUAC_TERMINAL_COLOR_BLACK;
default_background = GUAC_TERMINAL_COLOR_WHITE;
}
else if (strcmp(color_scheme, GUAC_TERMINAL_SCHEME_GREEN_BLACK) == 0) {
default_foreground = GUAC_TERMINAL_COLOR_DARK_GREEN;
default_background = GUAC_TERMINAL_COLOR_BLACK;
}
else if (strcmp(color_scheme, GUAC_TERMINAL_SCHEME_WHITE_BLACK) == 0) {
default_foreground = GUAC_TERMINAL_COLOR_WHITE;
default_background = GUAC_TERMINAL_COLOR_BLACK;
}
/* If invalid, default to "gray-black" */
else {
guac_client_log(client, GUAC_LOG_WARNING,
"Invalid color scheme: \"%s\". Defaulting to \"gray-black\".",
color_scheme);
default_foreground = GUAC_TERMINAL_COLOR_GRAY;
default_background = GUAC_TERMINAL_COLOR_BLACK;
}
/* Build default character using default colors */
guac_terminal_char default_char = {
.value = 0,
.attributes = {
.foreground = default_foreground,
.background = default_background,
.bold = false,
.reverse = false,
.underscore = false
},
.width = 1
};
/* Calculate available display area */
int available_width = width - GUAC_TERMINAL_SCROLLBAR_WIDTH;
if (available_width < 0)
available_width = 0;
guac_terminal* term = malloc(sizeof(guac_terminal));
term->client = client;
term->upload_path_handler = NULL;
term->file_download_handler = NULL;
/* Init buffer */
term->buffer = guac_terminal_buffer_alloc(1000, &default_char);
/* Init display */
term->display = guac_terminal_display_alloc(client,
font_name, font_size, dpi,
default_char.attributes.foreground,
default_char.attributes.background);
/* Fail if display init failed */
if (term->display == NULL) {
guac_client_log(client, GUAC_LOG_DEBUG, "Display initialization failed");
free(term);
return NULL;
}
/* Init terminal state */
term->current_attributes = default_char.attributes;
term->default_char = default_char;
term->term_width = available_width / term->display->char_width;
term->term_height = height / term->display->char_height;
/* Open STDOUT pipe */
if (pipe(term->stdout_pipe_fd)) {
guac_error = GUAC_STATUS_SEE_ERRNO;
guac_error_message = "Unable to open pipe for STDOUT";
free(term);
return NULL;
}
/* Open STDIN pipe */
if (pipe(term->stdin_pipe_fd)) {
guac_error = GUAC_STATUS_SEE_ERRNO;
guac_error_message = "Unable to open pipe for STDIN";
free(term);
return NULL;
}
/* Init terminal lock */
pthread_mutex_init(&(term->lock), NULL);
/* Size display */
guac_protocol_send_size(term->display->client->socket,
GUAC_DEFAULT_LAYER, width, height);
guac_terminal_paint_background(term, width, height);
guac_terminal_display_resize(term->display,
term->term_width, term->term_height);
/* Allocate scrollbar */
term->scrollbar = guac_terminal_scrollbar_alloc(term->client,
GUAC_DEFAULT_LAYER, width, height, term->term_height);
/* Associate scrollbar with this terminal */
term->scrollbar->data = term;
term->scrollbar->scroll_handler = guac_terminal_scroll_handler;
/* Init terminal */
guac_terminal_reset(term);
term->mod_alt =
term->mod_ctrl =
term->mod_shift = 0;
/* Set up mouse cursors */
term->pointer_cursor = guac_terminal_create_pointer(client);
term->ibar_cursor = guac_terminal_create_ibar(client);
term->blank_cursor = guac_terminal_create_blank(client);
/* Initialize mouse cursor */
term->current_cursor = term->blank_cursor;
guac_terminal_set_cursor(term->client, term->current_cursor);
/* Allocate clipboard */
term->clipboard = guac_common_clipboard_alloc(GUAC_TERMINAL_CLIPBOARD_MAX_LENGTH);
return term;
}
void guac_terminal_free(guac_terminal* term) {
/* Close terminal output pipe */
close(term->stdout_pipe_fd[1]);
close(term->stdout_pipe_fd[0]);
/* Close user input pipe */
close(term->stdin_pipe_fd[1]);
close(term->stdin_pipe_fd[0]);
/* Free display */
guac_terminal_display_free(term->display);
/* Free buffer */
guac_terminal_buffer_free(term->buffer);
/* Free clipboard */
guac_common_clipboard_free(term->clipboard);
/* Free scrollbar */
guac_terminal_scrollbar_free(term->scrollbar);
/* Free cursors */
guac_terminal_cursor_free(term->client, term->pointer_cursor);
guac_terminal_cursor_free(term->client, term->ibar_cursor);
guac_terminal_cursor_free(term->client, term->blank_cursor);
}
/**
* Waits for data to become available on the given file descriptor.
*
* @param fd
* The file descriptor to wait on.
*
* @param msec_timeout
* The maximum amount of time to wait, in milliseconds.
*
* @return
* A positive if data is available, zero if the timeout has elapsed without
* data becoming available, or negative if an error occurred.
*/
static int guac_terminal_wait_for_data(int fd, int msec_timeout) {
/* Build fd_set */
fd_set fds;
FD_ZERO(&fds);
FD_SET(fd, &fds);
/* Split millisecond timeout into seconds and microseconds */
struct timeval timeout = {
.tv_sec = msec_timeout / 1000,
.tv_usec = (msec_timeout % 1000) * 1000
};
/* Wait for data */
return select(fd+1, &fds, NULL, NULL, &timeout);
}
int guac_terminal_render_frame(guac_terminal* terminal) {
guac_client* client = terminal->client;
char buffer[GUAC_TERMINAL_PACKET_SIZE];
int wait_result;
int fd = terminal->stdout_pipe_fd[0];
/* Wait for data to be available */
wait_result = guac_terminal_wait_for_data(fd, 1000);
if (wait_result > 0) {
guac_terminal_lock(terminal);
guac_timestamp frame_start = guac_timestamp_current();
do {
guac_timestamp frame_end;
int frame_remaining;
int bytes_read;
/* Read data, write to terminal */
if ((bytes_read = guac_terminal_packet_read(fd,
buffer, sizeof(buffer))) > 0) {
if (guac_terminal_write(terminal, buffer, bytes_read)) {
guac_client_abort(client,
GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Error writing data");
guac_terminal_unlock(terminal);
return 1;
}
}
/* Notify on error */
if (bytes_read < 0) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Error reading data");
guac_terminal_unlock(terminal);
return 1;
}
/* Calculate time remaining in frame */
frame_end = guac_timestamp_current();
frame_remaining = frame_start + GUAC_TERMINAL_FRAME_DURATION
- frame_end;
/* Wait again if frame remaining */
if (frame_remaining > 0)
wait_result = guac_terminal_wait_for_data(fd,
GUAC_TERMINAL_FRAME_TIMEOUT);
else
break;
} while (wait_result > 0);
/* Flush terminal */
guac_terminal_flush(terminal);
guac_terminal_unlock(terminal);
}
/* Notify of any errors */
if (wait_result < 0) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Error waiting for data");
return 1;
}
return 0;
}
int guac_terminal_read_stdin(guac_terminal* terminal, char* c, int size) {
int stdin_fd = terminal->stdin_pipe_fd[0];
return read(stdin_fd, c, size);
}
int guac_terminal_write_stdout(guac_terminal* terminal, const char* c,
int size) {
/* Write maximally-sized packets until only one packet remains */
while (size > GUAC_TERMINAL_PACKET_SIZE) {
/* Write maximally-sized packet */
if (guac_terminal_packet_write(terminal->stdout_pipe_fd[1], c,
GUAC_TERMINAL_PACKET_SIZE) < 0)
return -1;
/* Advance to next packet */
c += GUAC_TERMINAL_PACKET_SIZE;
size -= GUAC_TERMINAL_PACKET_SIZE;
}
return guac_terminal_packet_write(terminal->stdout_pipe_fd[1], c, size);
}
int guac_terminal_notify(guac_terminal* terminal) {
return guac_terminal_packet_write(terminal->stdout_pipe_fd[1], NULL, 0);
}
int guac_terminal_printf(guac_terminal* terminal, const char* format, ...) {
int written;
va_list ap;
char buffer[1024];
/* Print to buffer */
va_start(ap, format);
written = vsnprintf(buffer, sizeof(buffer)-1, format, ap);
va_end(ap);
if (written < 0)
return written;
/* Write to STDOUT */
return guac_terminal_write_stdout(terminal, buffer, written);
}
void guac_terminal_prompt(guac_terminal* terminal, const char* title, char* str, int size, bool echo) {
int pos;
char in_byte;
/* Print title */
guac_terminal_printf(terminal, "%s", title);
/* Make room for null terminator */
size--;
/* Read bytes until newline */
pos = 0;
while (pos < size && guac_terminal_read_stdin(terminal, &in_byte, 1) == 1) {
/* Backspace */
if (in_byte == 0x7F) {
if (pos > 0) {
guac_terminal_printf(terminal, "\b \b");
pos--;
}
}
/* CR (end of input */
else if (in_byte == 0x0D) {
guac_terminal_printf(terminal, "\r\n");
break;
}
else {
/* Store character, update buffers */
str[pos++] = in_byte;
/* Print character if echoing */
if (echo)
guac_terminal_printf(terminal, "%c", in_byte);
else
guac_terminal_printf(terminal, "*");
}
}
/* Terminate string */
str[pos] = 0;
}
int guac_terminal_set(guac_terminal* term, int row, int col, int codepoint) {
int width;
/* Build character with current attributes */
guac_terminal_char guac_char;
guac_char.value = codepoint;
guac_char.attributes = term->current_attributes;
width = wcwidth(codepoint);
if (width < 0)
width = 1;
guac_char.width = width;
guac_terminal_set_columns(term, row, col, col + width - 1, &guac_char);
return 0;
}
void guac_terminal_commit_cursor(guac_terminal* term) {
guac_terminal_char* guac_char;
guac_terminal_buffer_row* old_row;
guac_terminal_buffer_row* new_row;
/* If no change, done */
if (term->visible_cursor_row == term->cursor_row && term->visible_cursor_col == term->cursor_col)
return;
/* Get old and new rows with cursor */
new_row = guac_terminal_buffer_get_row(term->buffer, term->cursor_row, term->cursor_col+1);
old_row = guac_terminal_buffer_get_row(term->buffer, term->visible_cursor_row, term->visible_cursor_col+1);
/* Clear cursor */
guac_char = &(old_row->characters[term->visible_cursor_col]);
guac_char->attributes.cursor = false;
guac_terminal_display_set_columns(term->display, term->visible_cursor_row + term->scroll_offset,
term->visible_cursor_col, term->visible_cursor_col, guac_char);
/* Set cursor */
guac_char = &(new_row->characters[term->cursor_col]);
guac_char->attributes.cursor = true;
guac_terminal_display_set_columns(term->display, term->cursor_row + term->scroll_offset,
term->cursor_col, term->cursor_col, guac_char);
term->visible_cursor_row = term->cursor_row;
term->visible_cursor_col = term->cursor_col;
return;
}
int guac_terminal_write(guac_terminal* term, const char* c, int size) {
while (size > 0) {
term->char_handler(term, *(c++));
size--;
}
return 0;
}
int guac_terminal_scroll_up(guac_terminal* term,
int start_row, int end_row, int amount) {
/* If scrolling entire display, update scroll offset */
if (start_row == 0 && end_row == term->term_height - 1) {
/* Scroll up visibly */
guac_terminal_display_copy_rows(term->display, start_row + amount, end_row, -amount);
/* Advance by scroll amount */
term->buffer->top += amount;
if (term->buffer->top >= term->buffer->available)
term->buffer->top -= term->buffer->available;
term->buffer->length += amount;
if (term->buffer->length > term->buffer->available)
term->buffer->length = term->buffer->available;
/* Reset scrollbar bounds */
guac_terminal_scrollbar_set_bounds(term->scrollbar, term->term_height - term->buffer->length, 0);
/* Update cursor location if within region */
if (term->visible_cursor_row >= start_row &&
term->visible_cursor_row <= end_row)
term->visible_cursor_row -= amount;
}
/* Otherwise, just copy row data upwards */
else
guac_terminal_copy_rows(term, start_row + amount, end_row, -amount);
/* Clear new area */
guac_terminal_clear_range(term,
end_row - amount + 1, 0,
end_row, term->term_width - 1);
return 0;
}
int guac_terminal_scroll_down(guac_terminal* term,
int start_row, int end_row, int amount) {
guac_terminal_copy_rows(term, start_row, end_row - amount, amount);
/* Clear new area */
guac_terminal_clear_range(term,
start_row, 0,
start_row + amount - 1, term->term_width - 1);
return 0;
}
int guac_terminal_clear_columns(guac_terminal* term,
int row, int start_col, int end_col) {
/* Build space */
guac_terminal_char blank;
blank.value = 0;
blank.attributes = term->current_attributes;
blank.width = 1;
/* Clear */
guac_terminal_set_columns(term,
row, start_col, end_col, &blank);
return 0;
}
int guac_terminal_clear_range(guac_terminal* term,
int start_row, int start_col,
int end_row, int end_col) {
/* If not at far left, must clear sub-region to far right */
if (start_col > 0) {
/* Clear from start_col to far right */
guac_terminal_clear_columns(term,
start_row, start_col, term->term_width - 1);
/* One less row to clear */
start_row++;
}
/* If not at far right, must clear sub-region to far left */
if (end_col < term->term_width - 1) {
/* Clear from far left to end_col */
guac_terminal_clear_columns(term, end_row, 0, end_col);
/* One less row to clear */
end_row--;
}
/* Remaining region now guaranteed rectangular. Clear, if possible */
if (start_row <= end_row) {
int row;
for (row=start_row; row<=end_row; row++) {
/* Clear entire row */
guac_terminal_clear_columns(term, row, 0, term->term_width - 1);
}
}
return 0;
}
void guac_terminal_scroll_display_down(guac_terminal* terminal,
int scroll_amount) {
int start_row, end_row;
int dest_row;
int row, column;
/* Limit scroll amount by size of scrollback buffer */
if (scroll_amount > terminal->scroll_offset)
scroll_amount = terminal->scroll_offset;
/* If not scrolling at all, don't bother trying */
if (scroll_amount <= 0)
return;
/* Shift screen up */
if (terminal->term_height > scroll_amount)
guac_terminal_display_copy_rows(terminal->display,
scroll_amount, terminal->term_height - 1,
-scroll_amount);
/* Advance by scroll amount */
terminal->scroll_offset -= scroll_amount;
guac_terminal_scrollbar_set_value(terminal->scrollbar, -terminal->scroll_offset);
/* Get row range */
end_row = terminal->term_height - terminal->scroll_offset - 1;
start_row = end_row - scroll_amount + 1;
dest_row = terminal->term_height - scroll_amount;
/* Draw new rows from scrollback */
for (row=start_row; row<=end_row; row++) {
/* Get row from scrollback */
guac_terminal_buffer_row* buffer_row =
guac_terminal_buffer_get_row(terminal->buffer, row, 0);
/* Clear row */
guac_terminal_display_set_columns(terminal->display,
dest_row, 0, terminal->display->width, &(terminal->default_char));
/* Draw row */
guac_terminal_char* current = buffer_row->characters;
for (column=0; columnlength; column++) {
/* Only draw if not blank */
if (guac_terminal_has_glyph(current->value))
guac_terminal_display_set_columns(terminal->display, dest_row, column, column, current);
current++;
}
/* Next row */
dest_row++;
}
guac_terminal_notify(terminal);
}
void guac_terminal_scroll_display_up(guac_terminal* terminal,
int scroll_amount) {
int start_row, end_row;
int dest_row;
int row, column;
/* Limit scroll amount by size of scrollback buffer */
if (terminal->scroll_offset + scroll_amount > terminal->buffer->length - terminal->term_height)
scroll_amount = terminal->buffer->length - terminal->scroll_offset - terminal->term_height;
/* If not scrolling at all, don't bother trying */
if (scroll_amount <= 0)
return;
/* Shift screen down */
if (terminal->term_height > scroll_amount)
guac_terminal_display_copy_rows(terminal->display,
0, terminal->term_height - scroll_amount - 1,
scroll_amount);
/* Advance by scroll amount */
terminal->scroll_offset += scroll_amount;
guac_terminal_scrollbar_set_value(terminal->scrollbar, -terminal->scroll_offset);
/* Get row range */
start_row = -terminal->scroll_offset;
end_row = start_row + scroll_amount - 1;
dest_row = 0;
/* Draw new rows from scrollback */
for (row=start_row; row<=end_row; row++) {
/* Get row from scrollback */
guac_terminal_buffer_row* buffer_row =
guac_terminal_buffer_get_row(terminal->buffer, row, 0);
/* Clear row */
guac_terminal_display_set_columns(terminal->display,
dest_row, 0, terminal->display->width, &(terminal->default_char));
/* Draw row */
guac_terminal_char* current = buffer_row->characters;
for (column=0; columnlength; column++) {
/* Only draw if not blank */
if (guac_terminal_has_glyph(current->value))
guac_terminal_display_set_columns(terminal->display, dest_row, column, column, current);
current++;
}
/* Next row */
dest_row++;
}
guac_terminal_notify(terminal);
}
void guac_terminal_select_redraw(guac_terminal* terminal) {
int start_row = terminal->selection_start_row + terminal->scroll_offset;
int start_column = terminal->selection_start_column;
int end_row = terminal->selection_end_row + terminal->scroll_offset;
int end_column = terminal->selection_end_column;
/* Update start/end columns to include character width */
if (start_row > end_row || (start_row == end_row && start_column > end_column))
start_column += terminal->selection_start_width - 1;
else
end_column += terminal->selection_end_width - 1;
guac_terminal_display_select(terminal->display, start_row, start_column, end_row, end_column);
}
/**
* Locates the beginning of the character at the given row and column, updating
* the column to the starting column of that character. The width, if available,
* is returned. If the character has no defined width, 1 is returned.
*/
static int __guac_terminal_find_char(guac_terminal* terminal, int row, int* column) {
int start_column = *column;
guac_terminal_buffer_row* buffer_row = guac_terminal_buffer_get_row(terminal->buffer, row, 0);
if (start_column < buffer_row->length) {
/* Find beginning of character */
guac_terminal_char* start_char = &(buffer_row->characters[start_column]);
while (start_column > 0 && start_char->value == GUAC_CHAR_CONTINUATION) {
start_char--;
start_column--;
}
/* Use width, if available */
if (start_char->value != GUAC_CHAR_CONTINUATION) {
*column = start_column;
return start_char->width;
}
}
/* Default to one column wide */
return 1;
}
void guac_terminal_select_start(guac_terminal* terminal, int row, int column) {
int width = __guac_terminal_find_char(terminal, row, &column);
terminal->selection_start_row =
terminal->selection_end_row = row;
terminal->selection_start_column =
terminal->selection_end_column = column;
terminal->selection_start_width =
terminal->selection_end_width = width;
terminal->text_selected = true;
guac_terminal_select_redraw(terminal);
}
void guac_terminal_select_update(guac_terminal* terminal, int row, int column) {
/* Only update if selection has changed */
if (row != terminal->selection_end_row
|| column < terminal->selection_end_column
|| column >= terminal->selection_end_column + terminal->selection_end_width) {
int width = __guac_terminal_find_char(terminal, row, &column);
terminal->selection_end_row = row;
terminal->selection_end_column = column;
terminal->selection_end_width = width;
guac_terminal_select_redraw(terminal);
}
}
int __guac_terminal_buffer_string(guac_terminal_buffer_row* row, int start, int end, char* string) {
int length = 0;
int i;
for (i=start; i<=end; i++) {
int codepoint = row->characters[i].value;
/* If not null (blank), add to string */
if (codepoint != 0 && codepoint != GUAC_CHAR_CONTINUATION) {
int bytes = guac_terminal_encode_utf8(codepoint, string);
string += bytes;
length += bytes;
}
}
return length;
}
void guac_terminal_select_end(guac_terminal* terminal, char* string) {
/* Deselect */
terminal->text_selected = false;
guac_terminal_display_commit_select(terminal->display);
guac_terminal_buffer_row* buffer_row;
int row;
int start_row, start_col;
int end_row, end_col;
/* Ensure proper ordering of start and end coords */
if (terminal->selection_start_row < terminal->selection_end_row
|| (terminal->selection_start_row == terminal->selection_end_row
&& terminal->selection_start_column < terminal->selection_end_column)) {
start_row = terminal->selection_start_row;
start_col = terminal->selection_start_column;
end_row = terminal->selection_end_row;
end_col = terminal->selection_end_column + terminal->selection_end_width - 1;
}
else {
end_row = terminal->selection_start_row;
end_col = terminal->selection_start_column + terminal->selection_start_width - 1;
start_row = terminal->selection_end_row;
start_col = terminal->selection_end_column;
}
/* If only one row, simply copy */
buffer_row = guac_terminal_buffer_get_row(terminal->buffer, start_row, 0);
if (end_row == start_row) {
if (buffer_row->length - 1 < end_col)
end_col = buffer_row->length - 1;
string += __guac_terminal_buffer_string(buffer_row, start_col, end_col, string);
}
/* Otherwise, copy multiple rows */
else {
/* Store first row */
string += __guac_terminal_buffer_string(buffer_row, start_col, buffer_row->length - 1, string);
/* Store all middle rows */
for (row=start_row+1; rowbuffer, row, 0);
*(string++) = '\n';
string += __guac_terminal_buffer_string(buffer_row, 0, buffer_row->length - 1, string);
}
/* Store last row */
buffer_row = guac_terminal_buffer_get_row(terminal->buffer, end_row, 0);
if (buffer_row->length - 1 < end_col)
end_col = buffer_row->length - 1;
*(string++) = '\n';
string += __guac_terminal_buffer_string(buffer_row, 0, end_col, string);
}
/* Null terminator */
*string = 0;
}
void guac_terminal_copy_columns(guac_terminal* terminal, int row,
int start_column, int end_column, int offset) {
guac_terminal_display_copy_columns(terminal->display, row + terminal->scroll_offset,
start_column, end_column, offset);
guac_terminal_buffer_copy_columns(terminal->buffer, row,
start_column, end_column, offset);
/* Update cursor location if within region */
if (row == terminal->visible_cursor_row &&
terminal->visible_cursor_col >= start_column &&
terminal->visible_cursor_col <= end_column)
terminal->visible_cursor_col += offset;
/* Force breaks around destination region */
__guac_terminal_force_break(terminal, row, start_column + offset);
__guac_terminal_force_break(terminal, row, end_column + offset + 1);
}
void guac_terminal_copy_rows(guac_terminal* terminal,
int start_row, int end_row, int offset) {
guac_terminal_display_copy_rows(terminal->display,
start_row + terminal->scroll_offset, end_row + terminal->scroll_offset, offset);
guac_terminal_buffer_copy_rows(terminal->buffer,
start_row, end_row, offset);
/* Update cursor location if within region */
if (terminal->visible_cursor_row >= start_row &&
terminal->visible_cursor_row <= end_row)
terminal->visible_cursor_row += offset;
}
void guac_terminal_set_columns(guac_terminal* terminal, int row,
int start_column, int end_column, guac_terminal_char* character) {
__guac_terminal_set_columns(terminal, row, start_column, end_column, character);
/* If visible cursor in current row, preserve state */
if (row == terminal->visible_cursor_row
&& terminal->visible_cursor_col >= start_column
&& terminal->visible_cursor_col <= end_column) {
/* Create copy of character with cursor attribute set */
guac_terminal_char cursor_character = *character;
cursor_character.attributes.cursor = true;
__guac_terminal_set_columns(terminal, row,
terminal->visible_cursor_col, terminal->visible_cursor_col, &cursor_character);
}
/* Force breaks around destination region */
__guac_terminal_force_break(terminal, row, start_column);
__guac_terminal_force_break(terminal, row, end_column + 1);
}
static void __guac_terminal_redraw_rect(guac_terminal* term, int start_row, int start_col, int end_row, int end_col) {
int row, col;
/* Redraw region */
for (row=start_row; row<=end_row; row++) {
guac_terminal_buffer_row* buffer_row =
guac_terminal_buffer_get_row(term->buffer, row - term->scroll_offset, 0);
/* Clear row */
guac_terminal_display_set_columns(term->display,
row, start_col, end_col, &(term->default_char));
/* Copy characters */
for (col=start_col; col <= end_col && col < buffer_row->length; col++) {
/* Only redraw if not blank */
guac_terminal_char* c = &(buffer_row->characters[col]);
if (guac_terminal_has_glyph(c->value))
guac_terminal_display_set_columns(term->display, row, col, col, c);
}
}
}
/**
* Internal terminal resize routine. Accepts width/height in CHARACTERS
* (not pixels like the public function).
*/
static void __guac_terminal_resize(guac_terminal* term, int width, int height) {
/* If height is decreasing, shift display up */
if (height < term->term_height) {
int shift_amount;
/* Get number of rows actually occupying terminal space */
int used_height = term->buffer->length;
if (used_height > term->term_height)
used_height = term->term_height;
shift_amount = used_height - height;
/* If the new terminal bottom covers N rows, shift up N rows */
if (shift_amount > 0) {
guac_terminal_display_copy_rows(term->display,
shift_amount, term->display->height - 1, -shift_amount);
/* Update buffer top and cursor row based on shift */
term->buffer->top += shift_amount;
term->cursor_row -= shift_amount;
term->visible_cursor_row -= shift_amount;
/* Redraw characters within old region */
__guac_terminal_redraw_rect(term, height - shift_amount, 0, height-1, width-1);
}
}
/* Resize display */
guac_terminal_display_flush(term->display);
guac_terminal_display_resize(term->display, width, height);
/* Reraw any characters on right if widening */
if (width > term->term_width)
__guac_terminal_redraw_rect(term, 0, term->term_width-1, height-1, width-1);
/* If height is increasing, shift display down */
if (height > term->term_height) {
/* If undisplayed rows exist in the buffer, shift them into view */
if (term->term_height < term->buffer->length) {
/* If the new terminal bottom reveals N rows, shift down N rows */
int shift_amount = height - term->term_height;
/* The maximum amount we can shift is the number of undisplayed rows */
int max_shift = term->buffer->length - term->term_height;
if (shift_amount > max_shift)
shift_amount = max_shift;
/* Update buffer top and cursor row based on shift */
term->buffer->top -= shift_amount;
term->cursor_row += shift_amount;
term->visible_cursor_row += shift_amount;
/* If scrolled enough, use scroll to fulfill entire resize */
if (term->scroll_offset >= shift_amount) {
term->scroll_offset -= shift_amount;
guac_terminal_scrollbar_set_value(term->scrollbar, -term->scroll_offset);
/* Draw characters from scroll at bottom */
__guac_terminal_redraw_rect(term, term->term_height, 0, term->term_height + shift_amount - 1, width-1);
}
/* Otherwise, fulfill with as much scroll as possible */
else {
/* Draw characters from scroll at bottom */
__guac_terminal_redraw_rect(term, term->term_height, 0, term->term_height + term->scroll_offset - 1, width-1);
/* Update shift_amount and scroll based on new rows */
shift_amount -= term->scroll_offset;
term->scroll_offset = 0;
guac_terminal_scrollbar_set_value(term->scrollbar, -term->scroll_offset);
/* If anything remains, move screen as necessary */
if (shift_amount > 0) {
guac_terminal_display_copy_rows(term->display,
0, term->display->height - shift_amount - 1, shift_amount);
/* Draw characters at top from scroll */
__guac_terminal_redraw_rect(term, 0, 0, shift_amount - 1, width-1);
}
}
} /* end if undisplayed rows exist */
}
/* Keep cursor on screen */
if (term->cursor_row < 0) term->cursor_row = 0;
if (term->cursor_row >= height) term->cursor_row = height-1;
if (term->cursor_col < 0) term->cursor_col = 0;
if (term->cursor_col >= width) term->cursor_col = width-1;
/* Commit new dimensions */
term->term_width = width;
term->term_height = height;
}
int guac_terminal_resize(guac_terminal* terminal, int width, int height) {
guac_terminal_display* display = terminal->display;
guac_client* client = display->client;
guac_socket* socket = client->socket;
/* Acquire exclusive access to terminal */
guac_terminal_lock(terminal);
/* Calculate available display area */
int available_width = width - GUAC_TERMINAL_SCROLLBAR_WIDTH;
if (available_width < 0)
available_width = 0;
/* Calculate dimensions */
int rows = height / display->char_height;
int columns = available_width / display->char_width;
/* Resize default layer to given pixel dimensions */
guac_protocol_send_size(socket, GUAC_DEFAULT_LAYER, width, height);
guac_terminal_paint_background(terminal, width, height);
/* Notify scrollbar of resize */
guac_terminal_scrollbar_parent_resized(terminal->scrollbar, width, height, rows);
guac_terminal_scrollbar_set_bounds(terminal->scrollbar, rows - terminal->buffer->length, 0);
/* Resize terminal if row/column dimensions have changed */
if (columns != terminal->term_width || rows != terminal->term_height) {
guac_client_log(client, GUAC_LOG_DEBUG,
"Resizing terminal to %ix%i", rows, columns);
/* Resize terminal */
__guac_terminal_resize(terminal, columns, rows);
/* Reset scroll region */
terminal->scroll_end = rows - 1;
}
/* Release terminal */
guac_terminal_unlock(terminal);
guac_terminal_notify(terminal);
return 0;
}
void guac_terminal_flush(guac_terminal* terminal) {
guac_terminal_commit_cursor(terminal);
guac_terminal_display_flush(terminal->display);
guac_terminal_scrollbar_flush(terminal->scrollbar);
}
void guac_terminal_lock(guac_terminal* terminal) {
pthread_mutex_lock(&(terminal->lock));
}
void guac_terminal_unlock(guac_terminal* terminal) {
pthread_mutex_unlock(&(terminal->lock));
}
int guac_terminal_send_data(guac_terminal* term, const char* data, int length) {
return guac_terminal_write_all(term->stdin_pipe_fd[1], data, length);
}
int guac_terminal_send_string(guac_terminal* term, const char* data) {
return guac_terminal_write_all(term->stdin_pipe_fd[1], data, strlen(data));
}
static int __guac_terminal_send_key(guac_terminal* term, int keysym, int pressed) {
/* Hide mouse cursor if not already hidden */
if (term->current_cursor != term->blank_cursor) {
term->current_cursor = term->blank_cursor;
guac_terminal_set_cursor(term->client, term->blank_cursor);
guac_terminal_notify(term);
}
/* Track modifiers */
if (keysym == 0xFFE3)
term->mod_ctrl = pressed;
else if (keysym == 0xFFE9)
term->mod_alt = pressed;
else if (keysym == 0xFFE1)
term->mod_shift = pressed;
/* If key pressed */
else if (pressed) {
/* Ctrl+Shift+V shortcut for paste */
if (keysym == 'V' && term->mod_ctrl)
return guac_terminal_send_data(term, term->clipboard->buffer, term->clipboard->length);
/* Shift+PgUp / Shift+PgDown shortcuts for scrolling */
if (term->mod_shift) {
/* Page up */
if (keysym == 0xFF55) {
guac_terminal_scroll_display_up(term, term->term_height);
return 0;
}
/* Page down */
if (keysym == 0xFF56) {
guac_terminal_scroll_display_down(term, term->term_height);
return 0;
}
}
/* Reset scroll */
if (term->scroll_offset != 0)
guac_terminal_scroll_display_down(term, term->scroll_offset);
/* If alt being held, also send escape character */
if (term->mod_alt)
return guac_terminal_send_string(term, "\x1B");
/* Translate Ctrl+letter to control code */
if (term->mod_ctrl) {
char data;
/* Keysyms for '@' through '_' are all conveniently in C0 order */
if (keysym >= '@' && keysym <= '_')
data = (char) (keysym - '@');
/* Handle lowercase as well */
else if (keysym >= 'a' && keysym <= 'z')
data = (char) (keysym - 'a' + 1);
/* Ctrl+? is DEL (0x7f) */
else if (keysym == '?')
data = 0x7F;
/* Map Ctrl+2 to same result as Ctrl+@ */
else if (keysym == '2')
data = 0x00;
/* Map Ctrl+3 through Ctrl-7 to the remaining C0 characters such that Ctrl+6 is the same as Ctrl+^ */
else if (keysym >= '3' && keysym <= '7')
data = (char) (keysym - '3' + 0x1B);
/* Otherwise ignore */
else
return 0;
return guac_terminal_send_data(term, &data, 1);
}
/* Translate Unicode to UTF-8 */
else if ((keysym >= 0x00 && keysym <= 0xFF) || ((keysym & 0xFFFF0000) == 0x01000000)) {
int length;
char data[5];
length = guac_terminal_encode_utf8(keysym & 0xFFFF, data);
return guac_terminal_send_data(term, data, length);
}
/* Non-printable keys */
else {
if (keysym == 0xFF08) return guac_terminal_send_string(term, "\x7F"); /* Backspace */
if (keysym == 0xFF09) return guac_terminal_send_string(term, "\x09"); /* Tab */
if (keysym == 0xFF0D) return guac_terminal_send_string(term, "\x0D"); /* Enter */
if (keysym == 0xFF1B) return guac_terminal_send_string(term, "\x1B"); /* Esc */
if (keysym == 0xFF50) return guac_terminal_send_string(term, "\x1B[1~"); /* Home */
/* Arrow keys w/ application cursor */
if (term->application_cursor_keys) {
if (keysym == 0xFF51) return guac_terminal_send_string(term, "\x1BOD"); /* Left */
if (keysym == 0xFF52) return guac_terminal_send_string(term, "\x1BOA"); /* Up */
if (keysym == 0xFF53) return guac_terminal_send_string(term, "\x1BOC"); /* Right */
if (keysym == 0xFF54) return guac_terminal_send_string(term, "\x1BOB"); /* Down */
}
else {
if (keysym == 0xFF51) return guac_terminal_send_string(term, "\x1B[D"); /* Left */
if (keysym == 0xFF52) return guac_terminal_send_string(term, "\x1B[A"); /* Up */
if (keysym == 0xFF53) return guac_terminal_send_string(term, "\x1B[C"); /* Right */
if (keysym == 0xFF54) return guac_terminal_send_string(term, "\x1B[B"); /* Down */
}
if (keysym == 0xFF55) return guac_terminal_send_string(term, "\x1B[5~"); /* Page up */
if (keysym == 0xFF56) return guac_terminal_send_string(term, "\x1B[6~"); /* Page down */
if (keysym == 0xFF57) return guac_terminal_send_string(term, "\x1B[4~"); /* End */
if (keysym == 0xFF63) return guac_terminal_send_string(term, "\x1B[2~"); /* Insert */
if (keysym == 0xFFBE) return guac_terminal_send_string(term, "\x1B[[A"); /* F1 */
if (keysym == 0xFFBF) return guac_terminal_send_string(term, "\x1B[[B"); /* F2 */
if (keysym == 0xFFC0) return guac_terminal_send_string(term, "\x1B[[C"); /* F3 */
if (keysym == 0xFFC1) return guac_terminal_send_string(term, "\x1B[[D"); /* F4 */
if (keysym == 0xFFC2) return guac_terminal_send_string(term, "\x1B[[E"); /* F5 */
if (keysym == 0xFFC3) return guac_terminal_send_string(term, "\x1B[17~"); /* F6 */
if (keysym == 0xFFC4) return guac_terminal_send_string(term, "\x1B[18~"); /* F7 */
if (keysym == 0xFFC5) return guac_terminal_send_string(term, "\x1B[19~"); /* F8 */
if (keysym == 0xFFC6) return guac_terminal_send_string(term, "\x1B[20~"); /* F9 */
if (keysym == 0xFFC7) return guac_terminal_send_string(term, "\x1B[21~"); /* F10 */
if (keysym == 0xFFC8) return guac_terminal_send_string(term, "\x1B[22~"); /* F11 */
if (keysym == 0xFFC9) return guac_terminal_send_string(term, "\x1B[23~"); /* F12 */
if (keysym == 0xFFFF) return guac_terminal_send_string(term, "\x1B[3~"); /* Delete */
/* Ignore unknown keys */
guac_client_log(term->client, GUAC_LOG_DEBUG,
"Ignoring unknown keysym: 0x%X", keysym);
}
}
return 0;
}
int guac_terminal_send_key(guac_terminal* term, int keysym, int pressed) {
int result;
guac_terminal_lock(term);
result = __guac_terminal_send_key(term, keysym, pressed);
guac_terminal_unlock(term);
return result;
}
static int __guac_terminal_send_mouse(guac_terminal* term, int x, int y, int mask) {
guac_client* client = term->client;
guac_socket* socket = client->socket;
/* Determine which buttons were just released and pressed */
int released_mask = term->mouse_mask & ~mask;
int pressed_mask = ~term->mouse_mask & mask;
/* Notify scrollbar, do not handle anything handled by scrollbar */
if (guac_terminal_scrollbar_handle_mouse(term->scrollbar, x, y, mask)) {
/* Set pointer cursor if mouse is over scrollbar */
if (term->current_cursor != term->pointer_cursor) {
term->current_cursor = term->pointer_cursor;
guac_terminal_set_cursor(client, term->pointer_cursor);
}
guac_terminal_notify(term);
return 0;
}
term->mouse_mask = mask;
/* Show mouse cursor if not already shown */
if (term->current_cursor != term->ibar_cursor) {
term->current_cursor = term->ibar_cursor;
guac_terminal_set_cursor(client, term->ibar_cursor);
guac_terminal_notify(term);
}
/* Paste contents of clipboard on right or middle mouse button up */
if ((released_mask & GUAC_CLIENT_MOUSE_RIGHT) || (released_mask & GUAC_CLIENT_MOUSE_MIDDLE))
return guac_terminal_send_data(term, term->clipboard->buffer, term->clipboard->length);
/* If text selected, change state based on left mouse mouse button */
if (term->text_selected) {
/* If mouse button released, stop selection */
if (released_mask & GUAC_CLIENT_MOUSE_LEFT) {
int selected_length;
/* End selection and get selected text */
int selectable_size = term->term_width * term->term_height * sizeof(char);
char* string = malloc(selectable_size);
guac_terminal_select_end(term, string);
selected_length = strnlen(string, selectable_size);
/* Store new data */
guac_common_clipboard_reset(term->clipboard, "text/plain");
guac_common_clipboard_append(term->clipboard, string, selected_length);
free(string);
/* Send data */
guac_common_clipboard_send(term->clipboard, client);
guac_socket_flush(socket);
}
/* Otherwise, just update */
else
guac_terminal_select_update(term,
y / term->display->char_height - term->scroll_offset,
x / term->display->char_width);
}
/* Otherwise, if mouse button pressed AND moved, start selection */
else if (!(pressed_mask & GUAC_CLIENT_MOUSE_LEFT) &&
mask & GUAC_CLIENT_MOUSE_LEFT)
guac_terminal_select_start(term,
y / term->display->char_height - term->scroll_offset,
x / term->display->char_width);
/* Scroll up if wheel moved up */
if (released_mask & GUAC_CLIENT_MOUSE_SCROLL_UP)
guac_terminal_scroll_display_up(term, GUAC_TERMINAL_WHEEL_SCROLL_AMOUNT);
/* Scroll down if wheel moved down */
if (released_mask & GUAC_CLIENT_MOUSE_SCROLL_DOWN)
guac_terminal_scroll_display_down(term, GUAC_TERMINAL_WHEEL_SCROLL_AMOUNT);
return 0;
}
int guac_terminal_send_mouse(guac_terminal* term, int x, int y, int mask) {
int result;
guac_terminal_lock(term);
result = __guac_terminal_send_mouse(term, x, y, mask);
guac_terminal_unlock(term);
return result;
}
void guac_terminal_scroll_handler(guac_terminal_scrollbar* scrollbar, int value) {
guac_terminal* terminal = (guac_terminal*) scrollbar->data;
/* Calculate change in scroll offset */
int delta = -value - terminal->scroll_offset;
/* Update terminal based on change in scroll offset */
if (delta < 0)
guac_terminal_scroll_display_down(terminal, -delta);
else if (delta > 0)
guac_terminal_scroll_display_up(terminal, delta);
/* Update scrollbar value */
guac_terminal_scrollbar_set_value(scrollbar, value);
}
void guac_terminal_clipboard_reset(guac_terminal* term, const char* mimetype) {
guac_common_clipboard_reset(term->clipboard, mimetype);
}
void guac_terminal_clipboard_append(guac_terminal* term, const void* data, int length) {
guac_common_clipboard_append(term->clipboard, data, length);
}
int guac_terminal_sendf(guac_terminal* term, const char* format, ...) {
int written;
va_list ap;
char buffer[1024];
/* Print to buffer */
va_start(ap, format);
written = vsnprintf(buffer, sizeof(buffer)-1, format, ap);
va_end(ap);
if (written < 0)
return written;
/* Write to STDIN */
return guac_terminal_write_all(term->stdin_pipe_fd[1], buffer, written);
}
void guac_terminal_set_tab(guac_terminal* term, int column) {
int i;
/* Search for available space, set if available */
for (i=0; icustom_tabs[i] == 0) {
term->custom_tabs[i] = column+1;
break;
}
}
}
void guac_terminal_unset_tab(guac_terminal* term, int column) {
int i;
/* Search for given tab, unset if found */
for (i=0; icustom_tabs[i] == column+1) {
term->custom_tabs[i] = 0;
break;
}
}
}
void guac_terminal_clear_tabs(guac_terminal* term) {
term->tab_interval = 0;
memset(term->custom_tabs, 0, sizeof(term->custom_tabs));
}
int guac_terminal_next_tab(guac_terminal* term, int column) {
int i;
/* Determine tab stop from interval */
int tabstop;
if (term->tab_interval != 0)
tabstop = (column / term->tab_interval + 1) * term->tab_interval;
else
tabstop = term->term_width - 1;
/* Walk custom tabs, trying to find an earlier occurrence */
for (i=0; icustom_tabs[i] - 1;
if (custom_tabstop != -1 && custom_tabstop > column && custom_tabstop < tabstop)
tabstop = custom_tabstop;
}
return tabstop;
}
guacamole-server-0.9.9/src/terminal/Makefile.in 0000664 0001751 0001751 00000106443 12645400276 016404 0000000 0000000 # Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 2015 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src/terminal
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp $(noinst_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libguac_terminal_la_DEPENDENCIES =
am_libguac_terminal_la_OBJECTS = libguac_terminal_la-blank.lo \
libguac_terminal_la-buffer.lo \
libguac_terminal_la-char_mappings.lo \
libguac_terminal_la-common.lo libguac_terminal_la-cursor.lo \
libguac_terminal_la-display.lo libguac_terminal_la-ibar.lo \
libguac_terminal_la-packet.lo libguac_terminal_la-pointer.lo \
libguac_terminal_la-scrollbar.lo \
libguac_terminal_la-terminal.lo \
libguac_terminal_la-terminal_handlers.lo
libguac_terminal_la_OBJECTS = $(am_libguac_terminal_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libguac_terminal_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libguac_terminal_la_CFLAGS) $(CFLAGS) \
$(libguac_terminal_la_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libguac_terminal_la_SOURCES)
DIST_SOURCES = $(libguac_terminal_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CAIRO_LIBS = @CAIRO_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMMON_INCLUDE = @COMMON_INCLUDE@
COMMON_LTLIB = @COMMON_LTLIB@
COMMON_SSH_INCLUDE = @COMMON_SSH_INCLUDE@
COMMON_SSH_LTLIB = @COMMON_SSH_LTLIB@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CUNIT_LIBS = @CUNIT_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JPEG_LIBS = @JPEG_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBADD_DLOPEN = @LIBADD_DLOPEN@
LIBGUAC_INCLUDE = @LIBGUAC_INCLUDE@
LIBGUAC_LTLIB = @LIBGUAC_LTLIB@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PANGOCAIRO_CFLAGS = @PANGOCAIRO_CFLAGS@
PANGOCAIRO_LIBS = @PANGOCAIRO_LIBS@
PANGO_CFLAGS = @PANGO_CFLAGS@
PANGO_LIBS = @PANGO_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PNG_LIBS = @PNG_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
PULSE_LIBS = @PULSE_LIBS@
RANLIB = @RANLIB@
RDP_LIBS = @RDP_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SSH_LIBS = @SSH_LIBS@
SSL_LIBS = @SSL_LIBS@
STRIP = @STRIP@
TELNET_LIBS = @TELNET_LIBS@
TERMINAL_INCLUDE = @TERMINAL_INCLUDE@
TERMINAL_LTLIB = @TERMINAL_LTLIB@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
VNC_LIBS = @VNC_LIBS@
VORBIS_LIBS = @VORBIS_LIBS@
WEBP_LIBS = @WEBP_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
init_dir = @init_dir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
noinst_LTLIBRARIES = libguac_terminal.la
noinst_HEADERS = \
blank.h \
buffer.h \
char_mappings.h \
common.h \
cursor.h \
display.h \
ibar.h \
packet.h \
pointer.h \
scrollbar.h \
terminal.h \
terminal_handlers.h \
types.h
libguac_terminal_la_SOURCES = \
blank.c \
buffer.c \
char_mappings.c \
common.c \
cursor.c \
display.c \
ibar.c \
packet.c \
pointer.c \
scrollbar.c \
terminal.c \
terminal_handlers.c
libguac_terminal_la_CFLAGS = \
-Werror -Wall -pedantic \
@COMMON_INCLUDE@ \
@LIBGUAC_INCLUDE@ \
@PANGO_CFLAGS@ \
@PANGOCAIRO_CFLAGS@
libguac_terminal_la_LIBADD = \
@LIBGUAC_LTLIB@
libguac_terminal_la_LDFLAGS = \
@CAIRO_LIBS@ \
@MATH_LIBS@ \
@PANGO_LIBS@ \
@PANGOCAIRO_LIBS@ \
@PTHREAD_LIBS@
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/terminal/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/terminal/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libguac_terminal.la: $(libguac_terminal_la_OBJECTS) $(libguac_terminal_la_DEPENDENCIES) $(EXTRA_libguac_terminal_la_DEPENDENCIES)
$(AM_V_CCLD)$(libguac_terminal_la_LINK) $(libguac_terminal_la_OBJECTS) $(libguac_terminal_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-blank.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-buffer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-char_mappings.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-common.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-cursor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-display.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-ibar.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-packet.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-pointer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-scrollbar.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-terminal.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_terminal_la-terminal_handlers.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
libguac_terminal_la-blank.lo: blank.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-blank.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-blank.Tpo -c -o libguac_terminal_la-blank.lo `test -f 'blank.c' || echo '$(srcdir)/'`blank.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-blank.Tpo $(DEPDIR)/libguac_terminal_la-blank.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blank.c' object='libguac_terminal_la-blank.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-blank.lo `test -f 'blank.c' || echo '$(srcdir)/'`blank.c
libguac_terminal_la-buffer.lo: buffer.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-buffer.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-buffer.Tpo -c -o libguac_terminal_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-buffer.Tpo $(DEPDIR)/libguac_terminal_la-buffer.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buffer.c' object='libguac_terminal_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
libguac_terminal_la-char_mappings.lo: char_mappings.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-char_mappings.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-char_mappings.Tpo -c -o libguac_terminal_la-char_mappings.lo `test -f 'char_mappings.c' || echo '$(srcdir)/'`char_mappings.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-char_mappings.Tpo $(DEPDIR)/libguac_terminal_la-char_mappings.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='char_mappings.c' object='libguac_terminal_la-char_mappings.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-char_mappings.lo `test -f 'char_mappings.c' || echo '$(srcdir)/'`char_mappings.c
libguac_terminal_la-common.lo: common.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-common.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-common.Tpo -c -o libguac_terminal_la-common.lo `test -f 'common.c' || echo '$(srcdir)/'`common.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-common.Tpo $(DEPDIR)/libguac_terminal_la-common.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common.c' object='libguac_terminal_la-common.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-common.lo `test -f 'common.c' || echo '$(srcdir)/'`common.c
libguac_terminal_la-cursor.lo: cursor.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-cursor.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-cursor.Tpo -c -o libguac_terminal_la-cursor.lo `test -f 'cursor.c' || echo '$(srcdir)/'`cursor.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-cursor.Tpo $(DEPDIR)/libguac_terminal_la-cursor.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cursor.c' object='libguac_terminal_la-cursor.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-cursor.lo `test -f 'cursor.c' || echo '$(srcdir)/'`cursor.c
libguac_terminal_la-display.lo: display.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-display.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-display.Tpo -c -o libguac_terminal_la-display.lo `test -f 'display.c' || echo '$(srcdir)/'`display.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-display.Tpo $(DEPDIR)/libguac_terminal_la-display.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='display.c' object='libguac_terminal_la-display.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-display.lo `test -f 'display.c' || echo '$(srcdir)/'`display.c
libguac_terminal_la-ibar.lo: ibar.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-ibar.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-ibar.Tpo -c -o libguac_terminal_la-ibar.lo `test -f 'ibar.c' || echo '$(srcdir)/'`ibar.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-ibar.Tpo $(DEPDIR)/libguac_terminal_la-ibar.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ibar.c' object='libguac_terminal_la-ibar.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-ibar.lo `test -f 'ibar.c' || echo '$(srcdir)/'`ibar.c
libguac_terminal_la-packet.lo: packet.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-packet.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-packet.Tpo -c -o libguac_terminal_la-packet.lo `test -f 'packet.c' || echo '$(srcdir)/'`packet.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-packet.Tpo $(DEPDIR)/libguac_terminal_la-packet.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packet.c' object='libguac_terminal_la-packet.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-packet.lo `test -f 'packet.c' || echo '$(srcdir)/'`packet.c
libguac_terminal_la-pointer.lo: pointer.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-pointer.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-pointer.Tpo -c -o libguac_terminal_la-pointer.lo `test -f 'pointer.c' || echo '$(srcdir)/'`pointer.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-pointer.Tpo $(DEPDIR)/libguac_terminal_la-pointer.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pointer.c' object='libguac_terminal_la-pointer.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-pointer.lo `test -f 'pointer.c' || echo '$(srcdir)/'`pointer.c
libguac_terminal_la-scrollbar.lo: scrollbar.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-scrollbar.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-scrollbar.Tpo -c -o libguac_terminal_la-scrollbar.lo `test -f 'scrollbar.c' || echo '$(srcdir)/'`scrollbar.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-scrollbar.Tpo $(DEPDIR)/libguac_terminal_la-scrollbar.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scrollbar.c' object='libguac_terminal_la-scrollbar.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-scrollbar.lo `test -f 'scrollbar.c' || echo '$(srcdir)/'`scrollbar.c
libguac_terminal_la-terminal.lo: terminal.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-terminal.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-terminal.Tpo -c -o libguac_terminal_la-terminal.lo `test -f 'terminal.c' || echo '$(srcdir)/'`terminal.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-terminal.Tpo $(DEPDIR)/libguac_terminal_la-terminal.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='terminal.c' object='libguac_terminal_la-terminal.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-terminal.lo `test -f 'terminal.c' || echo '$(srcdir)/'`terminal.c
libguac_terminal_la-terminal_handlers.lo: terminal_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -MT libguac_terminal_la-terminal_handlers.lo -MD -MP -MF $(DEPDIR)/libguac_terminal_la-terminal_handlers.Tpo -c -o libguac_terminal_la-terminal_handlers.lo `test -f 'terminal_handlers.c' || echo '$(srcdir)/'`terminal_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_terminal_la-terminal_handlers.Tpo $(DEPDIR)/libguac_terminal_la-terminal_handlers.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='terminal_handlers.c' object='libguac_terminal_la-terminal_handlers.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_terminal_la_CFLAGS) $(CFLAGS) -c -o libguac_terminal_la-terminal_handlers.lo `test -f 'terminal_handlers.c' || echo '$(srcdir)/'`terminal_handlers.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
guacamole-server-0.9.9/src/terminal/char_mappings.h 0000664 0001751 0001751 00000003732 12536405625 017322 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_CHAR_MAPPINGS_H
#define _GUAC_TERMINAL_CHAR_MAPPINGS_H
#include "config.h"
/**
* VT100 graphics mapping. Each entry is the corresponding Unicode codepoint
* for the character N+32, where N is the index of the element in the array.
* All characters less than 32 are universally mapped to themselves.
*/
extern const int vt100_map[];
/**
* Null graphics mapping. Each entry is the corresponding Unicode codepoint
* for the character N+32, where N is the index of the element in the array.
* All characters less than 32 are universally mapped to themselves.
*/
extern const int null_map[];
/**
* User graphics mapping. Each entry is the corresponding Unicode codepoint
* for the character N+32, where N is the index of the element in the array.
* All characters less than 32 are universally mapped to themselves.
*/
extern const int user_map[];
#endif
guacamole-server-0.9.9/src/terminal/terminal_handlers.c 0000664 0001751 0001751 00000070225 12645364210 020171 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "char_mappings.h"
#include "terminal.h"
#include "terminal_handlers.h"
#include "types.h"
#include
#include
#include
#include
/**
* Response string sent when identification is requested.
*/
#define GUAC_TERMINAL_VT102_ID "\x1B[?6c"
/**
* Arbitrary response to ENQ control character.
*/
#define GUAC_TERMINAL_ANSWERBACK "GUACAMOLE"
/**
* Response which indicates the terminal is alive.
*/
#define GUAC_TERMINAL_OK "\x1B[0n"
int guac_terminal_echo(guac_terminal* term, unsigned char c) {
int width;
static int bytes_remaining = 0;
static int codepoint = 0;
const int* char_mapping = term->char_mapping[term->active_char_set];
/* If using non-Unicode mapping, just map straight bytes */
if (char_mapping != NULL) {
codepoint = c;
bytes_remaining = 0;
}
/* 1-byte UTF-8 codepoint */
else if ((c & 0x80) == 0x00) { /* 0xxxxxxx */
codepoint = c & 0x7F;
bytes_remaining = 0;
}
/* 2-byte UTF-8 codepoint */
else if ((c & 0xE0) == 0xC0) { /* 110xxxxx */
codepoint = c & 0x1F;
bytes_remaining = 1;
}
/* 3-byte UTF-8 codepoint */
else if ((c & 0xF0) == 0xE0) { /* 1110xxxx */
codepoint = c & 0x0F;
bytes_remaining = 2;
}
/* 4-byte UTF-8 codepoint */
else if ((c & 0xF8) == 0xF0) { /* 11110xxx */
codepoint = c & 0x07;
bytes_remaining = 3;
}
/* Continuation of UTF-8 codepoint */
else if ((c & 0xC0) == 0x80) { /* 10xxxxxx */
codepoint = (codepoint << 6) | (c & 0x3F);
bytes_remaining--;
}
/* Unrecognized prefix */
else {
codepoint = '?';
bytes_remaining = 0;
}
/* If we need more bytes, wait for more bytes */
if (bytes_remaining != 0)
return 0;
switch (codepoint) {
/* Enquiry */
case 0x05:
guac_terminal_send_string(term, GUAC_TERMINAL_ANSWERBACK);
break;
/* Bell */
case 0x07:
break;
/* Backspace */
case 0x08:
if (term->cursor_col >= 1)
term->cursor_col--;
break;
/* Tab */
case 0x09:
term->cursor_col = guac_terminal_next_tab(term, term->cursor_col);
break;
/* Line feed / VT / FF */
case '\n':
case 0x0B: /* VT */
case 0x0C: /* FF */
term->cursor_row++;
/* Scroll up if necessary */
if (term->cursor_row > term->scroll_end) {
term->cursor_row = term->scroll_end;
/* Scroll up by one row */
guac_terminal_scroll_up(term, term->scroll_start,
term->scroll_end, 1);
}
/* If automatic carriage return, fall through to CR handler */
if (!term->automatic_carriage_return)
break;
/* Carriage return */
case '\r':
term->cursor_col = 0;
break;
/* SO (activates character set G1) */
case 0x0E:
term->active_char_set = 1;
break;
/* SI (activates character set G0) */
case 0x0F:
term->active_char_set = 0;
break;
/* ESC */
case 0x1B:
term->char_handler = guac_terminal_escape;
break;
/* CSI */
case 0x9B:
term->char_handler = guac_terminal_csi;
break;
/* DEL (ignored) */
case 0x7F:
break;
/* Displayable chars */
default:
/* Don't bother handling control chars if unknown */
if (codepoint < 0x20)
break;
/* Translate mappable codepoints to whatever codepoint is mapped */
if (codepoint >= 0x20 && codepoint <= 0xFF && char_mapping != NULL)
codepoint = char_mapping[codepoint - 0x20];
/* Wrap if necessary */
if (term->cursor_col >= term->term_width) {
term->cursor_col = 0;
term->cursor_row++;
}
/* Scroll up if necessary */
if (term->cursor_row > term->scroll_end) {
term->cursor_row = term->scroll_end;
/* Scroll up by one row */
guac_terminal_scroll_up(term, term->scroll_start,
term->scroll_end, 1);
}
/* If insert mode, shift other characters right by 1 */
if (term->insert_mode)
guac_terminal_copy_columns(term, term->cursor_row,
term->cursor_col, term->term_width-2, 1);
/* Write character */
guac_terminal_set(term,
term->cursor_row,
term->cursor_col,
codepoint);
width = wcwidth(codepoint);
if (width < 0)
width = 1;
/* Advance cursor */
term->cursor_col += width;
}
return 0;
}
int guac_terminal_escape(guac_terminal* term, unsigned char c) {
switch (c) {
case '(':
term->char_handler = guac_terminal_g0_charset;
break;
case ')':
term->char_handler = guac_terminal_g1_charset;
break;
case ']':
term->char_handler = guac_terminal_osc;
break;
case '[':
term->char_handler = guac_terminal_csi;
break;
case '#':
term->char_handler = guac_terminal_ctrl_func;
break;
/* Save Cursor (DECSC) */
case '7':
term->saved_cursor_row = term->cursor_row;
term->saved_cursor_col = term->cursor_col;
term->char_handler = guac_terminal_echo;
break;
/* Restore Cursor (DECRC) */
case '8':
term->cursor_row = term->saved_cursor_row;
if (term->cursor_row >= term->term_height)
term->cursor_row = term->term_height - 1;
term->cursor_col = term->saved_cursor_col;
if (term->cursor_col >= term->term_width)
term->cursor_col = term->term_width - 1;
term->char_handler = guac_terminal_echo;
break;
/* Index (IND) */
case 'D':
term->cursor_row++;
/* Scroll up if necessary */
if (term->cursor_row > term->scroll_end) {
term->cursor_row = term->scroll_end;
/* Scroll up by one row */
guac_terminal_scroll_up(term, term->scroll_start,
term->scroll_end, 1);
}
term->char_handler = guac_terminal_echo;
break;
/* Next Line (NEL) */
case 'E':
term->cursor_col = 0;
term->cursor_row++;
/* Scroll up if necessary */
if (term->cursor_row > term->scroll_end) {
term->cursor_row = term->scroll_end;
/* Scroll up by one row */
guac_terminal_scroll_up(term, term->scroll_start,
term->scroll_end, 1);
}
term->char_handler = guac_terminal_echo;
break;
/* Set Tab (HTS) */
case 'H':
guac_terminal_set_tab(term, term->cursor_col);
term->char_handler = guac_terminal_echo;
break;
/* Reverse Linefeed */
case 'M':
term->cursor_row--;
/* Scroll down if necessary */
if (term->cursor_row < term->scroll_start) {
term->cursor_row = term->scroll_start;
/* Scroll down by one row */
guac_terminal_scroll_down(term, term->scroll_start,
term->scroll_end, 1);
}
term->char_handler = guac_terminal_echo;
break;
/* DEC Identify */
case 'Z':
guac_terminal_send_string(term, GUAC_TERMINAL_VT102_ID);
term->char_handler = guac_terminal_echo;
break;
/* Reset */
case 'c':
guac_terminal_reset(term);
break;
default:
guac_client_log(term->client, GUAC_LOG_INFO, "Unhandled ESC sequence: %c", c);
term->char_handler = guac_terminal_echo;
}
return 0;
}
/**
* Given a character mapping specifier (such as B, 0, U, or K),
* returns the corresponding character mapping.
*/
static const int* __guac_terminal_get_char_mapping(char c) {
/* Translate character specifier to actual mapping */
switch (c) {
case 'B': return NULL;
case '0': return vt100_map;
case 'U': return null_map;
case 'K': return user_map;
}
/* Default to Unicode */
return NULL;
}
int guac_terminal_g0_charset(guac_terminal* term, unsigned char c) {
term->char_mapping[0] = __guac_terminal_get_char_mapping(c);
term->char_handler = guac_terminal_echo;
return 0;
}
int guac_terminal_g1_charset(guac_terminal* term, unsigned char c) {
term->char_mapping[1] = __guac_terminal_get_char_mapping(c);
term->char_handler = guac_terminal_echo;
return 0;
}
/**
* Looks up the flag specified by the given number and mode. Used by the Set/Reset Mode
* functions of the terminal.
*/
static bool* __guac_terminal_get_flag(guac_terminal* term, int num, char private_mode) {
if (private_mode == '?') {
switch (num) {
case 1: return &(term->application_cursor_keys); /* DECCKM */
}
}
else if (private_mode == 0) {
switch (num) {
case 4: return &(term->insert_mode); /* DECIM */
case 20: return &(term->automatic_carriage_return); /* LF/NL */
}
}
/* Unknown flag */
return NULL;
}
int guac_terminal_csi(guac_terminal* term, unsigned char c) {
/* CSI function arguments */
static int argc = 0;
static int argv[16] = {0};
/* Sequence prefix, if any */
static char private_mode_character = 0;
/* Argument building counter and buffer */
static int argv_length = 0;
static char argv_buffer[256];
/* Digits get concatenated into argv */
if (c >= '0' && c <= '9') {
/* Concatenate digit if there is space in buffer */
if (argv_length < sizeof(argv_buffer)-1)
argv_buffer[argv_length++] = c;
}
/* Specific non-digits stop the parameter, and possibly the sequence */
else if ((c >= 0x40 && c <= 0x7E) || c == ';') {
int i, row, col, amount;
bool* flag;
/* At most 16 parameters */
if (argc < 16) {
/* Finish parameter */
argv_buffer[argv_length] = 0;
argv[argc++] = atoi(argv_buffer);
/* Prepare for next parameter */
argv_length = 0;
}
/* Handle CSI functions */
switch (c) {
/* @: Insert characters (scroll right) */
case '@':
amount = argv[0];
if (amount == 0) amount = 1;
/* Scroll right by amount */
if (term->cursor_col + amount < term->term_width)
guac_terminal_copy_columns(term, term->cursor_row,
term->cursor_col, term->term_width - amount - 1,
amount);
/* Clear left */
guac_terminal_clear_columns(term, term->cursor_row,
term->cursor_col, term->cursor_col + amount - 1);
break;
/* A: Move up */
case 'A':
/* Get move amount */
amount = argv[0];
if (amount == 0) amount = 1;
/* Move cursor */
term->cursor_row -= amount;
if (term->cursor_row < 0)
term->cursor_row = 0;
break;
/* B: Move down */
case 'e':
case 'B':
/* Get move amount */
amount = argv[0];
if (amount == 0) amount = 1;
/* Move cursor */
term->cursor_row += amount;
if (term->cursor_row >= term->term_height)
term->cursor_row = term->term_height - 1;
break;
/* C: Move right */
case 'a':
case 'C':
/* Get move amount */
amount = argv[0];
if (amount == 0) amount = 1;
/* Move cursor */
term->cursor_col += amount;
if (term->cursor_col >= term->term_width)
term->cursor_col = term->term_width - 1;
break;
/* D: Move left */
case 'D':
/* Get move amount */
amount = argv[0];
if (amount == 0) amount = 1;
/* Move cursor */
term->cursor_col -= amount;
if (term->cursor_col < 0)
term->cursor_col = 0;
break;
/* E: Move cursor down given number rows, column 1 */
case 'E':
/* Get move amount */
amount = argv[0];
if (amount == 0) amount = 1;
/* Move cursor */
term->cursor_row += amount;
if (term->cursor_row >= term->term_height)
term->cursor_row = term->term_height - 1;
/* Reset to column 1 */
term->cursor_col = 0;
break;
/* F: Move cursor up given number rows, column 1 */
case 'F':
/* Get move amount */
amount = argv[0];
if (amount == 0) amount = 1;
/* Move cursor */
term->cursor_row -= amount;
if (term->cursor_row < 0)
term->cursor_row = 0;
/* Reset to column 1 */
term->cursor_col = 0;
break;
/* G: Move cursor, current row */
case '`':
case 'G':
col = argv[0]; if (col != 0) col--;
term->cursor_col = col;
break;
/* H: Move cursor */
case 'f':
case 'H':
row = argv[0]; if (row != 0) row--;
col = argv[1]; if (col != 0) col--;
term->cursor_row = row;
term->cursor_col = col;
break;
/* J: Erase display */
case 'J':
/* Erase from cursor to end of display */
if (argv[0] == 0)
guac_terminal_clear_range(term,
term->cursor_row, term->cursor_col,
term->term_height-1, term->term_width-1);
/* Erase from start to cursor */
else if (argv[0] == 1)
guac_terminal_clear_range(term,
0, 0,
term->cursor_row, term->cursor_col);
/* Entire screen */
else if (argv[0] == 2 || argv[0] == 3)
guac_terminal_clear_range(term,
0, 0, term->term_height - 1, term->term_width - 1);
break;
/* K: Erase line */
case 'K':
/* Erase from cursor to end of line */
if (argv[0] == 0)
guac_terminal_clear_columns(term, term->cursor_row,
term->cursor_col, term->term_width - 1);
/* Erase from start to cursor */
else if (argv[0] == 1)
guac_terminal_clear_columns(term, term->cursor_row,
0, term->cursor_col);
/* Erase line */
else if (argv[0] == 2)
guac_terminal_clear_columns(term, term->cursor_row,
0, term->term_width - 1);
break;
/* L: Insert blank lines (scroll down) */
case 'L':
amount = argv[0];
if (amount == 0) amount = 1;
guac_terminal_scroll_down(term,
term->cursor_row, term->scroll_end, amount);
break;
/* M: Delete lines (scroll up) */
case 'M':
amount = argv[0];
if (amount == 0) amount = 1;
guac_terminal_scroll_up(term,
term->cursor_row, term->scroll_end, amount);
break;
/* P: Delete characters (scroll left) */
case 'P':
amount = argv[0];
if (amount == 0) amount = 1;
/* Scroll left by amount */
if (term->cursor_col + amount < term->term_width)
guac_terminal_copy_columns(term, term->cursor_row,
term->cursor_col + amount, term->term_width - 1,
-amount);
/* Clear right */
guac_terminal_clear_columns(term, term->cursor_row,
term->term_width - amount, term->term_width - 1);
break;
/* X: Erase characters (no scroll) */
case 'X':
amount = argv[0];
if (amount == 0) amount = 1;
/* Clear characters */
guac_terminal_clear_columns(term, term->cursor_row,
term->cursor_col, term->cursor_col + amount - 1);
break;
/* ]: Linux Private CSI */
case ']':
/* Explicitly ignored */
break;
/* c: Identify */
case 'c':
if (argv[0] == 0 && private_mode_character == 0)
guac_terminal_send_string(term, GUAC_TERMINAL_VT102_ID);
break;
/* d: Move cursor, current col */
case 'd':
row = argv[0]; if (row != 0) row--;
term->cursor_row = row;
break;
/* g: Clear tab */
case 'g':
/* Clear tab at current location */
if (argv[0] == 0)
guac_terminal_unset_tab(term, term->cursor_col);
/* Clear all tabs */
else if (argv[0] == 3)
guac_terminal_clear_tabs(term);
break;
/* h: Set Mode */
case 'h':
/* Look up flag and set */
flag = __guac_terminal_get_flag(term, argv[0], private_mode_character);
if (flag != NULL)
*flag = true;
break;
/* l: Reset Mode */
case 'l':
/* Look up flag and clear */
flag = __guac_terminal_get_flag(term, argv[0], private_mode_character);
if (flag != NULL)
*flag = false;
break;
/* m: Set graphics rendition */
case 'm':
for (i=0; icurrent_attributes = term->default_char.attributes;
/* Bold */
else if (value == 1)
term->current_attributes.bold = true;
/* Underscore on */
else if (value == 4)
term->current_attributes.underscore = true;
/* Reverse video */
else if (value == 7)
term->current_attributes.reverse = true;
/* Normal intensity (not bold) */
else if (value == 21 || value == 22)
term->current_attributes.bold = false;
/* Reset underscore */
else if (value == 24)
term->current_attributes.underscore = false;
/* Reset reverse video */
else if (value == 27)
term->current_attributes.reverse = false;
/* Foreground */
else if (value >= 30 && value <= 37)
term->current_attributes.foreground = value - 30;
/* Underscore on, default foreground */
else if (value == 38) {
term->current_attributes.underscore = true;
term->current_attributes.foreground =
term->default_char.attributes.foreground;
}
/* Underscore off, default foreground */
else if (value == 39) {
term->current_attributes.underscore = false;
term->current_attributes.foreground =
term->default_char.attributes.foreground;
}
/* Background */
else if (value >= 40 && value <= 47)
term->current_attributes.background = value - 40;
/* Reset background */
else if (value == 49)
term->current_attributes.background =
term->default_char.attributes.background;
}
break;
/* n: Status report */
case 'n':
/* Device status report */
if (argv[0] == 5 && private_mode_character == 0)
guac_terminal_send_string(term, GUAC_TERMINAL_OK);
/* Cursor position report */
else if (argv[0] == 6 && private_mode_character == 0)
guac_terminal_sendf(term, "\x1B[%i;%iR", term->cursor_row+1, term->cursor_col+1);
break;
/* q: Set keyboard LEDs */
case 'q':
/* Explicitly ignored */
break;
/* r: Set scrolling region */
case 'r':
/* If parameters given, set region */
if (argc == 2) {
term->scroll_start = argv[0]-1;
term->scroll_end = argv[1]-1;
}
/* Otherwise, reset scrolling region */
else {
term->scroll_start = 0;
term->scroll_end = term->term_height - 1;
}
break;
/* Save Cursor */
case 's':
term->saved_cursor_row = term->cursor_row;
term->saved_cursor_col = term->cursor_col;
break;
/* Restore Cursor */
case 'u':
term->cursor_row = term->saved_cursor_row;
if (term->cursor_row >= term->term_height)
term->cursor_row = term->term_height - 1;
term->cursor_col = term->saved_cursor_col;
if (term->cursor_col >= term->term_width)
term->cursor_col = term->term_width - 1;
break;
/* Warn of unhandled codes */
default:
if (c != ';') {
guac_client_log(term->client, GUAC_LOG_INFO,
"Unhandled CSI sequence: %c", c);
for (i=0; iclient, GUAC_LOG_INFO,
" -> argv[%i] = %i", i, argv[i]);
}
}
/* If not a semicolon, end of CSI sequence */
if (c != ';') {
term->char_handler = guac_terminal_echo;
/* Reset parameters */
for (i=0; i= 0x3A && c <= 0x3F && private_mode_character == 0)
private_mode_character = c;
return 0;
}
int guac_terminal_set_directory(guac_terminal* term, unsigned char c) {
static char filename[2048];
static int length = 0;
/* Stop on ECMA-48 ST (String Terminator */
if (c == 0x9C || c == 0x5C || c == 0x07) {
filename[length++] = '\0';
term->char_handler = guac_terminal_echo;
if (term->upload_path_handler)
term->upload_path_handler(term->client, filename);
else
guac_client_log(term->client, GUAC_LOG_DEBUG,
"Cannot set upload path. File is transfer not enabled.");
length = 0;
}
/* Otherwise, store character */
else if (length < sizeof(filename)-1)
filename[length++] = c;
return 0;
}
int guac_terminal_download(guac_terminal* term, unsigned char c) {
static char filename[2048];
static int length = 0;
/* Stop on ECMA-48 ST (String Terminator */
if (c == 0x9C || c == 0x5C || c == 0x07) {
filename[length++] = '\0';
term->char_handler = guac_terminal_echo;
if (term->file_download_handler)
term->file_download_handler(term->client, filename);
else
guac_client_log(term->client, GUAC_LOG_DEBUG,
"Cannot send file. File is transfer not enabled.");
length = 0;
}
/* Otherwise, store character */
else if (length < sizeof(filename)-1)
filename[length++] = c;
return 0;
}
int guac_terminal_osc(guac_terminal* term, unsigned char c) {
static int operation = 0;
/* If digit, append to operation */
if (c >= '0' && c <= '9')
operation = operation * 10 + c - '0';
/* If end of parameter, check value */
else if (c == ';') {
/* Download OSC */
if (operation == 482200)
term->char_handler = guac_terminal_download;
/* Set upload directory OSC */
else if (operation == 482201)
term->char_handler = guac_terminal_set_directory;
/* Reset parameter for next OSC */
operation = 0;
}
/* Stop on ECMA-48 ST (String Terminator */
else if (c == 0x9C || c == 0x5C || c == 0x07)
term->char_handler = guac_terminal_echo;
/* Stop on unrecognized character */
else {
guac_client_log(term->client, GUAC_LOG_INFO, "Unexpected character in OSC: 0x%X", c);
term->char_handler = guac_terminal_echo;
}
return 0;
}
int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c) {
int row;
/* Build character with current attributes */
guac_terminal_char guac_char;
guac_char.value = 'E';
guac_char.attributes = term->current_attributes;
switch (c) {
/* Alignment test (fill screen with E's) */
case '8':
for (row=0; rowterm_height; row++)
guac_terminal_set_columns(term, row, 0, term->term_width-1, &guac_char);
break;
}
term->char_handler = guac_terminal_echo;
return 0;
}
guacamole-server-0.9.9/src/terminal/blank.h 0000664 0001751 0001751 00000003053 12643542623 015571 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_BLANK_H
#define _GUAC_TERMINAL_BLANK_H
#include "config.h"
#include "cursor.h"
#include
#include
/**
* Creates a new blank cursor, returning the corresponding cursor object.
*
* @param client The guac_client to send the cursor to.
* @return A new cursor which must be free'd via guac_terminal_cursor_free()/
*/
guac_terminal_cursor* guac_terminal_create_blank(guac_client* client);
#endif
guacamole-server-0.9.9/src/terminal/scrollbar.h 0000664 0001751 0001751 00000023324 12626133327 016466 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_TERMINAL_SCROLLBAR_H
#define GUAC_TERMINAL_SCROLLBAR_H
#include "config.h"
#include
#include
/**
* The width of the scrollbar, in pixels.
*/
#define GUAC_TERMINAL_SCROLLBAR_WIDTH 16
/**
* The number of pixels between the draggable handle of the scrollbar and the
* boundary of the containing layer.
*/
#define GUAC_TERMINAL_SCROLLBAR_PADDING 2
/**
* The minimum height of the draggable handle of the scrollbar, in pixels.
*/
#define GUAC_TERMINAL_SCROLLBAR_MIN_HEIGHT 64
/**
* The state of all scrollbar components, describing all variable aspects of
* the scrollbar's appearance.
*/
typedef struct guac_terminal_scrollbar_render_state {
/**
* The current X-coordinate of the upper-left corner of the scrollbar's
* handle. This value will be relative to the scrollbar's containing layer.
*/
int handle_x;
/**
* The current Y-coordinate of the upper-left corner of the scrollbar's
* handle. This value will be relative to the scrollbar's containing layer.
*/
int handle_y;
/**
* The width of the scrollbar's handle.
*/
int handle_width;
/**
* The height of the scrollbar's handle.
*/
int handle_height;
/**
* The current X-coordinate of the upper-left corner of the scrollbar's
* containing layer.
*/
int container_x;
/**
* The current Y-coordinate of the upper-left corner of the scrollbar's
* containing layer.
*/
int container_y;
/**
* The width of the scrollbar's containing layer.
*/
int container_width;
/**
* The height of the scrollbar's containing layer.
*/
int container_height;
} guac_terminal_scrollbar_render_state;
typedef struct guac_terminal_scrollbar guac_terminal_scrollbar;
/**
* Handler which is called whenever the scrollbar value changes outside a call
* to guac_terminal_scrollbar_set_value().
*/
typedef void guac_terminal_scrollbar_scroll_handler(
guac_terminal_scrollbar* scrollbar, int value);
/**
* A scrollbar, made up of a containing layer and inner draggable handle. The
* position of the handle within the layer represents the value of the
* scrollbar.
*/
struct guac_terminal_scrollbar {
/**
* The client associated with this scrollbar.
*/
guac_client* client;
/**
* The layer containing the scrollbar.
*/
const guac_layer* parent;
/**
* The width of the parent layer, in pixels.
*/
int parent_width;
/**
* The height of the parent layer, in pixels.
*/
int parent_height;
/**
* The scrollbar itself.
*/
guac_layer* container;
/**
* The draggable handle within the scrollbar, representing the current
* scroll value.
*/
guac_layer* handle;
/**
* The minimum scroll value.
*/
int min;
/**
* The maximum scroll value.
*/
int max;
/**
* The size of the visible area, in the same units as min and max.
*/
int visible_area;
/**
* The current scroll value.
*/
int value;
/**
* The current state of all variable, visible parts of the scrollbar.
*/
guac_terminal_scrollbar_render_state render_state;
/**
* Whether the scrollbar handle is currently being dragged.
*/
int dragging_handle;
/**
* The offset of the Y location of the mouse pointer when the dragging
* began, relative to the top of the scrollbar handle. If dragging is not
* in progress, this value is undefined.
*/
int drag_offset_y;
/**
* The current Y location of the mouse pointer if dragging is in progress.
* If dragging is not in progress, this value is undefined.
*/
int drag_current_y;
/**
* The function to call when the scrollbar handle is being dragged, and
* the new scrollbar value needs to be handled and assigned.
*/
guac_terminal_scrollbar_scroll_handler* scroll_handler;
/**
* Arbitrary reference to data related to this scrollbar.
*/
void* data;
};
/**
* Allocates a new scrollbar, associating that scrollbar with the given client
* and parent layer. The dimensions of the parent layer dictate the initial
* position of the scrollbar. Currently, the scrollbar is always anchored to
* the right edge of the parent layer.
*
* This will cause instructions to be written to the client's socket, but the
* client's socket will not be automatically flushed.
*
* @param client
* The client to associate with the new scrollbar.
*
* @param parent
* The layer which will contain the newly-allocated scrollbar.
*
* @param parent_width
* The width of the parent layer, in pixels.
*
* @param parent_height
* The height of the parent layer, in pixels.
*
* @param visible_area
* The amount of scrollable data that can be shown within the parent layer
* at any given time. This value uses the same units as min, max, and the
* current scroll value.
*
* @return
* A newly allocated scrollbar.
*/
guac_terminal_scrollbar* guac_terminal_scrollbar_alloc(guac_client* client,
const guac_layer* parent, int parent_width, int parent_height,
int visible_area);
/**
* Frees the given scrollbar.
*
* @param scrollbar
* The scrollbar to free.
*/
void guac_terminal_scrollbar_free(guac_terminal_scrollbar* scrollbar);
/**
* Flushes the render state of the given scrollbar, updating the remote display
* accordingly.
*
* This may cause instructions to be written to the client's socket, but the
* client's socket will not be automatically flushed.
*
* @param scrollbar
* The scrollbar whose render state is to be flushed.
*/
void guac_terminal_scrollbar_flush(guac_terminal_scrollbar* scrollbar);
/**
* Sets the minimum and maximum allowed scroll values of the given scrollbar
* to the given values. If necessary, the current value of the scrollbar will
* be adjusted to fit within the new bounds.
*
* This may cause instructions to be written to the client's socket, but the
* client's socket will not be automatically flushed.
*
* @param scrollbar
* The scrollbar whose bounds are changing.
*
* @param min
* The new minimum value of the scrollbar.
*
* @param max
* The new maximum value of the scrollbar.
*/
void guac_terminal_scrollbar_set_bounds(guac_terminal_scrollbar* scrollbar,
int min, int max);
/**
* Sets the current value of the given scrollbar. If the value specified does
* not fall within the scrollbar's defined minimum and maximum values, the
* value will be adjusted to fit.
*
* This may cause instructions to be written to the client's socket, but the
* client's socket will not be automatically flushed.
*
* @param scrollbar
* The scrollbar whose value is changing.
*
* @param value
* The value to assign to the scrollbar. If the value if out of bounds, it
* will be automatically adjusted to fit.
*/
void guac_terminal_scrollbar_set_value(guac_terminal_scrollbar* scrollbar,
int value);
/**
* Notifies the scrollbar that the parent layer has been resized, and that the
* scrollbar may need to be repositioned or resized accordingly.
*
* This may cause instructions to be written to the client's socket, but the
* client's socket will not be automatically flushed.
*
* @param scrollbar
* The scrollbar whose parent layer has been resized.
*
* @param parent_width
* The new width of the parent layer, in pixels.
*
* @param parent_height
* The new height of the parent layer, in pixels.
*
* @param visible_area
* The amount of scrollable data that can be shown within the parent layer
* at any given time. This value uses the same units as min, max, and the
* current scroll value.
*/
void guac_terminal_scrollbar_parent_resized(guac_terminal_scrollbar* scrollbar,
int parent_width, int parent_height, int visible_area);
/**
* Notifies the scrollbar of the current mouse state, allowing it to update
* itself with respect to button state and dragging.
*
* @param scrollbar
* The scrollbar to notify of the current mouse state.
*
* @param x
* The X coordinate of the mouse pointer.
*
* @param y
* The Y coordinate of the mouse pointer.
*
* @param mask
* The button mask, where the Nth bit of the button mask represents the
* pressed state of the Nth mouse button, where button 0 is the left
* mouse button, button 1 is the middle button, etc.
*
* @return
* Zero if the mouse event was not handled by the scrollbar, non-zero
* otherwise.
*/
int guac_terminal_scrollbar_handle_mouse(guac_terminal_scrollbar* scrollbar,
int x, int y, int mask);
#endif
guacamole-server-0.9.9/src/terminal/types.h 0000664 0001751 0001751 00000006530 12536405625 015652 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_TYPES_H
#define _GUAC_TERMINAL_TYPES_H
#include "config.h"
#include
/**
* A character which is not truly a character, but rather part of an
* existing character which spans multiple columns. The original
* character will be somewhere earlier in the row, separated from
* this character by a contiguous string of zero of more
* GUAC_CHAR_CONTINUATION characters.
*/
#define GUAC_CHAR_CONTINUATION -1
/**
* An RGB color, where each component ranges from 0 to 255.
*/
typedef struct guac_terminal_color {
/**
* The red component of this color.
*/
int red;
/**
* The green component of this color.
*/
int green;
/**
* The blue component of this color.
*/
int blue;
} guac_terminal_color;
/**
* Terminal attributes, as can be applied to a single character.
*/
typedef struct guac_terminal_attributes {
/**
* Whether the character should be rendered bold.
*/
bool bold;
/**
* Whether the character should be rendered with reversed colors
* (background becomes foreground and vice-versa).
*/
bool reverse;
/**
* Whether the associated character is highlighted by the cursor.
*/
bool cursor;
/**
* Whether to render the character with underscore.
*/
bool underscore;
/**
* The foreground color of this character, as a palette index.
*/
int foreground;
/**
* The background color of this character, as a palette index.
*/
int background;
} guac_terminal_attributes;
/**
* Represents a single character for display in a terminal, including actual
* character value, foreground color, and background color.
*/
typedef struct guac_terminal_char {
/**
* The Unicode codepoint of the character to display, or
* GUAC_CHAR_CONTINUATION if this character is part of
* another character which spans multiple columns.
*/
int value;
/**
* The attributes of the character to display.
*/
guac_terminal_attributes attributes;
/**
* The number of columns this character occupies. If the character is
* GUAC_CHAR_CONTINUATION, this value is undefined and not applicable.
*/
int width;
} guac_terminal_char;
#endif
guacamole-server-0.9.9/src/terminal/common.c 0000664 0001751 0001751 00000006213 12626133327 015764 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "types.h"
#include
#include
int guac_terminal_fit_to_range(int value, int min, int max) {
if (value < min) return min;
if (value > max) return max;
return value;
}
int guac_terminal_encode_utf8(int codepoint, char* utf8) {
int i;
int mask, bytes;
/* Determine size and initial byte mask */
if (codepoint <= 0x007F) {
mask = 0x00;
bytes = 1;
}
else if (codepoint <= 0x7FF) {
mask = 0xC0;
bytes = 2;
}
else if (codepoint <= 0xFFFF) {
mask = 0xE0;
bytes = 3;
}
else if (codepoint <= 0x1FFFFF) {
mask = 0xF0;
bytes = 4;
}
/* Otherwise, invalid codepoint */
else {
*(utf8++) = '?';
return 1;
}
/* Offset buffer by size */
utf8 += bytes - 1;
/* Add trailing bytes, if any */
for (i=1; i>= 6;
}
/* Set initial byte */
*utf8 = mask | codepoint;
/* Done */
return bytes;
}
bool guac_terminal_has_glyph(int codepoint) {
return
codepoint != 0
&& codepoint != ' '
&& codepoint != GUAC_CHAR_CONTINUATION;
}
int guac_terminal_write_all(int fd, const char* buffer, int size) {
int remaining = size;
while (remaining > 0) {
/* Attempt to write data */
int ret_val = write(fd, buffer, remaining);
if (ret_val <= 0)
return -1;
/* If successful, contine with what data remains (if any) */
remaining -= ret_val;
buffer += ret_val;
}
return size;
}
int guac_terminal_fill_buffer(int fd, char* buffer, int size) {
int remaining = size;
while (remaining > 0) {
/* Attempt to read data */
int ret_val = read(fd, buffer, remaining);
if (ret_val <= 0)
return -1;
/* If successful, continue with what space remains (if any) */
remaining -= ret_val;
buffer += ret_val;
}
return size;
}
guacamole-server-0.9.9/src/terminal/display.c 0000664 0001751 0001751 00000073766 12643542623 016164 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "common.h"
#include "display.h"
#include "guac_surface.h"
#include "types.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
const guac_terminal_color guac_terminal_palette[16] = {
/* Normal colors */
{0x00, 0x00, 0x00}, /* Black */
{0x99, 0x3E, 0x3E}, /* Red */
{0x3E, 0x99, 0x3E}, /* Green */
{0x99, 0x99, 0x3E}, /* Brown */
{0x3E, 0x3E, 0x99}, /* Blue */
{0x99, 0x3E, 0x99}, /* Magenta */
{0x3E, 0x99, 0x99}, /* Cyan */
{0x99, 0x99, 0x99}, /* White */
/* Intense colors */
{0x3E, 0x3E, 0x3E}, /* Black */
{0xFF, 0x67, 0x67}, /* Red */
{0x67, 0xFF, 0x67}, /* Green */
{0xFF, 0xFF, 0x67}, /* Brown */
{0x67, 0x67, 0xFF}, /* Blue */
{0xFF, 0x67, 0xFF}, /* Magenta */
{0x67, 0xFF, 0xFF}, /* Cyan */
{0xFF, 0xFF, 0xFF}, /* White */
};
/**
* Clears the currently-selected region, removing the highlight.
*/
static void __guac_terminal_display_clear_select(guac_terminal_display* display) {
guac_socket* socket = display->client->socket;
guac_layer* select_layer = display->select_layer;
guac_protocol_send_rect(socket, select_layer, 0, 0, 1, 1);
guac_protocol_send_cfill(socket, GUAC_COMP_SRC, select_layer,
0x00, 0x00, 0x00, 0x00);
guac_protocol_send_sync(socket, display->client->last_sent_timestamp);
guac_socket_flush(socket);
/* Text is no longer selected */
display->text_selected =
display->selection_committed = false;
}
/**
* Returns whether at least one character within the given range is selected.
*/
static bool __guac_terminal_display_selected_contains(guac_terminal_display* display,
int start_row, int start_column, int end_row, int end_column) {
/* If test range starts after highlight ends, does not intersect */
if (start_row > display->selection_end_row)
return false;
if (start_row == display->selection_end_row
&& start_column > display->selection_end_column)
return false;
/* If test range ends before highlight starts, does not intersect */
if (end_row < display->selection_start_row)
return false;
if (end_row == display->selection_start_row
&& end_column < display->selection_start_column)
return false;
/* Otherwise, does intersect */
return true;
}
/* Maps any codepoint onto a number between 0 and 511 inclusive */
int __guac_terminal_hash_codepoint(int codepoint) {
/* If within one byte, just return codepoint */
if (codepoint <= 0xFF)
return codepoint;
/* Otherwise, map to next 256 values */
return (codepoint & 0xFF) + 0x100;
}
/**
* Sets the attributes of the display such that future glyphs will render as
* expected.
*/
int __guac_terminal_set_colors(guac_terminal_display* display,
guac_terminal_attributes* attributes) {
int background, foreground;
/* Handle reverse video */
if (attributes->reverse != attributes->cursor) {
background = attributes->foreground;
foreground = attributes->background;
}
else {
foreground = attributes->foreground;
background = attributes->background;
}
/* Handle bold */
if (attributes->bold && foreground <= 7)
foreground += 8;
display->glyph_foreground = foreground;
display->glyph_background = background;
return 0;
}
/**
* Sends the given character to the terminal at the given row and column,
* rendering the character immediately. This bypasses the guac_terminal_display
* mechanism and is intended for flushing of updates only.
*/
int __guac_terminal_set(guac_terminal_display* display, int row, int col, int codepoint) {
int width;
int bytes;
char utf8[4];
/* Use foreground color */
const guac_terminal_color* color =
&guac_terminal_palette[display->glyph_foreground];
/* Use background color */
const guac_terminal_color* background =
&guac_terminal_palette[display->glyph_background];
cairo_surface_t* surface;
cairo_t* cairo;
int surface_width, surface_height;
PangoLayout* layout;
int layout_width, layout_height;
int ideal_layout_width, ideal_layout_height;
/* Calculate width in columns */
width = wcwidth(codepoint);
if (width < 0)
width = 1;
/* Do nothing if glyph is empty */
if (width == 0)
return 0;
/* Convert to UTF-8 */
bytes = guac_terminal_encode_utf8(codepoint, utf8);
surface_width = width * display->char_width;
surface_height = display->char_height;
ideal_layout_width = surface_width * PANGO_SCALE;
ideal_layout_height = surface_height * PANGO_SCALE;
/* Prepare surface */
surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
surface_width, surface_height);
cairo = cairo_create(surface);
/* Fill background */
cairo_set_source_rgb(cairo,
background->red / 255.0,
background->green / 255.0,
background->blue / 255.0);
cairo_rectangle(cairo, 0, 0, surface_width, surface_height);
cairo_fill(cairo);
/* Get layout */
layout = pango_cairo_create_layout(cairo);
pango_layout_set_font_description(layout, display->font_desc);
pango_layout_set_text(layout, utf8, bytes);
pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER);
pango_layout_get_size(layout, &layout_width, &layout_height);
/* If layout bigger than available space, scale it back */
if (layout_width > ideal_layout_width || layout_height > ideal_layout_height) {
double scale = fmin(ideal_layout_width / (double) layout_width,
ideal_layout_height / (double) layout_height);
cairo_scale(cairo, scale, scale);
/* Update layout to reflect scaled surface */
pango_layout_set_width(layout, ideal_layout_width / scale);
pango_layout_set_height(layout, ideal_layout_height / scale);
pango_cairo_update_layout(cairo, layout);
}
/* Draw */
cairo_set_source_rgb(cairo,
color->red / 255.0,
color->green / 255.0,
color->blue / 255.0);
cairo_move_to(cairo, 0.0, 0.0);
pango_cairo_show_layout(cairo, layout);
/* Draw */
guac_common_surface_draw(display->display_surface,
display->char_width * col,
display->char_height * row,
surface);
/* Free all */
g_object_unref(layout);
cairo_destroy(cairo);
cairo_surface_destroy(surface);
return 0;
}
guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
const char* font_name, int font_size, int dpi,
int foreground, int background) {
PangoFontMap* font_map;
PangoFont* font;
PangoFontMetrics* metrics;
PangoContext* context;
/* Allocate display */
guac_terminal_display* display = malloc(sizeof(guac_terminal_display));
display->client = client;
/* Create default surface */
display->display_layer = guac_client_alloc_layer(client);
display->select_layer = guac_client_alloc_layer(client);
display->display_surface = guac_common_surface_alloc(client,
client->socket, display->display_layer, 0, 0);
/* Select layer is a child of the display layer */
guac_protocol_send_move(client->socket, display->select_layer,
display->display_layer, 0, 0, 0);
/* Get font */
display->font_desc = pango_font_description_new();
pango_font_description_set_family(display->font_desc, font_name);
pango_font_description_set_weight(display->font_desc, PANGO_WEIGHT_NORMAL);
pango_font_description_set_size(display->font_desc,
font_size * PANGO_SCALE * dpi / 96);
font_map = pango_cairo_font_map_get_default();
context = pango_font_map_create_context(font_map);
font = pango_font_map_load_font(font_map, context, display->font_desc);
if (font == NULL) {
guac_client_abort(display->client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to get font \"%s\"", font_name);
return NULL;
}
metrics = pango_font_get_metrics(font, NULL);
if (metrics == NULL) {
guac_client_abort(display->client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Unable to get font metrics for font \"%s\"", font_name);
return NULL;
}
display->default_foreground = display->glyph_foreground = foreground;
display->default_background = display->glyph_background = background;
/* Calculate character dimensions */
display->char_width =
pango_font_metrics_get_approximate_digit_width(metrics) / PANGO_SCALE;
display->char_height =
(pango_font_metrics_get_descent(metrics)
+ pango_font_metrics_get_ascent(metrics)) / PANGO_SCALE;
/* Initially empty */
display->width = 0;
display->height = 0;
display->operations = NULL;
/* Initially nothing selected */
display->text_selected =
display->selection_committed = false;
return display;
}
void guac_terminal_display_free(guac_terminal_display* display) {
/* Free operations buffers */
free(display->operations);
/* Free display */
free(display);
}
void guac_terminal_display_copy_columns(guac_terminal_display* display, int row,
int start_column, int end_column, int offset) {
int i;
guac_terminal_operation* src_current;
guac_terminal_operation* current;
/* Ignore operations outside display bounds */
if (row < 0 || row >= display->height)
return;
/* Fit range within bounds */
start_column = guac_terminal_fit_to_range(start_column, 0, display->width - 1);
end_column = guac_terminal_fit_to_range(end_column, 0, display->width - 1);
start_column = guac_terminal_fit_to_range(start_column + offset, 0, display->width - 1) - offset;
end_column = guac_terminal_fit_to_range(end_column + offset, 0, display->width - 1) - offset;
src_current = &(display->operations[row * display->width + start_column]);
current = &(display->operations[row * display->width + start_column + offset]);
/* Move data */
memmove(current, src_current,
(end_column - start_column + 1) * sizeof(guac_terminal_operation));
/* Update operations */
for (i=start_column; i<=end_column; i++) {
/* If no operation here, set as copy */
if (current->type == GUAC_CHAR_NOP) {
current->type = GUAC_CHAR_COPY;
current->row = row;
current->column = i;
}
/* Next column */
current++;
}
/* If selection visible and committed, clear if update touches selection */
if (display->text_selected && display->selection_committed &&
__guac_terminal_display_selected_contains(display, row, start_column, row, end_column))
__guac_terminal_display_clear_select(display);
}
void guac_terminal_display_copy_rows(guac_terminal_display* display,
int start_row, int end_row, int offset) {
int row, col;
guac_terminal_operation* src_current_row;
guac_terminal_operation* current_row;
/* Fit range within bounds */
start_row = guac_terminal_fit_to_range(start_row, 0, display->height - 1);
end_row = guac_terminal_fit_to_range(end_row, 0, display->height - 1);
start_row = guac_terminal_fit_to_range(start_row + offset, 0, display->height - 1) - offset;
end_row = guac_terminal_fit_to_range(end_row + offset, 0, display->height - 1) - offset;
src_current_row = &(display->operations[start_row * display->width]);
current_row = &(display->operations[(start_row + offset) * display->width]);
/* Move data */
memmove(current_row, src_current_row,
(end_row - start_row + 1) * sizeof(guac_terminal_operation) * display->width);
/* Update operations */
for (row=start_row; row<=end_row; row++) {
guac_terminal_operation* current = current_row;
for (col=0; colwidth; col++) {
/* If no operation here, set as copy */
if (current->type == GUAC_CHAR_NOP) {
current->type = GUAC_CHAR_COPY;
current->row = row;
current->column = col;
}
/* Next column */
current++;
}
/* Next row */
current_row += display->width;
}
/* If selection visible and committed, clear if update touches selection */
if (display->text_selected && display->selection_committed &&
__guac_terminal_display_selected_contains(display, start_row, 0, end_row, display->width - 1))
__guac_terminal_display_clear_select(display);
}
void guac_terminal_display_set_columns(guac_terminal_display* display, int row,
int start_column, int end_column, guac_terminal_char* character) {
int i;
guac_terminal_operation* current;
/* Ignore operations outside display bounds */
if (row < 0 || row >= display->height)
return;
/* Fit range within bounds */
start_column = guac_terminal_fit_to_range(start_column, 0, display->width - 1);
end_column = guac_terminal_fit_to_range(end_column, 0, display->width - 1);
current = &(display->operations[row * display->width + start_column]);
/* For each column in range */
for (i = start_column; i <= end_column; i += character->width) {
/* Set operation */
current->type = GUAC_CHAR_SET;
current->character = *character;
/* Next character */
current += character->width;
}
/* If selection visible and committed, clear if update touches selection */
if (display->text_selected && display->selection_committed &&
__guac_terminal_display_selected_contains(display, row, start_column, row, end_column))
__guac_terminal_display_clear_select(display);
}
void guac_terminal_display_resize(guac_terminal_display* display, int width, int height) {
guac_terminal_operation* current;
int x, y;
/* Fill with background color */
guac_terminal_char fill = {
.value = 0,
.attributes = {
.foreground = display->default_background,
.background = display->default_background
},
.width = 1
};
/* Free old operations buffer */
if (display->operations != NULL)
free(display->operations);
/* Alloc operations */
display->operations = malloc(width * height *
sizeof(guac_terminal_operation));
/* Init each operation buffer row */
current = display->operations;
for (y=0; ywidth && y < display->height)
current->type = GUAC_CHAR_NOP;
/* Otherwise, clear contents first */
else {
current->type = GUAC_CHAR_SET;
current->character = fill;
}
current++;
}
}
/* Set width and height */
display->width = width;
display->height = height;
/* Send display size */
guac_common_surface_resize(
display->display_surface,
display->char_width * width,
display->char_height * height);
guac_protocol_send_size(display->client->socket,
display->select_layer,
display->char_width * width,
display->char_height * height);
/* If selection visible and committed, clear */
if (display->text_selected && display->selection_committed)
__guac_terminal_display_clear_select(display);
}
void __guac_terminal_display_flush_copy(guac_terminal_display* display) {
guac_terminal_operation* current = display->operations;
int row, col;
/* For each operation */
for (row=0; rowheight; row++) {
for (col=0; colwidth; col++) {
/* If operation is a copy operation */
if (current->type == GUAC_CHAR_COPY) {
/* The determined bounds of the rectangle of contiguous
* operations */
int detected_right = -1;
int detected_bottom = row;
/* The current row or column within a rectangle */
int rect_row, rect_col;
/* The dimensions of the rectangle as determined */
int rect_width, rect_height;
/* The expected row and column source for the next copy
* operation (if adjacent to current) */
int expected_row, expected_col;
/* Current row within a subrect */
guac_terminal_operation* rect_current_row;
/* Determine bounds of rectangle */
rect_current_row = current;
expected_row = current->row;
for (rect_row=row; rect_rowheight; rect_row++) {
guac_terminal_operation* rect_current = rect_current_row;
expected_col = current->column;
/* Find width */
for (rect_col=col; rect_colwidth; rect_col++) {
/* If not identical operation, stop */
if (rect_current->type != GUAC_CHAR_COPY
|| rect_current->row != expected_row
|| rect_current->column != expected_col)
break;
/* Next column */
rect_current++;
expected_col++;
}
/* If too small, cannot append row */
if (rect_col-1 < detected_right)
break;
/* As row has been accepted, update rect_row of rect */
detected_bottom = rect_row;
/* For now, only set rect_col bound if uninitialized */
if (detected_right == -1)
detected_right = rect_col - 1;
/* Next row */
rect_current_row += display->width;
expected_row++;
}
/* Calculate dimensions */
rect_width = detected_right - col + 1;
rect_height = detected_bottom - row + 1;
/* Mark rect as NOP (as it has been handled) */
rect_current_row = current;
expected_row = current->row;
for (rect_row=0; rect_rowcolumn;
for (rect_col=0; rect_coltype == GUAC_CHAR_COPY
&& rect_current->row == expected_row
&& rect_current->column == expected_col)
rect_current->type = GUAC_CHAR_NOP;
/* Next column */
rect_current++;
expected_col++;
}
/* Next row */
rect_current_row += display->width;
expected_row++;
}
/* Send copy */
guac_common_surface_copy(
display->display_surface,
current->column * display->char_width,
current->row * display->char_height,
rect_width * display->char_width,
rect_height * display->char_height,
display->display_surface,
col * display->char_width,
row * display->char_height);
} /* end if copy operation */
/* Next operation */
current++;
}
}
}
void __guac_terminal_display_flush_clear(guac_terminal_display* display) {
guac_terminal_operation* current = display->operations;
int row, col;
/* For each operation */
for (row=0; rowheight; row++) {
for (col=0; colwidth; col++) {
/* If operation is a cler operation (set to space) */
if (current->type == GUAC_CHAR_SET &&
!guac_terminal_has_glyph(current->character.value)) {
/* The determined bounds of the rectangle of contiguous
* operations */
int detected_right = -1;
int detected_bottom = row;
/* The current row or column within a rectangle */
int rect_row, rect_col;
/* The dimensions of the rectangle as determined */
int rect_width, rect_height;
/* Color of the rectangle to draw */
int color;
if (current->character.attributes.reverse != current->character.attributes.cursor)
color = current->character.attributes.foreground;
else
color = current->character.attributes.background;
const guac_terminal_color* guac_color =
&guac_terminal_palette[color];
/* Current row within a subrect */
guac_terminal_operation* rect_current_row;
/* Determine bounds of rectangle */
rect_current_row = current;
for (rect_row=row; rect_rowheight; rect_row++) {
guac_terminal_operation* rect_current = rect_current_row;
/* Find width */
for (rect_col=col; rect_colwidth; rect_col++) {
int joining_color;
if (rect_current->character.attributes.reverse != rect_current->character.attributes.cursor)
joining_color = rect_current->character.attributes.foreground;
else
joining_color = rect_current->character.attributes.background;
/* If not identical operation, stop */
if (rect_current->type != GUAC_CHAR_SET
|| guac_terminal_has_glyph(rect_current->character.value)
|| joining_color != color)
break;
/* Next column */
rect_current++;
}
/* If too small, cannot append row */
if (rect_col-1 < detected_right)
break;
/* As row has been accepted, update rect_row of rect */
detected_bottom = rect_row;
/* For now, only set rect_col bound if uninitialized */
if (detected_right == -1)
detected_right = rect_col - 1;
/* Next row */
rect_current_row += display->width;
}
/* Calculate dimensions */
rect_width = detected_right - col + 1;
rect_height = detected_bottom - row + 1;
/* Mark rect as NOP (as it has been handled) */
rect_current_row = current;
for (rect_row=0; rect_rowcharacter.attributes.reverse != rect_current->character.attributes.cursor)
joining_color = rect_current->character.attributes.foreground;
else
joining_color = rect_current->character.attributes.background;
/* Mark clear operations as NOP */
if (rect_current->type == GUAC_CHAR_SET
&& !guac_terminal_has_glyph(rect_current->character.value)
&& joining_color == color)
rect_current->type = GUAC_CHAR_NOP;
/* Next column */
rect_current++;
}
/* Next row */
rect_current_row += display->width;
}
/* Send rect */
guac_common_surface_rect(
display->display_surface,
col * display->char_width,
row * display->char_height,
rect_width * display->char_width,
rect_height * display->char_height,
guac_color->red, guac_color->green, guac_color->blue);
} /* end if clear operation */
/* Next operation */
current++;
}
}
}
void __guac_terminal_display_flush_set(guac_terminal_display* display) {
guac_terminal_operation* current = display->operations;
int row, col;
/* For each operation */
for (row=0; rowheight; row++) {
for (col=0; colwidth; col++) {
/* Perform given operation */
if (current->type == GUAC_CHAR_SET) {
int codepoint = current->character.value;
/* Use space if no glyph */
if (!guac_terminal_has_glyph(codepoint))
codepoint = ' ';
/* Set attributes */
__guac_terminal_set_colors(display,
&(current->character.attributes));
/* Send character */
__guac_terminal_set(display, row, col, codepoint);
/* Mark operation as handled */
current->type = GUAC_CHAR_NOP;
}
/* Next operation */
current++;
}
}
}
void guac_terminal_display_flush(guac_terminal_display* display) {
/* Flush operations, copies first, then clears, then sets. */
__guac_terminal_display_flush_copy(display);
__guac_terminal_display_flush_clear(display);
__guac_terminal_display_flush_set(display);
/* Flush surface */
guac_common_surface_flush(display->display_surface);
}
void guac_terminal_display_commit_select(guac_terminal_display* display) {
display->selection_committed = true;
}
void guac_terminal_display_select(guac_terminal_display* display,
int start_row, int start_col, int end_row, int end_col) {
guac_socket* socket = display->client->socket;
guac_layer* select_layer = display->select_layer;
/* Text is now selected */
display->text_selected = true;
display->selection_start_row = start_row;
display->selection_start_column = start_col;
display->selection_end_row = end_row;
display->selection_end_column = end_col;
/* If single row, just need one rectangle */
if (start_row == end_row) {
/* Ensure proper ordering of columns */
if (start_col > end_col) {
int temp = start_col;
start_col = end_col;
end_col = temp;
}
/* Select characters between columns */
guac_protocol_send_rect(socket, select_layer,
start_col * display->char_width,
start_row * display->char_height,
(end_col - start_col + 1) * display->char_width,
display->char_height);
}
/* Otherwise, need three */
else {
/* Ensure proper ordering of start and end coords */
if (start_row > end_row) {
int temp;
temp = start_row;
start_row = end_row;
end_row = temp;
temp = start_col;
start_col = end_col;
end_col = temp;
}
/* First row */
guac_protocol_send_rect(socket, select_layer,
start_col * display->char_width,
start_row * display->char_height,
display->width * display->char_width,
display->char_height);
/* Middle */
guac_protocol_send_rect(socket, select_layer,
0,
(start_row + 1) * display->char_height,
display->width * display->char_width,
(end_row - start_row - 1) * display->char_height);
/* Last row */
guac_protocol_send_rect(socket, select_layer,
0,
end_row * display->char_height,
(end_col + 1) * display->char_width,
display->char_height);
}
/* Draw new selection, erasing old */
guac_protocol_send_cfill(socket, GUAC_COMP_SRC, select_layer,
0x00, 0x80, 0xFF, 0x60);
guac_protocol_send_sync(socket, display->client->last_sent_timestamp);
guac_socket_flush(socket);
}
guacamole-server-0.9.9/src/terminal/pointer.h 0000664 0001751 0001751 00000004114 12643542623 016161 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_TERMINAL_POINTER_H
#define GUAC_TERMINAL_POINTER_H
#include "config.h"
#include
#include
/**
* Width of the embedded mouse cursor graphic.
*/
extern const int guac_terminal_pointer_width;
/**
* Height of the embedded mouse cursor graphic.
*/
extern const int guac_terminal_pointer_height;
/**
* Number of bytes in each row of the embedded mouse cursor graphic.
*/
extern const int guac_terminal_pointer_stride;
/**
* The Cairo grapic format of the mouse cursor graphic.
*/
extern const cairo_format_t guac_terminal_pointer_format;
/**
* Embedded mouse cursor graphic.
*/
extern unsigned char guac_terminal_pointer[];
/**
* Creates a new pointer cursor, returning the corresponding cursor object.
*
* @param client
* The guac_client to send the cursor to.
*
* @return
* A new cursor which must be free'd via guac_terminal_cursor_free().
*/
guac_terminal_cursor* guac_terminal_create_pointer(guac_client* client);
#endif
guacamole-server-0.9.9/src/terminal/buffer.c 0000664 0001751 0001751 00000014706 12536405625 015756 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "buffer.h"
#include "common.h"
#include
#include
guac_terminal_buffer* guac_terminal_buffer_alloc(int rows, guac_terminal_char* default_character) {
/* Allocate scrollback */
guac_terminal_buffer* buffer =
malloc(sizeof(guac_terminal_buffer));
int i;
guac_terminal_buffer_row* row;
/* Init scrollback data */
buffer->default_character = *default_character;
buffer->available = rows;
buffer->top = 0;
buffer->length = 0;
buffer->rows = malloc(sizeof(guac_terminal_buffer_row) *
buffer->available);
/* Init scrollback rows */
row = buffer->rows;
for (i=0; iavailable = 256;
row->length = 0;
row->characters = malloc(sizeof(guac_terminal_char) * row->available);
/* Next row */
row++;
}
return buffer;
}
void guac_terminal_buffer_free(guac_terminal_buffer* buffer) {
int i;
guac_terminal_buffer_row* row = buffer->rows;
/* Free all rows */
for (i=0; iavailable; i++) {
free(row->characters);
row++;
}
/* Free actual buffer */
free(buffer->rows);
free(buffer);
}
guac_terminal_buffer_row* guac_terminal_buffer_get_row(guac_terminal_buffer* buffer, int row, int width) {
int i;
guac_terminal_char* first;
guac_terminal_buffer_row* buffer_row;
/* Calculate scrollback row index */
int index = buffer->top + row;
if (index < 0)
index += buffer->available;
else if (index >= buffer->available)
index -= buffer->available;
/* Get row */
buffer_row = &(buffer->rows[index]);
/* If resizing is needed */
if (width >= buffer_row->length) {
/* Expand if necessary */
if (width > buffer_row->available) {
buffer_row->available = width*2;
buffer_row->characters = realloc(buffer_row->characters, sizeof(guac_terminal_char) * buffer_row->available);
}
/* Initialize new part of row */
first = &(buffer_row->characters[buffer_row->length]);
for (i=buffer_row->length; idefault_character;
buffer_row->length = width;
}
/* Return found row */
return buffer_row;
}
void guac_terminal_buffer_copy_columns(guac_terminal_buffer* buffer, int row,
int start_column, int end_column, int offset) {
guac_terminal_char* src;
guac_terminal_char* dst;
/* Get row */
guac_terminal_buffer_row* buffer_row = guac_terminal_buffer_get_row(buffer, row, end_column + offset + 1);
/* Fit range within bounds */
start_column = guac_terminal_fit_to_range(start_column, 0, buffer_row->length - 1);
end_column = guac_terminal_fit_to_range(end_column, 0, buffer_row->length - 1);
start_column = guac_terminal_fit_to_range(start_column + offset, 0, buffer_row->length - 1) - offset;
end_column = guac_terminal_fit_to_range(end_column + offset, 0, buffer_row->length - 1) - offset;
/* Determine source and destination locations */
src = &(buffer_row->characters[start_column]);
dst = &(buffer_row->characters[start_column + offset]);
/* Copy data */
memmove(dst, src, sizeof(guac_terminal_char) * (end_column - start_column + 1));
}
void guac_terminal_buffer_copy_rows(guac_terminal_buffer* buffer,
int start_row, int end_row, int offset) {
int i, current_row;
int step;
/* If shifting down, copy in reverse */
if (offset > 0) {
current_row = end_row;
step = -1;
}
/* Otherwise, copy forwards */
else {
current_row = start_row;
step = 1;
}
/* Copy each current_row individually */
for (i = start_row; i <= end_row; i++) {
/* Get source and destination rows */
guac_terminal_buffer_row* src_row = guac_terminal_buffer_get_row(buffer, current_row, 0);
guac_terminal_buffer_row* dst_row = guac_terminal_buffer_get_row(buffer, current_row + offset, src_row->length);
/* Copy data */
memcpy(dst_row->characters, src_row->characters, sizeof(guac_terminal_char) * src_row->length);
dst_row->length = src_row->length;
/* Next current_row */
current_row += step;
}
}
void guac_terminal_buffer_set_columns(guac_terminal_buffer* buffer, int row,
int start_column, int end_column, guac_terminal_char* character) {
int i, j;
guac_terminal_char* current;
/* Build continuation char (for multicolumn characters) */
guac_terminal_char continuation_char;
continuation_char.value = GUAC_CHAR_CONTINUATION;
continuation_char.attributes = character->attributes;
continuation_char.width = 0; /* Not applicable for GUAC_CHAR_CONTINUATION */
/* Get and expand row */
guac_terminal_buffer_row* buffer_row = guac_terminal_buffer_get_row(buffer, row, end_column+1);
/* Set values */
current = &(buffer_row->characters[start_column]);
for (i = start_column; i <= end_column; i += character->width) {
*(current++) = *character;
/* Store any required continuation characters */
for (j=1; j < character->width; j++)
*(current++) = continuation_char;
}
/* Update length depending on row written */
if (character->value != 0 && row >= buffer->length)
buffer->length = row+1;
}
guacamole-server-0.9.9/src/terminal/pointer.c 0000664 0001751 0001751 00000006042 12643542623 016156 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "cursor.h"
#include
#include
#include
#include
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define U 0x80,0x80,0x80,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
/* Dimensions */
const int guac_terminal_pointer_width = 11;
const int guac_terminal_pointer_height = 16;
/* Format */
const cairo_format_t guac_terminal_pointer_format = CAIRO_FORMAT_ARGB32;
const int guac_terminal_pointer_stride = 44;
/* Embedded pointer graphic */
unsigned char guac_terminal_pointer[] = {
O,_,_,_,_,_,_,_,_,_,_,
O,O,_,_,_,_,_,_,_,_,_,
O,X,O,_,_,_,_,_,_,_,_,
O,X,X,O,_,_,_,_,_,_,_,
O,X,X,X,O,_,_,_,_,_,_,
O,X,X,X,X,O,_,_,_,_,_,
O,X,X,X,X,X,O,_,_,_,_,
O,X,X,X,X,X,X,O,_,_,_,
O,X,X,X,X,X,X,X,O,_,_,
O,X,X,X,X,X,X,X,X,O,_,
O,X,X,X,X,X,O,O,O,O,O,
O,X,X,O,X,X,O,_,_,_,_,
O,X,O,_,O,X,X,O,_,_,_,
O,O,_,_,O,X,X,O,_,_,_,
O,_,_,_,_,O,X,X,O,_,_,
_,_,_,_,_,O,O,O,O,_,_
};
guac_terminal_cursor* guac_terminal_create_pointer(guac_client* client) {
guac_socket* socket = client->socket;
guac_terminal_cursor* cursor = guac_terminal_cursor_alloc(client);
/* Draw to buffer */
cairo_surface_t* graphic = cairo_image_surface_create_for_data(
guac_terminal_pointer,
guac_terminal_pointer_format,
guac_terminal_pointer_width,
guac_terminal_pointer_height,
guac_terminal_pointer_stride);
guac_client_stream_png(client, socket, GUAC_COMP_SRC, cursor->buffer,
0, 0, graphic);
cairo_surface_destroy(graphic);
/* Initialize cursor properties */
cursor->width = guac_terminal_pointer_width;
cursor->height = guac_terminal_pointer_height;
cursor->hotspot_x = 0;
cursor->hotspot_y = 0;
return cursor;
}
guacamole-server-0.9.9/src/terminal/display.h 0000664 0001751 0001751 00000020675 12626133327 016156 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_DISPLAY_H
#define _GUAC_TERMINAL_DISPLAY_H
#include "config.h"
#include "guac_surface.h"
#include "types.h"
#include
#include
#include
#include
/**
* The maximum width of any character, in columns.
*/
#define GUAC_TERMINAL_MAX_CHAR_WIDTH 2
/**
* The index of black within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_BLACK 0
/**
* The index of low-intensity red within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_DARK_RED 1
/**
* The index of low-intensity green within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_DARK_GREEN 2
/**
* The index of brown within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_BROWN 3
/**
* The index of low-intensity blue within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_DARK_BLUE 4
/**
* The index of low-intensity magenta (purple) within the terminal color
* palette.
*/
#define GUAC_TERMINAL_COLOR_PURPLE 5
/**
* The index of low-intensity cyan (teal) within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_TEAL 6
/**
* The index of low-intensity white (gray) within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_GRAY 7
/**
* The index of bright black (dark gray) within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_DARK_GRAY 8
/**
* The index of bright red within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_RED 9
/**
* The index of bright green within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_GREEN 10
/**
* The index of bright brown (yellow) within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_YELLOW 11
/**
* The index of bright blue within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_BLUE 12
/**
* The index of bright magenta within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_MAGENTA 13
/**
* The index of bright cyan within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_CYAN 14
/**
* The index of bright white within the terminal color palette.
*/
#define GUAC_TERMINAL_COLOR_WHITE 15
/**
* The available color palette. All integer colors within structures
* here are indices into this palette.
*/
extern const guac_terminal_color guac_terminal_palette[16];
/**
* All available terminal operations which affect character cells.
*/
typedef enum guac_terminal_operation_type {
/**
* Operation which does nothing.
*/
GUAC_CHAR_NOP,
/**
* Operation which copies a character from a given row/column coordinate.
*/
GUAC_CHAR_COPY,
/**
* Operation which sets the character and attributes.
*/
GUAC_CHAR_SET
} guac_terminal_operation_type;
/**
* A pairing of a guac_terminal_operation_type and all parameters required by
* that operation type.
*/
typedef struct guac_terminal_operation {
/**
* The type of operation to perform.
*/
guac_terminal_operation_type type;
/**
* The character (and attributes) to set the current location to. This is
* only applicable to GUAC_CHAR_SET.
*/
guac_terminal_char character;
/**
* The row to copy a character from. This is only applicable to
* GUAC_CHAR_COPY.
*/
int row;
/**
* The column to copy a character from. This is only applicable to
* GUAC_CHAR_COPY.
*/
int column;
} guac_terminal_operation;
/**
* Set of all pending operations for the currently-visible screen area.
*/
typedef struct guac_terminal_display {
/**
* The Guacamole client this display will use for rendering.
*/
guac_client* client;
/**
* Array of all operations pending for the visible screen area.
*/
guac_terminal_operation* operations;
/**
* The width of the screen, in characters.
*/
int width;
/**
* The height of the screen, in characters.
*/
int height;
/**
* The description of the font to use for rendering.
*/
PangoFontDescription* font_desc;
/**
* The width of each character, in pixels.
*/
int char_width;
/**
* The height of each character, in pixels.
*/
int char_height;
/**
* Default foreground color for all glyphs.
*/
int default_foreground;
/**
* Default background color for all glyphs and the terminal itself.
*/
int default_background;
/**
* Color of glyphs in copy buffer
*/
int glyph_foreground;
/**
* Color of glyphs in copy buffer
*/
int glyph_background;
/**
* The surface containing the actual terminal.
*/
guac_common_surface* display_surface;
/**
* Layer which contains the actual terminal.
*/
guac_layer* display_layer;
/**
* Sub-layer of display layer which highlights selected text.
*/
guac_layer* select_layer;
/**
* Whether text is being selected.
*/
bool text_selected;
/**
* Whether the selection is finished, and will no longer be modified. A
* committed selection remains highlighted for reference, but the
* highlight will be removed when the display changes.
*/
bool selection_committed;
/**
* The row that the selection starts at.
*/
int selection_start_row;
/**
* The column that the selection starts at.
*/
int selection_start_column;
/**
* The row that the selection ends at.
*/
int selection_end_row;
/**
* The column that the selection ends at.
*/
int selection_end_column;
} guac_terminal_display;
/**
* Allocates a new display having the given default foreground and background
* colors.
*/
guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
const char* font_name, int font_size, int dpi,
int foreground, int background);
/**
* Frees the given display.
*/
void guac_terminal_display_free(guac_terminal_display* display);
/**
* Copies the given range of columns to a new location, offset from
* the original by the given number of columns.
*/
void guac_terminal_display_copy_columns(guac_terminal_display* display, int row,
int start_column, int end_column, int offset);
/**
* Copies the given range of rows to a new location, offset from the
* original by the given number of rows.
*/
void guac_terminal_display_copy_rows(guac_terminal_display* display,
int start_row, int end_row, int offset);
/**
* Sets the given range of columns within the given row to the given
* character.
*/
void guac_terminal_display_set_columns(guac_terminal_display* display, int row,
int start_column, int end_column, guac_terminal_char* character);
/**
* Resize the terminal to the given dimensions.
*/
void guac_terminal_display_resize(guac_terminal_display* display, int width, int height);
/**
* Flushes all pending operations within the given guac_terminal_display.
*/
void guac_terminal_display_flush(guac_terminal_display* display);
/**
* Draws the text selection rectangle from the given coordinates to the given end coordinates.
*/
void guac_terminal_display_select(guac_terminal_display* display,
int start_row, int start_col, int end_row, int end_col);
/**
* Commits the select rectangle, allowing the display to clear it when
* necessary.
*/
void guac_terminal_display_commit_select(guac_terminal_display* display);
#endif
guacamole-server-0.9.9/src/terminal/terminal_handlers.h 0000664 0001751 0001751 00000003442 12645364210 020173 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_HANDLERS
#define _GUAC_TERMINAL_HANDLERS
#include "config.h"
#include "terminal.h"
int guac_terminal_echo(guac_terminal* term, unsigned char c);
int guac_terminal_escape(guac_terminal* term, unsigned char c);
int guac_terminal_g0_charset(guac_terminal* term, unsigned char c);
int guac_terminal_g1_charset(guac_terminal* term, unsigned char c);
int guac_terminal_csi(guac_terminal* term, unsigned char c);
int guac_terminal_download(guac_terminal* term, unsigned char c);
int guac_terminal_set_directory(guac_terminal* term, unsigned char c);
int guac_terminal_osc(guac_terminal* term, unsigned char c);
int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c);
#endif
guacamole-server-0.9.9/src/terminal/buffer.h 0000664 0001751 0001751 00000007774 12536405625 015772 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_BUFFER_H
#define _GUAC_TERMINAL_BUFFER_H
#include "config.h"
#include "types.h"
/**
* A single variable-length row of terminal data.
*/
typedef struct guac_terminal_buffer_row {
/**
* Array of guac_terminal_char representing the contents of the row.
*/
guac_terminal_char* characters;
/**
* The length of this row in characters. This is the number of initialized
* characters in the buffer, usually equal to the number of characters
* in the screen width at the time this row was created.
*/
int length;
/**
* The number of elements in the characters array. After the length
* equals this value, the array must be resized.
*/
int available;
} guac_terminal_buffer_row;
/**
* A buffer containing a constant number of arbitrary-length rows.
* New rows can be appended to the buffer, with the oldest row replaced with
* the new row.
*/
typedef struct guac_terminal_buffer {
/**
* The character to assign to newly-allocated cells.
*/
guac_terminal_char default_character;
/**
* Array of buffer rows. This array functions as a ring buffer.
* When a new row needs to be appended, the top reference is moved down
* and the old top row is replaced.
*/
guac_terminal_buffer_row* rows;
/**
* The row to replace when adding a new row to the buffer.
*/
int top;
/**
* The number of rows currently stored in the buffer.
*/
int length;
/**
* The number of rows in the buffer. This is the total capacity
* of the buffer.
*/
int available;
} guac_terminal_buffer;
/**
* Allocates a new buffer having the given maximum number of rows. New character cells will
* be initialized to the given character.
*/
guac_terminal_buffer* guac_terminal_buffer_alloc(int rows, guac_terminal_char* default_character);
/**
* Frees the given buffer.
*/
void guac_terminal_buffer_free(guac_terminal_buffer* buffer);
/**
* Returns the row at the given location. The row returned is guaranteed to be at least the given
* width.
*/
guac_terminal_buffer_row* guac_terminal_buffer_get_row(guac_terminal_buffer* buffer, int row, int width);
/**
* Copies the given range of columns to a new location, offset from
* the original by the given number of columns.
*/
void guac_terminal_buffer_copy_columns(guac_terminal_buffer* buffer, int row,
int start_column, int end_column, int offset);
/**
* Copies the given range of rows to a new location, offset from the
* original by the given number of rows.
*/
void guac_terminal_buffer_copy_rows(guac_terminal_buffer* buffer,
int start_row, int end_row, int offset);
/**
* Sets the given range of columns within the given row to the given
* character.
*/
void guac_terminal_buffer_set_columns(guac_terminal_buffer* buffer, int row,
int start_column, int end_column, guac_terminal_char* character);
#endif
guacamole-server-0.9.9/src/terminal/Makefile.am 0000664 0001751 0001751 00000004674 12643542623 016377 0000000 0000000 #
# Copyright (C) 2015 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
noinst_LTLIBRARIES = libguac_terminal.la
noinst_HEADERS = \
blank.h \
buffer.h \
char_mappings.h \
common.h \
cursor.h \
display.h \
ibar.h \
packet.h \
pointer.h \
scrollbar.h \
terminal.h \
terminal_handlers.h \
types.h
libguac_terminal_la_SOURCES = \
blank.c \
buffer.c \
char_mappings.c \
common.c \
cursor.c \
display.c \
ibar.c \
packet.c \
pointer.c \
scrollbar.c \
terminal.c \
terminal_handlers.c
libguac_terminal_la_CFLAGS = \
-Werror -Wall -pedantic \
@COMMON_INCLUDE@ \
@LIBGUAC_INCLUDE@ \
@PANGO_CFLAGS@ \
@PANGOCAIRO_CFLAGS@
libguac_terminal_la_LIBADD = \
@LIBGUAC_LTLIB@
libguac_terminal_la_LDFLAGS = \
@CAIRO_LIBS@ \
@MATH_LIBS@ \
@PANGO_LIBS@ \
@PANGOCAIRO_LIBS@ \
@PTHREAD_LIBS@
guacamole-server-0.9.9/src/terminal/scrollbar.c 0000664 0001751 0001751 00000030577 12626133327 016471 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "scrollbar.h"
#include
#include
#include
#include
#include
guac_terminal_scrollbar* guac_terminal_scrollbar_alloc(guac_client* client,
const guac_layer* parent, int parent_width, int parent_height, int visible_area) {
/* Allocate scrollbar */
guac_terminal_scrollbar* scrollbar =
malloc(sizeof(guac_terminal_scrollbar));
/* Associate client */
scrollbar->client = client;
/* Init default min/max and value */
scrollbar->min = 0;
scrollbar->max = 0;
scrollbar->value = 0;
/* Init parent data */
scrollbar->parent = parent;
scrollbar->parent_width = 0;
scrollbar->parent_height = 0;
scrollbar->visible_area = 0;
/* Init handle render state */
scrollbar->render_state.handle_x = 0;
scrollbar->render_state.handle_y = 0;
scrollbar->render_state.handle_width = 0;
scrollbar->render_state.handle_height = 0;
/* Init container render state */
scrollbar->render_state.container_x = 0;
scrollbar->render_state.container_y = 0;
scrollbar->render_state.container_width = 0;
scrollbar->render_state.container_height = 0;
/* Allocate and init layers */
scrollbar->container = guac_client_alloc_layer(client);
scrollbar->handle = guac_client_alloc_layer(client);
/* Init mouse event state tracking */
scrollbar->dragging_handle = 0;
/* Reposition and resize to fit parent */
guac_terminal_scrollbar_parent_resized(scrollbar,
parent_width, parent_height, visible_area);
return scrollbar;
}
void guac_terminal_scrollbar_free(guac_terminal_scrollbar* scrollbar) {
/* Free layers */
guac_client_free_layer(scrollbar->client, scrollbar->handle);
guac_client_free_layer(scrollbar->client, scrollbar->container);
/* Free scrollbar */
free(scrollbar);
}
/**
* Calculates the state of the scroll bar, given its minimum, maximum, current
* values, and the state of any dragging operation. The resulting render state
* will not be reflected graphically unless the scrollbar is flushed, and any
* resulting value will not be assigned to the scrollbar unless explicitly set
* with guac_terminal_scrollbar_set_value().
*
* @param scrollbar
* The scrollbar whose state should be calculated.
*
* @param render_state
* A pointer to an existing guac_terminal_scrollbar_render_state that will
* be populated with the calculated result.
*
* @param value
* A pointer to an existing int that will be populated with the updated
* scrollbar value.
*/
static void calculate_state(guac_terminal_scrollbar* scrollbar,
guac_terminal_scrollbar_render_state* render_state,
int* value) {
/* Use unchanged current value by default */
*value = scrollbar->value;
/* Calculate container dimensions */
render_state->container_width = GUAC_TERMINAL_SCROLLBAR_WIDTH;
render_state->container_height = scrollbar->parent_height;
/* Calculate container position */
render_state->container_x = scrollbar->parent_width
- render_state->container_width;
render_state->container_y = 0;
/* Calculate handle dimensions */
render_state->handle_width = render_state->container_width
- GUAC_TERMINAL_SCROLLBAR_PADDING*2;
/* Handle can be no bigger than the scrollbar itself */
int max_handle_height = render_state->container_height
- GUAC_TERMINAL_SCROLLBAR_PADDING*2;
/* Calculate legal delta between scroll values */
int scroll_delta;
if (scrollbar->max > scrollbar->min)
scroll_delta = scrollbar->max - scrollbar->min;
else
scroll_delta = 0;
/* Scale handle relative to visible area vs. scrolling region size */
int proportional_height = max_handle_height
* scrollbar->visible_area
/ (scroll_delta + scrollbar->visible_area);
/* Ensure handle is no smaller than minimum height */
if (proportional_height > GUAC_TERMINAL_SCROLLBAR_MIN_HEIGHT)
render_state->handle_height = proportional_height;
else
render_state->handle_height = GUAC_TERMINAL_SCROLLBAR_MIN_HEIGHT;
/* Ensure handle is no larger than maximum height */
if (render_state->handle_height > max_handle_height)
render_state->handle_height = max_handle_height;
/* Calculate handle X position */
render_state->handle_x = GUAC_TERMINAL_SCROLLBAR_PADDING;
/* Calculate handle Y range */
int min_handle_y = GUAC_TERMINAL_SCROLLBAR_PADDING;
int max_handle_y = min_handle_y + max_handle_height
- render_state->handle_height;
/* Position handle relative to mouse if being dragged */
if (scrollbar->dragging_handle) {
int dragged_handle_y = scrollbar->drag_current_y
- scrollbar->drag_offset_y;
/* Keep handle within bounds */
if (dragged_handle_y < min_handle_y)
dragged_handle_y = min_handle_y;
else if (dragged_handle_y > max_handle_y)
dragged_handle_y = max_handle_y;
render_state->handle_y = dragged_handle_y;
/* Calculate scrollbar value */
if (max_handle_y > min_handle_y) {
*value = scrollbar->min
+ (dragged_handle_y - min_handle_y)
* scroll_delta
/ (max_handle_y - min_handle_y);
}
}
/* Handle Y position is relative to current scroll value */
else if (scroll_delta > 0)
render_state->handle_y = min_handle_y
+ (max_handle_y - min_handle_y)
* (scrollbar->value - scrollbar->min)
/ scroll_delta;
/* ... unless there is only one possible scroll value */
else
render_state->handle_y = GUAC_TERMINAL_SCROLLBAR_PADDING;
}
void guac_terminal_scrollbar_flush(guac_terminal_scrollbar* scrollbar) {
guac_socket* socket = scrollbar->client->socket;
/* Get old state */
int old_value = scrollbar->value;
guac_terminal_scrollbar_render_state* old_state = &scrollbar->render_state;
/* Calculate new state */
int new_value;
guac_terminal_scrollbar_render_state new_state;
calculate_state(scrollbar, &new_state, &new_value);
/* Notify of scroll if value is changing */
if (new_value != old_value && scrollbar->scroll_handler)
scrollbar->scroll_handler(scrollbar, new_value);
/* Reposition container if moved */
if (old_state->container_x != new_state.container_x
|| old_state->container_y != new_state.container_y) {
guac_protocol_send_move(socket,
scrollbar->container, scrollbar->parent,
new_state.container_x,
new_state.container_y,
0);
}
/* Resize and redraw container if size changed */
if (old_state->container_width != new_state.container_width
|| old_state->container_height != new_state.container_height) {
/* Set new size */
guac_protocol_send_size(socket, scrollbar->container,
new_state.container_width,
new_state.container_height);
/* Fill container with solid color */
guac_protocol_send_rect(socket, scrollbar->container, 0, 0,
new_state.container_width,
new_state.container_height);
guac_protocol_send_cfill(socket, GUAC_COMP_SRC, scrollbar->container,
0x80, 0x80, 0x80, 0x40);
}
/* Reposition handle if moved */
if (old_state->handle_x != new_state.handle_x
|| old_state->handle_y != new_state.handle_y) {
guac_protocol_send_move(socket,
scrollbar->handle, scrollbar->container,
new_state.handle_x,
new_state.handle_y,
0);
}
/* Resize and redraw handle if size changed */
if (old_state->handle_width != new_state.handle_width
|| old_state->handle_height != new_state.handle_height) {
/* Send new size */
guac_protocol_send_size(socket, scrollbar->handle,
new_state.handle_width,
new_state.handle_height);
/* Fill and stroke handle with solid color */
guac_protocol_send_rect(socket, scrollbar->handle, 0, 0,
new_state.handle_width,
new_state.handle_height);
guac_protocol_send_cfill(socket, GUAC_COMP_SRC, scrollbar->handle,
0xA0, 0xA0, 0xA0, 0x8F);
}
/* Store current render state */
scrollbar->render_state = new_state;
}
void guac_terminal_scrollbar_set_bounds(guac_terminal_scrollbar* scrollbar,
int min, int max) {
/* Fit value within bounds */
if (scrollbar->value > max)
scrollbar->value = max;
else if (scrollbar->value < min)
scrollbar->value = min;
/* Update bounds */
scrollbar->min = min;
scrollbar->max = max;
}
void guac_terminal_scrollbar_set_value(guac_terminal_scrollbar* scrollbar,
int value) {
/* Fit value within bounds */
if (value > scrollbar->max)
value = scrollbar->max;
else if (value < scrollbar->min)
value = scrollbar->min;
/* Update value */
scrollbar->value = value;
}
void guac_terminal_scrollbar_parent_resized(guac_terminal_scrollbar* scrollbar,
int parent_width, int parent_height, int visible_area) {
/* Assign new dimensions */
scrollbar->parent_width = parent_width;
scrollbar->parent_height = parent_height;
scrollbar->visible_area = visible_area;
}
int guac_terminal_scrollbar_handle_mouse(guac_terminal_scrollbar* scrollbar,
int x, int y, int mask) {
/* Get container rectangle bounds */
int parent_left = scrollbar->render_state.container_x;
int parent_top = scrollbar->render_state.container_y;
int parent_right = parent_left + scrollbar->render_state.container_width;
int parent_bottom = parent_top + scrollbar->render_state.container_height;
/* Calculate handle rectangle bounds */
int handle_left = parent_left + scrollbar->render_state.handle_x;
int handle_top = parent_top + scrollbar->render_state.handle_y;
int handle_right = handle_left + scrollbar->render_state.handle_width;
int handle_bottom = handle_top + scrollbar->render_state.handle_height;
/* Handle click on handle */
if (scrollbar->dragging_handle) {
/* Update drag while mouse button is held */
if (mask & GUAC_CLIENT_MOUSE_LEFT)
scrollbar->drag_current_y = y;
/* Stop drag if mouse button is released */
else
scrollbar->dragging_handle = 0;
/* Mouse event was handled by scrollbar */
return 1;
}
else if (mask == GUAC_CLIENT_MOUSE_LEFT
&& x >= handle_left && x < handle_right
&& y >= handle_top && y < handle_bottom) {
/* Start drag */
scrollbar->dragging_handle = 1;
scrollbar->drag_offset_y = y - handle_top;
scrollbar->drag_current_y = y;
/* Mouse event was handled by scrollbar */
return 1;
}
/* Eat any events that occur within the scrollbar */
return x >= parent_left && x < parent_right
&& y >= parent_top && y < parent_bottom;
}
guacamole-server-0.9.9/src/terminal/cursor.h 0000664 0001751 0001751 00000004305 12643542623 016020 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TERMINAL_CURSOR_H
#define _GUAC_TERMINAL_CURSOR_H
#include "config.h"
#include
#include
typedef struct guac_terminal_cursor {
/**
* A buffer allocated with guac_client_alloc_buffer() that contains the
* cursor image.
*/
guac_layer* buffer;
/**
* The width of the cursor in pixels.
*/
int width;
/**
* The height of the cursor in pixels.
*/
int height;
/**
* The X coordinate of the cursor hotspot.
*/
int hotspot_x;
/**
* The Y coordinate of the cursor hotspot.
*/
int hotspot_y;
} guac_terminal_cursor;
/**
* Allocates a new cursor, pre-populating the cursor with a newly-allocated
* buffer.
*/
guac_terminal_cursor* guac_terminal_cursor_alloc(guac_client* client);
/**
* Frees the buffer associated with this cursor as well as the cursor itself.
*/
void guac_terminal_cursor_free(guac_client* client, guac_terminal_cursor* cursor);
/**
* Set the remote cursor.
*/
void guac_terminal_set_cursor(guac_client* client, guac_terminal_cursor* cursor);
#endif
guacamole-server-0.9.9/src/protocols/ 0000775 0001751 0001751 00000000000 12645400336 014615 5 0000000 0000000 guacamole-server-0.9.9/src/protocols/telnet/ 0000775 0001751 0001751 00000000000 12645400336 016110 5 0000000 0000000 guacamole-server-0.9.9/src/protocols/telnet/clipboard.c 0000664 0001751 0001751 00000004272 12536405625 020145 0000000 0000000 /*
* Copyright (C) 2014 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "clipboard.h"
#include "terminal.h"
#include
#include
int guac_telnet_clipboard_handler(guac_client* client, guac_stream* stream,
char* mimetype) {
/* Clear clipboard and prepare for new data */
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
guac_terminal_clipboard_reset(client_data->term, mimetype);
/* Set handlers for clipboard stream */
stream->blob_handler = guac_telnet_clipboard_blob_handler;
stream->end_handler = guac_telnet_clipboard_end_handler;
return 0;
}
int guac_telnet_clipboard_blob_handler(guac_client* client, guac_stream* stream,
void* data, int length) {
/* Append new data */
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
guac_terminal_clipboard_append(client_data->term, data, length);
return 0;
}
int guac_telnet_clipboard_end_handler(guac_client* client, guac_stream* stream) {
/* Nothing to do - clipboard is implemented within client */
return 0;
}
guacamole-server-0.9.9/src/protocols/telnet/Makefile.in 0000664 0001751 0001751 00000067362 12645400276 020116 0000000 0000000 # Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 2015 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src/protocols/telnet
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp $(noinst_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libguac_client_telnet_la_DEPENDENCIES =
am_libguac_client_telnet_la_OBJECTS = \
libguac_client_telnet_la-client.lo \
libguac_client_telnet_la-clipboard.lo \
libguac_client_telnet_la-guac_handlers.lo \
libguac_client_telnet_la-telnet_client.lo
libguac_client_telnet_la_OBJECTS = \
$(am_libguac_client_telnet_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libguac_client_telnet_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libguac_client_telnet_la_CFLAGS) $(CFLAGS) \
$(libguac_client_telnet_la_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libguac_client_telnet_la_SOURCES)
DIST_SOURCES = $(libguac_client_telnet_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CAIRO_LIBS = @CAIRO_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMMON_INCLUDE = @COMMON_INCLUDE@
COMMON_LTLIB = @COMMON_LTLIB@
COMMON_SSH_INCLUDE = @COMMON_SSH_INCLUDE@
COMMON_SSH_LTLIB = @COMMON_SSH_LTLIB@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CUNIT_LIBS = @CUNIT_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JPEG_LIBS = @JPEG_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBADD_DLOPEN = @LIBADD_DLOPEN@
LIBGUAC_INCLUDE = @LIBGUAC_INCLUDE@
LIBGUAC_LTLIB = @LIBGUAC_LTLIB@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PANGOCAIRO_CFLAGS = @PANGOCAIRO_CFLAGS@
PANGOCAIRO_LIBS = @PANGOCAIRO_LIBS@
PANGO_CFLAGS = @PANGO_CFLAGS@
PANGO_LIBS = @PANGO_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PNG_LIBS = @PNG_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
PULSE_LIBS = @PULSE_LIBS@
RANLIB = @RANLIB@
RDP_LIBS = @RDP_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SSH_LIBS = @SSH_LIBS@
SSL_LIBS = @SSL_LIBS@
STRIP = @STRIP@
TELNET_LIBS = @TELNET_LIBS@
TERMINAL_INCLUDE = @TERMINAL_INCLUDE@
TERMINAL_LTLIB = @TERMINAL_LTLIB@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
VNC_LIBS = @VNC_LIBS@
VORBIS_LIBS = @VORBIS_LIBS@
WEBP_LIBS = @WEBP_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
init_dir = @init_dir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libguac-client-telnet.la
libguac_client_telnet_la_SOURCES = \
client.c \
clipboard.c \
guac_handlers.c \
telnet_client.c
noinst_HEADERS = \
client.h \
clipboard.h \
guac_handlers.h \
telnet_client.h
libguac_client_telnet_la_CFLAGS = \
-Werror -Wall -Iinclude \
@LIBGUAC_INCLUDE@ \
@TERMINAL_INCLUDE@
libguac_client_telnet_la_LIBADD = \
@COMMON_LTLIB@ \
@LIBGUAC_LTLIB@ \
@TERMINAL_LTLIB@
libguac_client_telnet_la_LDFLAGS = \
-version-info 0:0:0 \
@PTHREAD_LIBS@ \
@TELNET_LIBS@
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/protocols/telnet/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/protocols/telnet/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libguac-client-telnet.la: $(libguac_client_telnet_la_OBJECTS) $(libguac_client_telnet_la_DEPENDENCIES) $(EXTRA_libguac_client_telnet_la_DEPENDENCIES)
$(AM_V_CCLD)$(libguac_client_telnet_la_LINK) -rpath $(libdir) $(libguac_client_telnet_la_OBJECTS) $(libguac_client_telnet_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_telnet_la-client.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_telnet_la-clipboard.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_telnet_la-guac_handlers.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_telnet_la-telnet_client.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
libguac_client_telnet_la-client.lo: client.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -MT libguac_client_telnet_la-client.lo -MD -MP -MF $(DEPDIR)/libguac_client_telnet_la-client.Tpo -c -o libguac_client_telnet_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_telnet_la-client.Tpo $(DEPDIR)/libguac_client_telnet_la-client.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client.c' object='libguac_client_telnet_la-client.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -c -o libguac_client_telnet_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c
libguac_client_telnet_la-clipboard.lo: clipboard.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -MT libguac_client_telnet_la-clipboard.lo -MD -MP -MF $(DEPDIR)/libguac_client_telnet_la-clipboard.Tpo -c -o libguac_client_telnet_la-clipboard.lo `test -f 'clipboard.c' || echo '$(srcdir)/'`clipboard.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_telnet_la-clipboard.Tpo $(DEPDIR)/libguac_client_telnet_la-clipboard.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clipboard.c' object='libguac_client_telnet_la-clipboard.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -c -o libguac_client_telnet_la-clipboard.lo `test -f 'clipboard.c' || echo '$(srcdir)/'`clipboard.c
libguac_client_telnet_la-guac_handlers.lo: guac_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -MT libguac_client_telnet_la-guac_handlers.lo -MD -MP -MF $(DEPDIR)/libguac_client_telnet_la-guac_handlers.Tpo -c -o libguac_client_telnet_la-guac_handlers.lo `test -f 'guac_handlers.c' || echo '$(srcdir)/'`guac_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_telnet_la-guac_handlers.Tpo $(DEPDIR)/libguac_client_telnet_la-guac_handlers.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='guac_handlers.c' object='libguac_client_telnet_la-guac_handlers.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -c -o libguac_client_telnet_la-guac_handlers.lo `test -f 'guac_handlers.c' || echo '$(srcdir)/'`guac_handlers.c
libguac_client_telnet_la-telnet_client.lo: telnet_client.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -MT libguac_client_telnet_la-telnet_client.lo -MD -MP -MF $(DEPDIR)/libguac_client_telnet_la-telnet_client.Tpo -c -o libguac_client_telnet_la-telnet_client.lo `test -f 'telnet_client.c' || echo '$(srcdir)/'`telnet_client.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_telnet_la-telnet_client.Tpo $(DEPDIR)/libguac_client_telnet_la-telnet_client.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telnet_client.c' object='libguac_client_telnet_la-telnet_client.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_telnet_la_CFLAGS) $(CFLAGS) -c -o libguac_client_telnet_la-telnet_client.lo `test -f 'telnet_client.c' || echo '$(srcdir)/'`telnet_client.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLTLIBRARIES install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
guacamole-server-0.9.9/src/protocols/telnet/telnet_client.c 0000664 0001751 0001751 00000037413 12612226234 021032 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "telnet_client.h"
#include "terminal.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/**
* Support levels for various telnet options, required for connection
* negotiation by telnet_init(), part of libtelnet.
*/
static const telnet_telopt_t __telnet_options[] = {
{ TELNET_TELOPT_ECHO, TELNET_WONT, TELNET_DO },
{ TELNET_TELOPT_TTYPE, TELNET_WILL, TELNET_DONT },
{ TELNET_TELOPT_COMPRESS2, TELNET_WONT, TELNET_DO },
{ TELNET_TELOPT_MSSP, TELNET_WONT, TELNET_DO },
{ TELNET_TELOPT_NAWS, TELNET_WILL, TELNET_DONT },
{ TELNET_TELOPT_NEW_ENVIRON, TELNET_WILL, TELNET_DONT },
{ -1, 0, 0 }
};
/**
* Write the entire buffer given to the specified file descriptor, retrying
* the write automatically if necessary. This function will return a value
* not equal to the buffer's size iff an error occurs which prevents all
* future writes.
*
* @param fd The file descriptor to write to.
* @param buffer The buffer to write.
* @param size The number of bytes from the buffer to write.
*/
static int __guac_telnet_write_all(int fd, const char* buffer, int size) {
int remaining = size;
while (remaining > 0) {
/* Attempt to write data */
int ret_val = write(fd, buffer, remaining);
if (ret_val <= 0)
return -1;
/* If successful, contine with what data remains (if any) */
remaining -= ret_val;
buffer += ret_val;
}
return size;
}
/**
* Searches for a line matching the stored password regex, appending the given
* buffer to the internal pattern matching buffer. The internal pattern match
* buffer is cleared whenever a newline is read. Returns TRUE if a match is found and the
* value is sent.
*/
static bool __guac_telnet_regex_search(guac_client* client, regex_t* regex, char* value, const char* buffer, int size) {
static char line_buffer[1024] = {0};
static int length = 0;
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
int i;
const char* current;
/* Ensure line buffer contains only the most recent line */
current = buffer;
for (i = 0; i < size; i++) {
/* Reset line buffer and shift input buffer for each newline */
if (*(current++) == '\n') {
length = 0;
buffer += i;
size -= i;
i = 0;
}
}
/* Truncate if necessary */
if (size + length + 1 > sizeof(line_buffer))
size = sizeof(line_buffer) - length - 1;
/* Append to line */
memcpy(&(line_buffer[length]), buffer, size);
length += size;
line_buffer[length] = '\0';
/* Send value upon match */
if (regexec(regex, line_buffer, 0, NULL, 0) == 0) {
/* Send value */
guac_terminal_send_string(client_data->term, value);
guac_terminal_send_key(client_data->term, 0xFF0D, 1);
guac_terminal_send_key(client_data->term, 0xFF0D, 0);
/* Stop searching for prompt */
return TRUE;
}
return FALSE;
}
/**
* Event handler, as defined by libtelnet. This function is passed to
* telnet_init() and will be called for every event fired by libtelnet,
* including feature enable/disable and receipt/transmission of data.
*/
static void __guac_telnet_event_handler(telnet_t* telnet, telnet_event_t* event, void* data) {
guac_client* client = (guac_client*) data;
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
switch (event->type) {
/* Terminal output received */
case TELNET_EV_DATA:
guac_terminal_write_stdout(client_data->term, event->data.buffer, event->data.size);
/* Continue search for username prompt */
if (client_data->username_regex != NULL) {
if (__guac_telnet_regex_search(client, client_data->username_regex, client_data->username,
event->data.buffer, event->data.size)) {
guac_client_log(client, GUAC_LOG_DEBUG, "Username sent");
regfree(client_data->username_regex);
free(client_data->username_regex);
client_data->username_regex = NULL;
}
}
/* Continue search for password prompt */
if (client_data->password_regex != NULL) {
if (__guac_telnet_regex_search(client, client_data->password_regex, client_data->password,
event->data.buffer, event->data.size)) {
guac_client_log(client, GUAC_LOG_DEBUG, "Password sent");
/* Do not continue searching for username once password is sent */
if (client_data->username_regex != NULL) {
regfree(client_data->username_regex);
free(client_data->username_regex);
client_data->username_regex = NULL;
}
regfree(client_data->password_regex);
free(client_data->password_regex);
client_data->password_regex = NULL;
}
}
break;
/* Data destined for remote end */
case TELNET_EV_SEND:
if (__guac_telnet_write_all(client_data->socket_fd, event->data.buffer, event->data.size)
!= event->data.size)
guac_client_stop(client);
break;
/* Remote feature enabled */
case TELNET_EV_WILL:
if (event->neg.telopt == TELNET_TELOPT_ECHO)
client_data->echo_enabled = 0; /* Disable local echo, as remote will echo */
break;
/* Remote feature disabled */
case TELNET_EV_WONT:
if (event->neg.telopt == TELNET_TELOPT_ECHO)
client_data->echo_enabled = 1; /* Enable local echo, as remote won't echo */
break;
/* Local feature enable */
case TELNET_EV_DO:
if (event->neg.telopt == TELNET_TELOPT_NAWS) {
client_data->naws_enabled = 1;
guac_telnet_send_naws(telnet, client_data->term->term_width, client_data->term->term_height);
}
break;
/* Terminal type request */
case TELNET_EV_TTYPE:
if (event->ttype.cmd == TELNET_TTYPE_SEND)
telnet_ttype_is(client_data->telnet, "linux");
break;
/* Environment request */
case TELNET_EV_ENVIRON:
/* Only send USER if entire environment was requested */
if (event->environ.size == 0)
guac_telnet_send_user(telnet, client_data->username);
break;
/* Connection warnings */
case TELNET_EV_WARNING:
guac_client_log(client, GUAC_LOG_WARNING, "%s", event->error.msg);
break;
/* Connection errors */
case TELNET_EV_ERROR:
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR,
"Telnet connection closing with error: %s", event->error.msg);
break;
/* Ignore other events */
default:
break;
}
}
/**
* Input thread, started by the main telnet client thread. This thread
* continuously reads from the terminal's STDIN and transfers all read
* data to the telnet connection.
*
* @param data The current guac_client instance.
* @return Always NULL.
*/
static void* __guac_telnet_input_thread(void* data) {
guac_client* client = (guac_client*) data;
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
char buffer[8192];
int bytes_read;
/* Write all data read */
while ((bytes_read = guac_terminal_read_stdin(client_data->term, buffer, sizeof(buffer))) > 0) {
telnet_send(client_data->telnet, buffer, bytes_read);
if (client_data->echo_enabled)
guac_terminal_write_stdout(client_data->term, buffer, bytes_read);
}
return NULL;
}
/**
* Connects to the telnet server specified within the data associated
* with the given guac_client, which will have been populated by
* guac_client_init.
*
* @return The connected telnet instance, if successful, or NULL if the
* connection fails for any reason.
*/
static telnet_t* __guac_telnet_create_session(guac_client* client) {
int retval;
int fd;
struct addrinfo* addresses;
struct addrinfo* current_address;
char connected_address[1024];
char connected_port[64];
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
struct addrinfo hints = {
.ai_family = AF_UNSPEC,
.ai_socktype = SOCK_STREAM,
.ai_protocol = IPPROTO_TCP
};
/* Get socket */
fd = socket(AF_INET, SOCK_STREAM, 0);
/* Get addresses connection */
if ((retval = getaddrinfo(client_data->hostname, client_data->port,
&hints, &addresses))) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Error parsing given address or port: %s",
gai_strerror(retval));
return NULL;
}
/* Attempt connection to each address until success */
current_address = addresses;
while (current_address != NULL) {
int retval;
/* Resolve hostname */
if ((retval = getnameinfo(current_address->ai_addr,
current_address->ai_addrlen,
connected_address, sizeof(connected_address),
connected_port, sizeof(connected_port),
NI_NUMERICHOST | NI_NUMERICSERV)))
guac_client_log(client, GUAC_LOG_DEBUG, "Unable to resolve host: %s", gai_strerror(retval));
/* Connect */
if (connect(fd, current_address->ai_addr,
current_address->ai_addrlen) == 0) {
guac_client_log(client, GUAC_LOG_DEBUG, "Successfully connected to "
"host %s, port %s", connected_address, connected_port);
/* Done if successful connect */
break;
}
/* Otherwise log information regarding bind failure */
else
guac_client_log(client, GUAC_LOG_DEBUG, "Unable to connect to "
"host %s, port %s: %s",
connected_address, connected_port, strerror(errno));
current_address = current_address->ai_next;
}
/* If unable to connect to anything, fail */
if (current_address == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Unable to connect to any addresses.");
return NULL;
}
/* Free addrinfo */
freeaddrinfo(addresses);
/* Open telnet session */
telnet_t* telnet = telnet_init(__telnet_options, __guac_telnet_event_handler, 0, client);
if (telnet == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Telnet client allocation failed.");
return NULL;
}
/* Save file descriptor */
client_data->socket_fd = fd;
return telnet;
}
/**
* Sends a 16-bit value over the given telnet connection with the byte order
* required by the telnet protocol.
*
* @param telnet The telnet connection to use.
* @param value The value to send.
*/
static void __guac_telnet_send_uint16(telnet_t* telnet, uint16_t value) {
unsigned char buffer[2];
buffer[0] = (value >> 8) & 0xFF;
buffer[1] = value & 0xFF;
telnet_send(telnet, (char*) buffer, 2);
}
/**
* Sends an 8-bit value over the given telnet connection.
*
* @param telnet The telnet connection to use.
* @param value The value to send.
*/
static void __guac_telnet_send_uint8(telnet_t* telnet, uint8_t value) {
telnet_send(telnet, (char*) (&value), 1);
}
void guac_telnet_send_naws(telnet_t* telnet, uint16_t width, uint16_t height) {
telnet_begin_sb(telnet, TELNET_TELOPT_NAWS);
__guac_telnet_send_uint16(telnet, width);
__guac_telnet_send_uint16(telnet, height);
telnet_finish_sb(telnet);
}
void guac_telnet_send_user(telnet_t* telnet, const char* username) {
/* IAC SB NEW-ENVIRON IS */
telnet_begin_sb(telnet, TELNET_TELOPT_NEW_ENVIRON);
__guac_telnet_send_uint8(telnet, TELNET_ENVIRON_IS);
/* VAR "USER" */
__guac_telnet_send_uint8(telnet, TELNET_ENVIRON_VAR);
telnet_send(telnet, "USER", 4);
/* VALUE username */
__guac_telnet_send_uint8(telnet, TELNET_ENVIRON_VALUE);
telnet_send(telnet, username, strlen(username));
/* IAC SE */
telnet_finish_sb(telnet);
}
/**
* Waits for data on the given file descriptor for up to one second. The
* return value is identical to that of select(): 0 on timeout, < 0 on
* error, and > 0 on success.
*
* @param socket_fd The file descriptor to wait for.
* @return A value greater than zero on success, zero on timeout, and
* less than zero on error.
*/
static int __guac_telnet_wait(int socket_fd) {
fd_set fds;
struct timeval timeout;
FD_ZERO(&fds);
FD_SET(socket_fd, &fds);
/* Wait for one second */
timeout.tv_sec = 1;
timeout.tv_usec = 0;
return select(socket_fd+1, &fds, NULL, NULL, &timeout);
}
void* guac_telnet_client_thread(void* data) {
guac_client* client = (guac_client*) data;
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
pthread_t input_thread;
char buffer[8192];
int wait_result;
/* Open telnet session */
client_data->telnet = __guac_telnet_create_session(client);
if (client_data->telnet == NULL) {
/* Already aborted within __guac_telnet_create_session() */
return NULL;
}
/* Logged in */
guac_client_log(client, GUAC_LOG_INFO, "Telnet connection successful.");
/* Start input thread */
if (pthread_create(&(input_thread), NULL, __guac_telnet_input_thread, (void*) client)) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to start input thread");
return NULL;
}
/* While data available, write to terminal */
while ((wait_result = __guac_telnet_wait(client_data->socket_fd)) >= 0) {
/* Resume waiting of no data available */
if (wait_result == 0)
continue;
int bytes_read = read(client_data->socket_fd, buffer, sizeof(buffer));
if (bytes_read <= 0)
break;
telnet_recv(client_data->telnet, buffer, bytes_read);
}
/* Kill client and Wait for input thread to die */
guac_client_stop(client);
pthread_join(input_thread, NULL);
guac_client_log(client, GUAC_LOG_INFO, "Telnet connection ended.");
return NULL;
}
guacamole-server-0.9.9/src/protocols/telnet/clipboard.h 0000664 0001751 0001751 00000003312 12536405625 020144 0000000 0000000 /*
* Copyright (C) 2014 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_TELNET__CLIPBOARD_H
#define GUAC_TELNET__CLIPBOARD_H
#include "config.h"
#include
#include
/**
* Handler for inbound clipboard data.
*/
int guac_telnet_clipboard_handler(guac_client* client, guac_stream* stream,
char* mimetype);
/**
* Handler for stream data related to clipboard.
*/
int guac_telnet_clipboard_blob_handler(guac_client* client, guac_stream* stream,
void* data, int length);
/**
* Handler for end-of-stream related to clipboard.
*/
int guac_telnet_clipboard_end_handler(guac_client* client, guac_stream* stream);
#endif
guacamole-server-0.9.9/src/protocols/telnet/guac_handlers.h 0000664 0001751 0001751 00000004303 12536405625 021005 0000000 0000000 /*
* Copyright (C) 2014 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_TELNET__GUAC_HANDLERS_H
#define GUAC_TELNET__GUAC_HANDLERS_H
#include "config.h"
#include
/**
* Generic handler for sending outbound messages. Required by libguac and
* called periodically by guacd when the client is ready for more graphical
* updates.
*/
int guac_telnet_client_handle_messages(guac_client* client);
/**
* Handler for key events. Required by libguac and called whenever key events
* are received.
*/
int guac_telnet_client_key_handler(guac_client* client, int keysym, int pressed);
/**
* Handler for mouse events. Required by libguac and called whenever mouse
* events are received.
*/
int guac_telnet_client_mouse_handler(guac_client* client, int x, int y, int mask);
/**
* Handler for size events. Required by libguac and called whenever the remote
* display (window) is resized.
*/
int guac_telnet_client_size_handler(guac_client* client, int width, int height);
/**
* Free handler. Required by libguac and called when the guac_client is
* disconnected and must be cleaned up.
*/
int guac_telnet_client_free_handler(guac_client* client);
#endif
guacamole-server-0.9.9/src/protocols/telnet/telnet_client.h 0000664 0001751 0001751 00000003357 12536405625 021047 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_TELNET__TELNET_CLIENT_H
#define GUAC_TELNET__TELNET_CLIENT_H
#include "config.h"
#include
#include
/**
* Main telnet client thread, handling transfer of telnet output to STDOUT.
*/
void* guac_telnet_client_thread(void* data);
/**
* Send a telnet NAWS message indicating the given terminal window dimensions
* in characters.
*/
void guac_telnet_send_naws(telnet_t* telnet, uint16_t width, uint16_t height);
/**
* Sends the given username by setting the remote USER environment variable
* using the telnet NEW-ENVIRON option.
*/
void guac_telnet_send_user(telnet_t* telnet, const char* username);
#endif
guacamole-server-0.9.9/src/protocols/telnet/client.h 0000664 0001751 0001751 00000006241 12536405625 017467 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_TELNET__CLIENT_H
#define GUAC_TELNET__CLIENT_H
#include "config.h"
#include "terminal.h"
#include
#include
#include
#include
#define GUAC_TELNET_DEFAULT_USERNAME_REGEX "[Ll]ogin:"
#define GUAC_TELNET_DEFAULT_PASSWORD_REGEX "[Pp]assword:"
/**
* Telnet-specific client data.
*/
typedef struct guac_telnet_client_data {
/**
* The hostname of the telnet server to connect to.
*/
char hostname[1024];
/**
* The port of the telnet server to connect to.
*/
char port[64];
/**
* The name of the user to login as.
*/
char username[1024];
/**
* The regular expression to use when searching for the username
* prompt. This will be NULL unless the telnet client is currently
* searching for the username prompt.
*/
regex_t* username_regex;
/**
* The password to give when authenticating.
*/
char password[1024];
/**
* The regular expression to use when searching for the password
* prompt. This will be NULL unless the telnet client is currently
* searching for the password prompt.
*/
regex_t* password_regex;
/**
* The name of the font to use for display rendering.
*/
char font_name[1024];
/**
* The size of the font to use, in points.
*/
int font_size;
/**
* The telnet client thread.
*/
pthread_t client_thread;
/**
* The file descriptor of the socket connected to the telnet server,
* or -1 if no connection has been established.
*/
int socket_fd;
/**
* Telnet connection, used by the telnet client thread.
*/
telnet_t* telnet;
/**
* Whether window size should be sent when the window is resized.
*/
int naws_enabled;
/**
* Whether all user input should be automatically echoed to the
* terminal.
*/
int echo_enabled;
/**
* The terminal which will render all output from the telnet client.
*/
guac_terminal* term;
} guac_telnet_client_data;
#endif
guacamole-server-0.9.9/src/protocols/telnet/client.c 0000664 0001751 0001751 00000016504 12626133327 017462 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "clipboard.h"
#include "guac_handlers.h"
#include "telnet_client.h"
#include "terminal.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define GUAC_TELNET_DEFAULT_FONT_NAME "monospace"
#define GUAC_TELNET_DEFAULT_FONT_SIZE 12
#define GUAC_TELNET_DEFAULT_PORT "23"
/* Client plugin arguments */
const char* GUAC_CLIENT_ARGS[] = {
"hostname",
"port",
"username",
"username-regex",
"password",
"password-regex",
"font-name",
"font-size",
"color-scheme",
NULL
};
enum __TELNET_ARGS_IDX {
/**
* The hostname to connect to. Required.
*/
IDX_HOSTNAME,
/**
* The port to connect to. Optional.
*/
IDX_PORT,
/**
* The name of the user to login as. Optional.
*/
IDX_USERNAME,
/**
* The regular expression to use when searching for the username/login prompt.
* Optional.
*/
IDX_USERNAME_REGEX,
/**
* The password to use when logging in. Optional.
*/
IDX_PASSWORD,
/**
* The regular expression to use when searching for the password prompt.
* Optional.
*/
IDX_PASSWORD_REGEX,
/**
* The name of the font to use within the terminal.
*/
IDX_FONT_NAME,
/**
* The size of the font to use within the terminal, in points.
*/
IDX_FONT_SIZE,
/**
* The name of the color scheme to use. Currently valid color schemes are:
* "black-white", "white-black", "gray-black", and "green-black", each
* following the "foreground-background" pattern. By default, this will be
* "gray-black".
*/
IDX_COLOR_SCHEME,
TELNET_ARGS_COUNT
};
/**
* Compiles the given regular expression, returning NULL if compilation fails.
*/
static regex_t* __guac_telnet_compile_regex(guac_client* client, char* pattern) {
int compile_result;
regex_t* regex = malloc(sizeof(regex_t));
/* Compile regular expression */
compile_result = regcomp(regex, pattern,REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE);
/* Notify of failure to parse/compile */
if (compile_result != 0) {
guac_client_log(client, GUAC_LOG_ERROR, "Regular expression '%s' could not be compiled.", pattern);
free(regex);
return NULL;
}
return regex;
}
int guac_client_init(guac_client* client, int argc, char** argv) {
guac_socket* socket = client->socket;
guac_telnet_client_data* client_data = malloc(sizeof(guac_telnet_client_data));
/* Init client data */
client->data = client_data;
client_data->telnet = NULL;
client_data->socket_fd = -1;
client_data->naws_enabled = 0;
client_data->echo_enabled = 1;
if (argc != TELNET_ARGS_COUNT) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Wrong number of arguments");
return -1;
}
/* Set locale and warn if not UTF-8 */
setlocale(LC_CTYPE, "");
if (strcmp(nl_langinfo(CODESET), "UTF-8") != 0)
guac_client_log(client, GUAC_LOG_INFO, "Current locale does not use UTF-8. Some characters may not render correctly.");
/* Read parameters */
strcpy(client_data->hostname, argv[IDX_HOSTNAME]);
strcpy(client_data->username, argv[IDX_USERNAME]);
strcpy(client_data->password, argv[IDX_PASSWORD]);
/* Set username regex, if needed */
if (client_data->username[0] != 0) {
/* Compile regular expression */
if (argv[IDX_USERNAME_REGEX][0] != 0)
client_data->username_regex = __guac_telnet_compile_regex(client, argv[IDX_USERNAME_REGEX]);
else
client_data->username_regex = __guac_telnet_compile_regex(client, GUAC_TELNET_DEFAULT_USERNAME_REGEX);
}
else
client_data->username_regex = NULL;
/* Set password regex, if needed */
if (client_data->password[0] != 0) {
/* Compile regular expression */
if (argv[IDX_PASSWORD_REGEX][0] != 0)
client_data->password_regex = __guac_telnet_compile_regex(client, argv[IDX_PASSWORD_REGEX]);
else
client_data->password_regex = __guac_telnet_compile_regex(client, GUAC_TELNET_DEFAULT_PASSWORD_REGEX);
}
else
client_data->password_regex = NULL;
/* Read port */
if (argv[IDX_PORT][0] != 0)
strcpy(client_data->port, argv[IDX_PORT]);
else
strcpy(client_data->port, GUAC_TELNET_DEFAULT_PORT);
/* Read font name */
if (argv[IDX_FONT_NAME][0] != 0)
strcpy(client_data->font_name, argv[IDX_FONT_NAME]);
else
strcpy(client_data->font_name, GUAC_TELNET_DEFAULT_FONT_NAME );
/* Read font size */
if (argv[IDX_FONT_SIZE][0] != 0)
client_data->font_size = atoi(argv[IDX_FONT_SIZE]);
else
client_data->font_size = GUAC_TELNET_DEFAULT_FONT_SIZE;
/* Create terminal */
client_data->term = guac_terminal_create(client,
client_data->font_name, client_data->font_size,
client->info.optimal_resolution,
client->info.optimal_width, client->info.optimal_height,
argv[IDX_COLOR_SCHEME]);
/* Fail if terminal init failed */
if (client_data->term == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Terminal initialization failed");
return -1;
}
/* Send initial name */
guac_protocol_send_name(socket, client_data->hostname);
guac_socket_flush(socket);
/* Set basic handlers */
client->handle_messages = guac_telnet_client_handle_messages;
client->key_handler = guac_telnet_client_key_handler;
client->mouse_handler = guac_telnet_client_mouse_handler;
client->size_handler = guac_telnet_client_size_handler;
client->free_handler = guac_telnet_client_free_handler;
client->clipboard_handler = guac_telnet_clipboard_handler;
/* Start client thread */
if (pthread_create(&(client_data->client_thread), NULL, guac_telnet_client_thread, (void*) client)) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to start telnet client thread");
return -1;
}
/* Success */
return 0;
}
guacamole-server-0.9.9/src/protocols/telnet/guac_handlers.c 0000664 0001751 0001751 00000011275 12626133327 021003 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "guac_handlers.h"
#include "terminal.h"
#include "telnet_client.h"
#include
#include
#include
#include
#include
#include
#include
int guac_telnet_client_handle_messages(guac_client* client) {
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
return guac_terminal_render_frame(client_data->term);
}
int guac_telnet_client_mouse_handler(guac_client* client, int x, int y, int mask) {
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
guac_terminal* term = client_data->term;
/* Send mouse if not searching for password or username */
if (client_data->password_regex == NULL && client_data->username_regex == NULL)
guac_terminal_send_mouse(term, x, y, mask);
return 0;
}
int guac_telnet_client_key_handler(guac_client* client, int keysym, int pressed) {
guac_telnet_client_data* client_data = (guac_telnet_client_data*) client->data;
guac_terminal* term = client_data->term;
/* Stop searching for password */
if (client_data->password_regex != NULL) {
guac_client_log(client, GUAC_LOG_DEBUG,
"Stopping password prompt search due to user input.");
regfree(client_data->password_regex);
free(client_data->password_regex);
client_data->password_regex = NULL;
}
/* Stop searching for username */
if (client_data->username_regex != NULL) {
guac_client_log(client, GUAC_LOG_DEBUG,
"Stopping username prompt search due to user input.");
regfree(client_data->username_regex);
free(client_data->username_regex);
client_data->username_regex = NULL;
}
/* Intercept and handle Pause / Break / Ctrl+0 as "IAC BRK" */
if (pressed && (
keysym == 0xFF13 /* Pause */
|| keysym == 0xFF6B /* Break */
|| (term->mod_ctrl && keysym == '0') /* Ctrl + 0 */
)) {
/* Send IAC BRK */
telnet_iac(client_data->telnet, TELNET_BREAK);
return 0;
}
/* Send key */
guac_terminal_send_key(term, keysym, pressed);
return 0;
}
int guac_telnet_client_size_handler(guac_client* client, int width, int height) {
/* Get terminal */
guac_telnet_client_data* guac_client_data = (guac_telnet_client_data*) client->data;
guac_terminal* terminal = guac_client_data->term;
/* Resize terminal */
guac_terminal_resize(terminal, width, height);
/* Update terminal window size if connected */
if (guac_client_data->telnet != NULL && guac_client_data->naws_enabled)
guac_telnet_send_naws(guac_client_data->telnet, terminal->term_width, terminal->term_height);
return 0;
}
int guac_telnet_client_free_handler(guac_client* client) {
guac_telnet_client_data* guac_client_data = (guac_telnet_client_data*) client->data;
/* Close telnet connection */
if (guac_client_data->socket_fd != -1)
close(guac_client_data->socket_fd);
/* Kill terminal */
guac_terminal_free(guac_client_data->term);
/* Wait for and free telnet session, if connected */
if (guac_client_data->telnet != NULL) {
pthread_join(guac_client_data->client_thread, NULL);
telnet_free(guac_client_data->telnet);
}
/* Free password regex */
if (guac_client_data->password_regex != NULL) {
regfree(guac_client_data->password_regex);
free(guac_client_data->password_regex);
}
free(client->data);
return 0;
}
guacamole-server-0.9.9/src/protocols/telnet/Makefile.am 0000664 0001751 0001751 00000003567 12626133327 020101 0000000 0000000 #
# Copyright (C) 2015 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libguac-client-telnet.la
libguac_client_telnet_la_SOURCES = \
client.c \
clipboard.c \
guac_handlers.c \
telnet_client.c
noinst_HEADERS = \
client.h \
clipboard.h \
guac_handlers.h \
telnet_client.h
libguac_client_telnet_la_CFLAGS = \
-Werror -Wall -Iinclude \
@LIBGUAC_INCLUDE@ \
@TERMINAL_INCLUDE@
libguac_client_telnet_la_LIBADD = \
@COMMON_LTLIB@ \
@LIBGUAC_LTLIB@ \
@TERMINAL_LTLIB@
libguac_client_telnet_la_LDFLAGS = \
-version-info 0:0:0 \
@PTHREAD_LIBS@ \
@TELNET_LIBS@
guacamole-server-0.9.9/src/protocols/vnc/ 0000775 0001751 0001751 00000000000 12645400336 015403 5 0000000 0000000 guacamole-server-0.9.9/src/protocols/vnc/clipboard.c 0000664 0001751 0001751 00000005366 12643542623 017444 0000000 0000000 /*
* Copyright (C) 2014 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "clipboard.h"
#include "guac_clipboard.h"
#include "guac_iconv.h"
#include
#include
#include
int guac_vnc_clipboard_handler(guac_client* client, guac_stream* stream,
char* mimetype) {
/* Clear clipboard and prepare for new data */
vnc_guac_client_data* client_data = (vnc_guac_client_data*) client->data;
guac_common_clipboard_reset(client_data->clipboard, mimetype);
/* Set handlers for clipboard stream */
stream->blob_handler = guac_vnc_clipboard_blob_handler;
stream->end_handler = guac_vnc_clipboard_end_handler;
return 0;
}
int guac_vnc_clipboard_blob_handler(guac_client* client, guac_stream* stream,
void* data, int length) {
/* Append new data */
vnc_guac_client_data* client_data = (vnc_guac_client_data*) client->data;
guac_common_clipboard_append(client_data->clipboard, (char*) data, length);
return 0;
}
int guac_vnc_clipboard_end_handler(guac_client* client, guac_stream* stream) {
vnc_guac_client_data* client_data = (vnc_guac_client_data*) client->data;
rfbClient* rfb_client = client_data->rfb_client;
char output_data[GUAC_VNC_CLIPBOARD_MAX_LENGTH];
const char* input = client_data->clipboard->buffer;
char* output = output_data;
guac_iconv_write* writer = client_data->clipboard_writer;
/* Convert clipboard contents */
guac_iconv(GUAC_READ_UTF8, &input, client_data->clipboard->length,
writer, &output, sizeof(output_data));
/* Send via VNC */
SendClientCutText(rfb_client, output_data, output - output_data);
return 0;
}
guacamole-server-0.9.9/src/protocols/vnc/Makefile.in 0000664 0001751 0001751 00000074776 12645400276 017420 0000000 0000000 # Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (C) 2015 Glyptodon LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
# Optional PulseAudio support
@ENABLE_PULSE_TRUE@am__append_1 = pulse.c
@ENABLE_PULSE_TRUE@am__append_2 = pulse.h
# Optional SFTP support
@ENABLE_COMMON_SSH_TRUE@am__append_3 = sftp.c
@ENABLE_COMMON_SSH_TRUE@am__append_4 = sftp.h
@ENABLE_COMMON_SSH_TRUE@am__append_5 = @COMMON_SSH_LTLIB@
subdir = src/protocols/vnc
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp $(am__noinst_HEADERS_DIST)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libguac_client_vnc_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__libguac_client_vnc_la_SOURCES_DIST = client.c clipboard.c \
guac_handlers.c vnc_handlers.c pulse.c sftp.c
@ENABLE_PULSE_TRUE@am__objects_1 = libguac_client_vnc_la-pulse.lo
@ENABLE_COMMON_SSH_TRUE@am__objects_2 = libguac_client_vnc_la-sftp.lo
am_libguac_client_vnc_la_OBJECTS = libguac_client_vnc_la-client.lo \
libguac_client_vnc_la-clipboard.lo \
libguac_client_vnc_la-guac_handlers.lo \
libguac_client_vnc_la-vnc_handlers.lo $(am__objects_1) \
$(am__objects_2)
libguac_client_vnc_la_OBJECTS = $(am_libguac_client_vnc_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libguac_client_vnc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libguac_client_vnc_la_CFLAGS) $(CFLAGS) \
$(libguac_client_vnc_la_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libguac_client_vnc_la_SOURCES)
DIST_SOURCES = $(am__libguac_client_vnc_la_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__noinst_HEADERS_DIST = client.h clipboard.h guac_handlers.h \
vnc_handlers.h pulse.h sftp.h
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CAIRO_LIBS = @CAIRO_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMMON_INCLUDE = @COMMON_INCLUDE@
COMMON_LTLIB = @COMMON_LTLIB@
COMMON_SSH_INCLUDE = @COMMON_SSH_INCLUDE@
COMMON_SSH_LTLIB = @COMMON_SSH_LTLIB@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CUNIT_LIBS = @CUNIT_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JPEG_LIBS = @JPEG_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBADD_DLOPEN = @LIBADD_DLOPEN@
LIBGUAC_INCLUDE = @LIBGUAC_INCLUDE@
LIBGUAC_LTLIB = @LIBGUAC_LTLIB@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PANGOCAIRO_CFLAGS = @PANGOCAIRO_CFLAGS@
PANGOCAIRO_LIBS = @PANGOCAIRO_LIBS@
PANGO_CFLAGS = @PANGO_CFLAGS@
PANGO_LIBS = @PANGO_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PNG_LIBS = @PNG_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
PULSE_LIBS = @PULSE_LIBS@
RANLIB = @RANLIB@
RDP_LIBS = @RDP_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SSH_LIBS = @SSH_LIBS@
SSL_LIBS = @SSL_LIBS@
STRIP = @STRIP@
TELNET_LIBS = @TELNET_LIBS@
TERMINAL_INCLUDE = @TERMINAL_INCLUDE@
TERMINAL_LTLIB = @TERMINAL_LTLIB@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
VNC_LIBS = @VNC_LIBS@
VORBIS_LIBS = @VORBIS_LIBS@
WEBP_LIBS = @WEBP_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
init_dir = @init_dir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libguac-client-vnc.la
libguac_client_vnc_la_SOURCES = client.c clipboard.c guac_handlers.c \
vnc_handlers.c $(am__append_1) $(am__append_3)
noinst_HEADERS = client.h clipboard.h guac_handlers.h vnc_handlers.h \
$(am__append_2) $(am__append_4)
libguac_client_vnc_la_CFLAGS = \
-Werror -Wall -pedantic -Iinclude \
@COMMON_INCLUDE@ \
@COMMON_SSH_INCLUDE@ \
@LIBGUAC_INCLUDE@
libguac_client_vnc_la_LDFLAGS = \
-version-info 0:0:0 \
@CAIRO_LIBS@ \
@PULSE_LIBS@ \
@VNC_LIBS@
libguac_client_vnc_la_LIBADD = @COMMON_LTLIB@ @LIBGUAC_LTLIB@ \
$(am__append_5)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/protocols/vnc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/protocols/vnc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libguac-client-vnc.la: $(libguac_client_vnc_la_OBJECTS) $(libguac_client_vnc_la_DEPENDENCIES) $(EXTRA_libguac_client_vnc_la_DEPENDENCIES)
$(AM_V_CCLD)$(libguac_client_vnc_la_LINK) -rpath $(libdir) $(libguac_client_vnc_la_OBJECTS) $(libguac_client_vnc_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_vnc_la-client.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_vnc_la-clipboard.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_vnc_la-guac_handlers.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_vnc_la-pulse.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_vnc_la-sftp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libguac_client_vnc_la-vnc_handlers.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
libguac_client_vnc_la-client.lo: client.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -MT libguac_client_vnc_la-client.lo -MD -MP -MF $(DEPDIR)/libguac_client_vnc_la-client.Tpo -c -o libguac_client_vnc_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_vnc_la-client.Tpo $(DEPDIR)/libguac_client_vnc_la-client.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='client.c' object='libguac_client_vnc_la-client.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -c -o libguac_client_vnc_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c
libguac_client_vnc_la-clipboard.lo: clipboard.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -MT libguac_client_vnc_la-clipboard.lo -MD -MP -MF $(DEPDIR)/libguac_client_vnc_la-clipboard.Tpo -c -o libguac_client_vnc_la-clipboard.lo `test -f 'clipboard.c' || echo '$(srcdir)/'`clipboard.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_vnc_la-clipboard.Tpo $(DEPDIR)/libguac_client_vnc_la-clipboard.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clipboard.c' object='libguac_client_vnc_la-clipboard.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -c -o libguac_client_vnc_la-clipboard.lo `test -f 'clipboard.c' || echo '$(srcdir)/'`clipboard.c
libguac_client_vnc_la-guac_handlers.lo: guac_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -MT libguac_client_vnc_la-guac_handlers.lo -MD -MP -MF $(DEPDIR)/libguac_client_vnc_la-guac_handlers.Tpo -c -o libguac_client_vnc_la-guac_handlers.lo `test -f 'guac_handlers.c' || echo '$(srcdir)/'`guac_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_vnc_la-guac_handlers.Tpo $(DEPDIR)/libguac_client_vnc_la-guac_handlers.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='guac_handlers.c' object='libguac_client_vnc_la-guac_handlers.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -c -o libguac_client_vnc_la-guac_handlers.lo `test -f 'guac_handlers.c' || echo '$(srcdir)/'`guac_handlers.c
libguac_client_vnc_la-vnc_handlers.lo: vnc_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -MT libguac_client_vnc_la-vnc_handlers.lo -MD -MP -MF $(DEPDIR)/libguac_client_vnc_la-vnc_handlers.Tpo -c -o libguac_client_vnc_la-vnc_handlers.lo `test -f 'vnc_handlers.c' || echo '$(srcdir)/'`vnc_handlers.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_vnc_la-vnc_handlers.Tpo $(DEPDIR)/libguac_client_vnc_la-vnc_handlers.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vnc_handlers.c' object='libguac_client_vnc_la-vnc_handlers.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -c -o libguac_client_vnc_la-vnc_handlers.lo `test -f 'vnc_handlers.c' || echo '$(srcdir)/'`vnc_handlers.c
libguac_client_vnc_la-pulse.lo: pulse.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -MT libguac_client_vnc_la-pulse.lo -MD -MP -MF $(DEPDIR)/libguac_client_vnc_la-pulse.Tpo -c -o libguac_client_vnc_la-pulse.lo `test -f 'pulse.c' || echo '$(srcdir)/'`pulse.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_vnc_la-pulse.Tpo $(DEPDIR)/libguac_client_vnc_la-pulse.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pulse.c' object='libguac_client_vnc_la-pulse.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -c -o libguac_client_vnc_la-pulse.lo `test -f 'pulse.c' || echo '$(srcdir)/'`pulse.c
libguac_client_vnc_la-sftp.lo: sftp.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -MT libguac_client_vnc_la-sftp.lo -MD -MP -MF $(DEPDIR)/libguac_client_vnc_la-sftp.Tpo -c -o libguac_client_vnc_la-sftp.lo `test -f 'sftp.c' || echo '$(srcdir)/'`sftp.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libguac_client_vnc_la-sftp.Tpo $(DEPDIR)/libguac_client_vnc_la-sftp.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sftp.c' object='libguac_client_vnc_la-sftp.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguac_client_vnc_la_CFLAGS) $(CFLAGS) -c -o libguac_client_vnc_la-sftp.lo `test -f 'sftp.c' || echo '$(srcdir)/'`sftp.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLTLIBRARIES install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
guacamole-server-0.9.9/src/protocols/vnc/sftp.c 0000664 0001751 0001751 00000003167 12626133327 016454 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "guac_sftp.h"
#include "sftp.h"
#include
#include
int guac_vnc_sftp_file_handler(guac_client* client, guac_stream* stream,
char* mimetype, char* filename) {
vnc_guac_client_data* client_data = (vnc_guac_client_data*) client->data;
guac_object* filesystem = client_data->sftp_filesystem;
/* Handle file upload */
return guac_common_ssh_sftp_handle_file_stream(filesystem, stream,
mimetype, filename);
}
guacamole-server-0.9.9/src/protocols/vnc/sftp.h 0000664 0001751 0001751 00000003606 12626133327 016457 0000000 0000000 /*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GUAC_VNC_SFTP_H
#define GUAC_VNC_SFTP_H
#include "config.h"
#include
#include
/**
* Handles an incoming stream from a Guacamole "file" instruction, saving the
* contents of that stream to the file having the given name.
*
* @param client
* The client receiving the uploaded file.
*
* @param stream
* The stream through which the uploaded file data will be received.
*
* @param mimetype
* The mimetype of the data being received.
*
* @param filename
* The filename of the file to write to.
*
* @return
* Zero if the incoming stream has been handled successfully, non-zero on
* failure.
*/
int guac_vnc_sftp_file_handler(guac_client* client, guac_stream* stream,
char* mimetype, char* filename);
#endif
guacamole-server-0.9.9/src/protocols/vnc/pulse.h 0000664 0001751 0001751 00000004124 12602547672 016635 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __GUAC_VNC_PULSE_H
#define __GUAC_VNC_PULSE_H
#include "config.h"
/**
* The number of bytes to request for the audio fragments received from
* PulseAudio.
*/
#define GUAC_VNC_AUDIO_FRAGMENT_SIZE 8192
/**
* The minimum number of PCM bytes to wait for before flushing an audio
* packet. The current value is 48K, which works out to be around 280ms.
*/
#define GUAC_VNC_PCM_WRITE_RATE 49152
/**
* Rate of audio to stream, in Hz.
*/
#define GUAC_VNC_AUDIO_RATE 44100
/**
* The number of channels to stream.
*/
#define GUAC_VNC_AUDIO_CHANNELS 2
/**
* The number of bits per sample.
*/
#define GUAC_VNC_AUDIO_BPS 16
/**
* Starts streaming audio from PulseAudio to the given Guacamole client.
*
* @param client The client to stream data to.
*/
void guac_pa_start_stream(guac_client* client);
/**
* Stops streaming audio from PulseAudio to the given Guacamole client.
*
* @param client The client to stream data to.
*/
void guac_pa_stop_stream(guac_client* client);
#endif
guacamole-server-0.9.9/src/protocols/vnc/clipboard.h 0000664 0001751 0001751 00000003273 12643542623 017444 0000000 0000000 /*
* Copyright (C) 2014 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_VNC_CLIPBOARD_H
#define _GUAC_VNC_CLIPBOARD_H
#include "config.h"
#include
#include
/**
* Handler for inbound clipboard data.
*/
int guac_vnc_clipboard_handler(guac_client* client, guac_stream* stream,
char* mimetype);
/**
* Handler for stream data related to clipboard.
*/
int guac_vnc_clipboard_blob_handler(guac_client* client, guac_stream* stream,
void* data, int length);
/**
* Handler for end-of-stream related to clipboard.
*/
int guac_vnc_clipboard_end_handler(guac_client* client, guac_stream* stream);
#endif
guacamole-server-0.9.9/src/protocols/vnc/guac_handlers.h 0000664 0001751 0001751 00000002764 12643542623 020310 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __GUAC_VNC_GUAC_HANDLERS_H
#define __GUAC_VNC_GUAC_HANDLERS_H
#include "config.h"
#include
int vnc_guac_client_handle_messages(guac_client* client);
int vnc_guac_client_mouse_handler(guac_client* client, int x, int y, int mask);
int vnc_guac_client_key_handler(guac_client* client, int keysym, int pressed);
int vnc_guac_client_free_handler(guac_client* client);
#endif
guacamole-server-0.9.9/src/protocols/vnc/pulse.c 0000664 0001751 0001751 00000017644 12626724073 016641 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "pulse.h"
#include
#include
#include
#include
/**
* Returns whether the given buffer contains only silence (only null bytes).
*
* @param buffer
* The audio buffer to check.
*
* @param length
* The length of the buffer to check.
*
* @return
* Non-zero if the audio buffer contains silence, zero otherwise.
*/
static int guac_pa_is_silence(const void* buffer, size_t length) {
int i;
const unsigned char* current = (const unsigned char*) buffer;
/* For each byte in buffer */
for (i = 0; i < length; i++) {
/* If current value non-zero, then not silence */
if (*(current++))
return 0;
}
/* Otherwise, the buffer contains 100% silence */
return 1;
}
static void __stream_read_callback(pa_stream* stream, size_t length,
void* data) {
guac_client* client = (guac_client*) data;
vnc_guac_client_data* client_data = (vnc_guac_client_data*) client->data;
guac_audio_stream* audio = client_data->audio;
const void* buffer;
/* Read data */
pa_stream_peek(stream, &buffer, &length);
/* Continuously write received PCM data */
if (!guac_pa_is_silence(buffer, length))
guac_audio_stream_write_pcm(audio, buffer, length);
/* Flush upon silence */
else
guac_audio_stream_flush(audio);
/* Advance buffer */
pa_stream_drop(stream);
}
static void __stream_state_callback(pa_stream* stream, void* data) {
guac_client* client = (guac_client*) data;
switch (pa_stream_get_state(stream)) {
case PA_STREAM_UNCONNECTED:
guac_client_log(client, GUAC_LOG_INFO,
"PulseAudio stream currently unconnected");
break;
case PA_STREAM_CREATING:
guac_client_log(client, GUAC_LOG_INFO, "PulseAudio stream being created...");
break;
case PA_STREAM_READY:
guac_client_log(client, GUAC_LOG_INFO, "PulseAudio stream now ready");
break;
case PA_STREAM_FAILED:
guac_client_log(client, GUAC_LOG_INFO, "PulseAudio stream connection failed");
break;
case PA_STREAM_TERMINATED:
guac_client_log(client, GUAC_LOG_INFO, "PulseAudio stream terminated");
break;
default:
guac_client_log(client, GUAC_LOG_INFO,
"Unknown PulseAudio stream state: 0x%x",
pa_stream_get_state(stream));
}
}
static void __context_get_sink_info_callback(pa_context* context,
const pa_sink_info* info, int is_last, void* data) {
guac_client* client = (guac_client*) data;
pa_stream* stream;
pa_sample_spec spec;
pa_buffer_attr attr;
/* Stop if end of list reached */
if (is_last)
return;
guac_client_log(client, GUAC_LOG_INFO, "Starting streaming from \"%s\"",
info->description);
/* Set format */
spec.format = PA_SAMPLE_S16LE;
spec.rate = GUAC_VNC_AUDIO_RATE;
spec.channels = GUAC_VNC_AUDIO_CHANNELS;
attr.maxlength = -1;
attr.fragsize = GUAC_VNC_AUDIO_FRAGMENT_SIZE;
/* Create stream */
stream = pa_stream_new(context, "Guacamole Audio", &spec, NULL);
/* Set stream callbacks */
pa_stream_set_state_callback(stream, __stream_state_callback, client);
pa_stream_set_read_callback(stream, __stream_read_callback, client);
/* Start stream */
pa_stream_connect_record(stream, info->monitor_source_name, &attr,
PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
| PA_STREAM_ADJUST_LATENCY);
}
static void __context_get_server_info_callback(pa_context* context,
const pa_server_info* info, void* data) {
guac_client* client = (guac_client*) data;
/* If no default sink, cannot continue */
if (info->default_sink_name == NULL) {
guac_client_log(client, GUAC_LOG_ERROR, "No default sink. Cannot stream audio.");
return;
}
guac_client_log(client, GUAC_LOG_INFO, "Will use default sink: \"%s\"",
info->default_sink_name);
/* Wait for default sink information */
pa_operation_unref(
pa_context_get_sink_info_by_name(context,
info->default_sink_name, __context_get_sink_info_callback,
client));
}
static void __context_state_callback(pa_context* context, void* data) {
guac_client* client = (guac_client*) data;
switch (pa_context_get_state(context)) {
case PA_CONTEXT_UNCONNECTED:
guac_client_log(client, GUAC_LOG_INFO,
"PulseAudio reports it is unconnected");
break;
case PA_CONTEXT_CONNECTING:
guac_client_log(client, GUAC_LOG_INFO, "Connecting to PulseAudio...");
break;
case PA_CONTEXT_AUTHORIZING:
guac_client_log(client, GUAC_LOG_INFO,
"Authorizing PulseAudio connection...");
break;
case PA_CONTEXT_SETTING_NAME:
guac_client_log(client, GUAC_LOG_INFO, "Sending client name...");
break;
case PA_CONTEXT_READY:
guac_client_log(client, GUAC_LOG_INFO, "PulseAudio now ready");
pa_operation_unref(pa_context_get_server_info(context,
__context_get_server_info_callback, client));
break;
case PA_CONTEXT_FAILED:
guac_client_log(client, GUAC_LOG_INFO, "PulseAudio connection failed");
break;
case PA_CONTEXT_TERMINATED:
guac_client_log(client, GUAC_LOG_INFO, "PulseAudio connection terminated");
break;
default:
guac_client_log(client, GUAC_LOG_INFO,
"Unknown PulseAudio context state: 0x%x",
pa_context_get_state(context));
}
}
void guac_pa_start_stream(guac_client* client) {
vnc_guac_client_data* client_data = (vnc_guac_client_data*) client->data;
pa_context* context;
guac_client_log(client, GUAC_LOG_INFO, "Starting audio stream");
/* Init main loop */
client_data->pa_mainloop = pa_threaded_mainloop_new();
/* Create context */
context = pa_context_new(
pa_threaded_mainloop_get_api(client_data->pa_mainloop),
"Guacamole Audio");
/* Set up context */
pa_context_set_state_callback(context, __context_state_callback, client);
pa_context_connect(context, client_data->pa_servername,
PA_CONTEXT_NOAUTOSPAWN, NULL);
/* Start loop */
pa_threaded_mainloop_start(client_data->pa_mainloop);
}
void guac_pa_stop_stream(guac_client* client) {
vnc_guac_client_data* client_data = (vnc_guac_client_data*) client->data;
/* Stop loop */
pa_threaded_mainloop_stop(client_data->pa_mainloop);
guac_client_log(client, GUAC_LOG_INFO, "Audio stream finished");
}
guacamole-server-0.9.9/src/protocols/vnc/vnc_handlers.c 0000664 0001751 0001751 00000026265 12643542623 020154 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "guac_iconv.h"
#include "guac_surface.h"
#include
#include
#include
#include
#include
#include
#include
/* Define cairo_format_stride_for_width() if missing */
#ifndef HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH
#define cairo_format_stride_for_width(format, width) (width*4)
#endif
#include
#include
#include
#include
void guac_vnc_cursor(rfbClient* client, int x, int y, int w, int h, int bpp) {
guac_client* gc = rfbClientGetClientData(client, __GUAC_CLIENT);
guac_socket* socket = gc->socket;
vnc_guac_client_data* guac_client_data = (vnc_guac_client_data*) gc->data;
const guac_layer* cursor_layer = guac_client_data->cursor;
/* Cairo image buffer */
int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, w);
unsigned char* buffer = malloc(h*stride);
unsigned char* buffer_row_current = buffer;
cairo_surface_t* surface;
/* VNC image buffer */
unsigned int fb_stride = bpp * w;
unsigned char* fb_row_current = client->rcSource;
unsigned char* fb_mask = client->rcMask;
int dx, dy;
/* Copy image data from VNC client to RGBA buffer */
for (dy = 0; dy> client->format.redShift) * 0x100 / (client->format.redMax + 1);
green = (v >> client->format.greenShift) * 0x100 / (client->format.greenMax+ 1);
blue = (v >> client->format.blueShift) * 0x100 / (client->format.blueMax + 1);
/* Output ARGB */
if (guac_client_data->swap_red_blue)
*(buffer_current++) = (alpha << 24) | (blue << 16) | (green << 8) | red;
else
*(buffer_current++) = (alpha << 24) | (red << 16) | (green << 8) | blue;
/* Next VNC pixel */
fb_current += bpp;
}
}
/* Send cursor data*/
surface = cairo_image_surface_create_for_data(buffer, CAIRO_FORMAT_ARGB32, w, h, stride);
guac_client_stream_png(gc, socket, GUAC_COMP_SRC, cursor_layer,
0, 0, surface);
/* Update cursor */
guac_protocol_send_cursor(socket, x, y, cursor_layer, 0, 0, w, h);
/* Free surface */
cairo_surface_destroy(surface);
free(buffer);
/* libvncclient does not free rcMask as it does rcSource */
free(client->rcMask);
}
void guac_vnc_update(rfbClient* client, int x, int y, int w, int h) {
guac_client* gc = rfbClientGetClientData(client, __GUAC_CLIENT);
vnc_guac_client_data* guac_client_data = (vnc_guac_client_data*) gc->data;
int dx, dy;
/* Cairo image buffer */
int stride;
unsigned char* buffer;
unsigned char* buffer_row_current;
cairo_surface_t* surface;
/* VNC framebuffer */
unsigned int bpp;
unsigned int fb_stride;
unsigned char* fb_row_current;
/* Ignore extra update if already handled by copyrect */
if (guac_client_data->copy_rect_used) {
guac_client_data->copy_rect_used = 0;
return;
}
/* Init Cairo buffer */
stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, w);
buffer = malloc(h*stride);
buffer_row_current = buffer;
bpp = client->format.bitsPerPixel/8;
fb_stride = bpp * client->width;
fb_row_current = client->frameBuffer + (y * fb_stride) + (x * bpp);
/* Copy image data from VNC client to PNG */
for (dy = y; dy> client->format.redShift) * 0x100 / (client->format.redMax + 1);
green = (v >> client->format.greenShift) * 0x100 / (client->format.greenMax+ 1);
blue = (v >> client->format.blueShift) * 0x100 / (client->format.blueMax + 1);
/* Output RGB */
if (guac_client_data->swap_red_blue)
*(buffer_current++) = (blue << 16) | (green << 8) | red;
else
*(buffer_current++) = (red << 16) | (green << 8) | blue;
fb_current += bpp;
}
}
/* For now, only use default layer */
surface = cairo_image_surface_create_for_data(buffer, CAIRO_FORMAT_RGB24, w, h, stride);
guac_common_surface_draw(guac_client_data->default_surface, x, y, surface);
/* Free surface */
cairo_surface_destroy(surface);
free(buffer);
}
void guac_vnc_copyrect(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y) {
guac_client* gc = rfbClientGetClientData(client, __GUAC_CLIENT);
vnc_guac_client_data* guac_client_data = (vnc_guac_client_data*) gc->data;
/* For now, only use default layer */
guac_common_surface_copy(guac_client_data->default_surface, src_x, src_y, w, h,
guac_client_data->default_surface, dest_x, dest_y);
((vnc_guac_client_data*) gc->data)->copy_rect_used = 1;
}
char* guac_vnc_get_password(rfbClient* client) {
guac_client* gc = rfbClientGetClientData(client, __GUAC_CLIENT);
return ((vnc_guac_client_data*) gc->data)->password;
}
void guac_vnc_set_pixel_format(rfbClient* client, int color_depth) {
switch(color_depth) {
case 8:
client->format.depth = 8;
client->format.bitsPerPixel = 8;
client->format.blueShift = 6;
client->format.redShift = 0;
client->format.greenShift = 3;
client->format.blueMax = 3;
client->format.redMax = 7;
client->format.greenMax = 7;
break;
case 16:
client->format.depth = 16;
client->format.bitsPerPixel = 16;
client->format.blueShift = 0;
client->format.redShift = 11;
client->format.greenShift = 5;
client->format.blueMax = 0x1f;
client->format.redMax = 0x1f;
client->format.greenMax = 0x3f;
break;
case 24:
case 32:
default:
client->format.depth = 24;
client->format.bitsPerPixel = 32;
client->format.blueShift = 0;
client->format.redShift = 16;
client->format.greenShift = 8;
client->format.blueMax = 0xff;
client->format.redMax = 0xff;
client->format.greenMax = 0xff;
}
}
rfbBool guac_vnc_malloc_framebuffer(rfbClient* rfb_client) {
guac_client* gc = rfbClientGetClientData(rfb_client, __GUAC_CLIENT);
vnc_guac_client_data* guac_client_data = (vnc_guac_client_data*) gc->data;
/* Resize surface */
if (guac_client_data->default_surface != NULL)
guac_common_surface_resize(guac_client_data->default_surface, rfb_client->width, rfb_client->height);
/* Use original, wrapped proc */
return guac_client_data->rfb_MallocFrameBuffer(rfb_client);
}
void guac_vnc_cut_text(rfbClient* client, const char* text, int textlen) {
guac_client* gc = rfbClientGetClientData(client, __GUAC_CLIENT);
vnc_guac_client_data* client_data = (vnc_guac_client_data*) gc->data;
char received_data[GUAC_VNC_CLIPBOARD_MAX_LENGTH];
const char* input = text;
char* output = received_data;
guac_iconv_read* reader = client_data->clipboard_reader;
/* Convert clipboard contents */
guac_iconv(reader, &input, textlen,
GUAC_WRITE_UTF8, &output, sizeof(received_data));
/* Send converted data */
guac_common_clipboard_reset(client_data->clipboard, "text/plain");
guac_common_clipboard_append(client_data->clipboard, received_data, output - received_data);
guac_common_clipboard_send(client_data->clipboard, gc);
}
void guac_vnc_client_log_info(const char* format, ...) {
char message[2048];
/* Copy log message into buffer */
va_list args;
va_start(args, format);
vsnprintf(message, sizeof(message), format, args);
va_end(args);
/* Log to syslog */
syslog(LOG_INFO, "%s", message);
}
void guac_vnc_client_log_error(const char* format, ...) {
char message[2048];
/* Copy log message into buffer */
va_list args;
va_start(args, format);
vsnprintf(message, sizeof(message), format, args);
va_end(args);
/* Log to syslog */
syslog(LOG_ERR, "%s", message);
}
guacamole-server-0.9.9/src/protocols/vnc/vnc_handlers.h 0000664 0001751 0001751 00000003504 12643542623 020150 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __GUAC_VNC_VNC_HANDLERS_H
#define __GUAC_VNC_VNC_HANDLERS_H
#include "config.h"
#include
void guac_vnc_cursor(rfbClient* client, int x, int y, int w, int h, int bpp);
void guac_vnc_update(rfbClient* client, int x, int y, int w, int h);
void guac_vnc_copyrect(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y);
char* guac_vnc_get_password(rfbClient* client);
rfbBool guac_vnc_malloc_framebuffer(rfbClient* rfb_client);
void guac_vnc_cut_text(rfbClient* client, const char* text, int textlen);
void guac_vnc_client_log_info(const char* format, ...);
void guac_vnc_client_log_error(const char* format, ...);
void guac_vnc_set_pixel_format(rfbClient* client, int color_depth);
#endif
guacamole-server-0.9.9/src/protocols/vnc/client.h 0000664 0001751 0001751 00000012171 12643542623 016760 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __GUAC_VNC_CLIENT_H
#define __GUAC_VNC_CLIENT_H
#include "config.h"
#include "guac_clipboard.h"
#include "guac_surface.h"
#include "guac_iconv.h"
#include
#include
#include
#ifdef ENABLE_PULSE
#include
#endif
#ifdef ENABLE_COMMON_SSH
#include "guac_sftp.h"
#include "guac_ssh.h"
#include "guac_ssh_user.h"
#endif
/**
* The maximum duration of a frame in milliseconds.
*/
#define GUAC_VNC_FRAME_DURATION 40
/**
* The amount of time to allow per message read within a frame, in
* milliseconds. If the server is silent for at least this amount of time, the
* frame will be considered finished.
*/
#define GUAC_VNC_FRAME_TIMEOUT 10
/**
* The number of milliseconds to wait between connection attempts.
*/
#define GUAC_VNC_CONNECT_INTERVAL 1000
/**
* The maximum number of bytes to allow within the clipboard.
*/
#define GUAC_VNC_CLIPBOARD_MAX_LENGTH 262144
extern char* __GUAC_CLIENT;
/**
* VNC-specific client data.
*/
typedef struct vnc_guac_client_data {
/**
* The underlying VNC client.
*/
rfbClient* rfb_client;
/**
* The original framebuffer malloc procedure provided by the initialized
* rfbClient.
*/
MallocFrameBufferProc rfb_MallocFrameBuffer;
/**
* Whether copyrect was used to produce the latest update received
* by the VNC server.
*/
int copy_rect_used;
/**
* The hostname of the VNC server (or repeater) to connect to.
*/
char* hostname;
/**
* The port of the VNC server (or repeater) to connect to.
*/
int port;
/**
* The password given in the arguments.
*/
char* password;
/**
* Space-separated list of encodings to use within the VNC session.
*/
char* encodings;
/**
* Whether the red and blue components of each color should be swapped.
* This is mainly used for VNC servers that do not properly handle
* colors.
*/
int swap_red_blue;
/**
* The color depth to request, in bits.
*/
int color_depth;
/**
* Whether this connection is read-only, and user input should be dropped.
*/
int read_only;
/**
* The VNC host to connect to, if using a repeater.
*/
char* dest_host;
/**
* The VNC port to connect to, if using a repeater.
*/
int dest_port;
#ifdef ENABLE_VNC_LISTEN
/**
* Whether not actually connecting to a VNC server, but rather listening
* for a connection from the VNC server (reverse connection).
*/
int reverse_connect;
/**
* The maximum amount of time to wait when listening for connections, in
* milliseconds.
*/
int listen_timeout;
#endif
/**
* Whether the cursor should be rendered on the server (remote) or on the
* client (local).
*/
int remote_cursor;
/**
* The layer holding the cursor image.
*/
guac_layer* cursor;
/**
* Whether audio is enabled.
*/
int audio_enabled;
/**
* Audio output, if any.
*/
guac_audio_stream* audio;
#ifdef ENABLE_PULSE
/**
* The name of the PulseAudio server to connect to.
*/
char* pa_servername;
/**
* PulseAudio event loop.
*/
pa_threaded_mainloop* pa_mainloop;
#endif
/**
* Internal clipboard.
*/
guac_common_clipboard* clipboard;
/**
* Default surface.
*/
guac_common_surface* default_surface;
#ifdef ENABLE_COMMON_SSH
/**
* The user and credentials used to authenticate for SFTP.
*/
guac_common_ssh_user* sftp_user;
/**
* The SSH session used for SFTP.
*/
guac_common_ssh_session* sftp_session;
/**
* The exposed filesystem object, implemented with SFTP.
*/
guac_object* sftp_filesystem;
#endif
/**
* Clipboard encoding-specific reader.
*/
guac_iconv_read* clipboard_reader;
/**
* Clipboard encoding-specific writer.
*/
guac_iconv_write* clipboard_writer;
} vnc_guac_client_data;
#endif
guacamole-server-0.9.9/src/protocols/vnc/client.c 0000664 0001751 0001751 00000042013 12643542623 016751 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "clipboard.h"
#include "guac_clipboard.h"
#include "guac_dot_cursor.h"
#include "guac_handlers.h"
#include "guac_pointer_cursor.h"
#include "vnc_handlers.h"
#ifdef ENABLE_PULSE
#include "pulse.h"
#endif
#ifdef ENABLE_COMMON_SSH
#include "guac_sftp.h"
#include "guac_ssh.h"
#include "sftp.h"
#endif
#include
#include
#include
#include
#include
#include
#include
#include
/* Client plugin arguments */
const char* GUAC_CLIENT_ARGS[] = {
"hostname",
"port",
"read-only",
"encodings",
"password",
"swap-red-blue",
"color-depth",
"cursor",
"autoretry",
"clipboard-encoding",
#ifdef ENABLE_VNC_REPEATER
"dest-host",
"dest-port",
#endif
#ifdef ENABLE_PULSE
"enable-audio",
"audio-servername",
#endif
#ifdef ENABLE_VNC_LISTEN
"reverse-connect",
"listen-timeout",
#endif
#ifdef ENABLE_COMMON_SSH
"enable-sftp",
"sftp-hostname",
"sftp-port",
"sftp-username",
"sftp-password",
"sftp-private-key",
"sftp-passphrase",
"sftp-directory",
#endif
NULL
};
enum VNC_ARGS_IDX {
IDX_HOSTNAME,
IDX_PORT,
IDX_READ_ONLY,
IDX_ENCODINGS,
IDX_PASSWORD,
IDX_SWAP_RED_BLUE,
IDX_COLOR_DEPTH,
IDX_CURSOR,
IDX_AUTORETRY,
IDX_CLIPBOARD_ENCODING,
#ifdef ENABLE_VNC_REPEATER
IDX_DEST_HOST,
IDX_DEST_PORT,
#endif
#ifdef ENABLE_PULSE
IDX_ENABLE_AUDIO,
IDX_AUDIO_SERVERNAME,
#endif
#ifdef ENABLE_VNC_LISTEN
IDX_REVERSE_CONNECT,
IDX_LISTEN_TIMEOUT,
#endif
#ifdef ENABLE_COMMON_SSH
IDX_ENABLE_SFTP,
IDX_SFTP_HOSTNAME,
IDX_SFTP_PORT,
IDX_SFTP_USERNAME,
IDX_SFTP_PASSWORD,
IDX_SFTP_PRIVATE_KEY,
IDX_SFTP_PASSPHRASE,
IDX_SFTP_DIRECTORY,
#endif
VNC_ARGS_COUNT
};
char* __GUAC_CLIENT = "GUAC_CLIENT";
/**
* Allocates a new rfbClient instance given the parameters stored within the
* client, returning NULL on failure.
*/
static rfbClient* __guac_vnc_get_client(guac_client* client) {
rfbClient* rfb_client = rfbGetClient(8, 3, 4); /* 32-bpp client */
vnc_guac_client_data* guac_client_data =
(vnc_guac_client_data*) client->data;
/* Store Guac client in rfb client */
rfbClientSetClientData(rfb_client, __GUAC_CLIENT, client);
/* Framebuffer update handler */
rfb_client->GotFrameBufferUpdate = guac_vnc_update;
rfb_client->GotCopyRect = guac_vnc_copyrect;
/* Do not handle clipboard and local cursor if read-only */
if (guac_client_data->read_only == 0) {
/* Clipboard */
rfb_client->GotXCutText = guac_vnc_cut_text;
/* Set remote cursor */
if (guac_client_data->remote_cursor)
rfb_client->appData.useRemoteCursor = FALSE;
else {
/* Enable client-side cursor */
rfb_client->appData.useRemoteCursor = TRUE;
rfb_client->GotCursorShape = guac_vnc_cursor;
}
}
/* Password */
rfb_client->GetPassword = guac_vnc_get_password;
/* Depth */
guac_vnc_set_pixel_format(rfb_client, guac_client_data->color_depth);
/* Hook into allocation so we can handle resize. */
guac_client_data->rfb_MallocFrameBuffer = rfb_client->MallocFrameBuffer;
rfb_client->MallocFrameBuffer = guac_vnc_malloc_framebuffer;
rfb_client->canHandleNewFBSize = 1;
/* Set hostname and port */
rfb_client->serverHost = strdup(guac_client_data->hostname);
rfb_client->serverPort = guac_client_data->port;
#ifdef ENABLE_VNC_REPEATER
/* Set repeater parameters if specified */
if (guac_client_data->dest_host) {
rfb_client->destHost = strdup(guac_client_data->dest_host);
rfb_client->destPort = guac_client_data->dest_port;
}
#endif
#ifdef ENABLE_VNC_LISTEN
/* If reverse connection enabled, start listening */
if (guac_client_data->reverse_connect) {
guac_client_log(client, GUAC_LOG_INFO, "Listening for connections on port %i",
guac_client_data->port);
/* Listen for connection from server */
rfb_client->listenPort = guac_client_data->port;
if (listenForIncomingConnectionsNoFork(rfb_client,
guac_client_data->listen_timeout*1000) <= 0)
return NULL;
}
#endif
/* Set encodings if provided */
if (guac_client_data->encodings)
rfb_client->appData.encodingsString =
strdup(guac_client_data->encodings);
/* Connect */
if (rfbInitClient(rfb_client, NULL, NULL))
return rfb_client;
/* If connection fails, return NULL */
return NULL;
}
/**
* Sets the encoding of clipboard data exchanged with the VNC server to the
* encoding having the given name. If the name is left blank, or is invalid,
* the standard ISO8859-1 encoding will be used.
*
* @param client
* The client to set the clipboard encoding of.
*
* @param name
* The name of the encoding to use for all clipboard data. Valid values
* are: "ISO8859-1", "UTF-8", "UTF-16", "CP1252", or "".
*
* @return
* Zero if the chosen encoding is standard for VNC, or non-zero if the VNC
* standard is being violated.
*/
static int guac_vnc_set_clipboard_encoding(guac_client* client,
const char* name) {
vnc_guac_client_data* guac_client_data =
(vnc_guac_client_data*) client->data;
/* Use ISO8859-1 if explicitly selected or blank */
if (name[0] == '\0' || strcmp(name, "ISO8859-1") == 0) {
guac_client_data->clipboard_reader = GUAC_READ_ISO8859_1;
guac_client_data->clipboard_writer = GUAC_WRITE_ISO8859_1;
return 0;
}
/* UTF-8 */
if (strcmp(name, "UTF-8") == 0) {
guac_client_data->clipboard_reader = GUAC_READ_UTF8;
guac_client_data->clipboard_writer = GUAC_WRITE_UTF8;
return 1;
}
/* UTF-16 */
if (strcmp(name, "UTF-16") == 0) {
guac_client_data->clipboard_reader = GUAC_READ_UTF16;
guac_client_data->clipboard_writer = GUAC_WRITE_UTF16;
return 1;
}
/* CP1252 */
if (strcmp(name, "CP1252") == 0) {
guac_client_data->clipboard_reader = GUAC_READ_CP1252;
guac_client_data->clipboard_writer = GUAC_WRITE_CP1252;
return 1;
}
/* If encoding unrecognized, warn and default to ISO8859-1 */
guac_client_log(client, GUAC_LOG_WARNING,
"Encoding '%s' is invalid. Defaulting to ISO8859-1.", name);
guac_client_data->clipboard_reader = GUAC_READ_ISO8859_1;
guac_client_data->clipboard_writer = GUAC_WRITE_ISO8859_1;
return 0;
}
int guac_client_init(guac_client* client, int argc, char** argv) {
rfbClient* rfb_client;
vnc_guac_client_data* guac_client_data;
int retries_remaining;
/* Set up libvncclient logging */
rfbClientLog = guac_vnc_client_log_info;
rfbClientErr = guac_vnc_client_log_error;
/*** PARSE ARGUMENTS ***/
if (argc != VNC_ARGS_COUNT) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Wrong argument count received.");
return 1;
}
/* Alloc client data */
guac_client_data = malloc(sizeof(vnc_guac_client_data));
client->data = guac_client_data;
guac_client_data->hostname = strdup(argv[IDX_HOSTNAME]);
guac_client_data->port = atoi(argv[IDX_PORT]);
guac_client_data->password = strdup(argv[IDX_PASSWORD]); /* NOTE: freed by libvncclient */
guac_client_data->default_surface = NULL;
/* Set flags */
guac_client_data->remote_cursor = (strcmp(argv[IDX_CURSOR], "remote") == 0);
guac_client_data->swap_red_blue = (strcmp(argv[IDX_SWAP_RED_BLUE], "true") == 0);
guac_client_data->read_only = (strcmp(argv[IDX_READ_ONLY], "true") == 0);
/* Parse color depth */
guac_client_data->color_depth = atoi(argv[IDX_COLOR_DEPTH]);
#ifdef ENABLE_VNC_REPEATER
/* Set repeater parameters if specified */
if (argv[IDX_DEST_HOST][0] != '\0')
guac_client_data->dest_host = strdup(argv[IDX_DEST_HOST]);
else
guac_client_data->dest_host = NULL;
if (argv[IDX_DEST_PORT][0] != '\0')
guac_client_data->dest_port = atoi(argv[IDX_DEST_PORT]);
#endif
/* Set encodings if specified */
if (argv[IDX_ENCODINGS][0] != '\0')
guac_client_data->encodings = strdup(argv[IDX_ENCODINGS]);
else
guac_client_data->encodings = NULL;
/* Parse autoretry */
if (argv[IDX_AUTORETRY][0] != '\0')
retries_remaining = atoi(argv[IDX_AUTORETRY]);
else
retries_remaining = 0;
#ifdef ENABLE_VNC_LISTEN
/* Set reverse-connection flag */
guac_client_data->reverse_connect =
(strcmp(argv[IDX_REVERSE_CONNECT], "true") == 0);
/* Parse listen timeout */
if (argv[IDX_LISTEN_TIMEOUT][0] != '\0')
guac_client_data->listen_timeout = atoi(argv[IDX_LISTEN_TIMEOUT]);
else
guac_client_data->listen_timeout = 5000;
#endif
/* Init clipboard */
guac_client_data->clipboard = guac_common_clipboard_alloc(GUAC_VNC_CLIPBOARD_MAX_LENGTH);
/* Configure clipboard encoding */
if (guac_vnc_set_clipboard_encoding(client, argv[IDX_CLIPBOARD_ENCODING]))
guac_client_log(client, GUAC_LOG_INFO,
"Using non-standard VNC clipboard encoding: '%s'.",
argv[IDX_CLIPBOARD_ENCODING]);
/* Ensure connection is kept alive during lengthy connects */
guac_socket_require_keep_alive(client->socket);
/* Attempt connection */
rfb_client = __guac_vnc_get_client(client);
/* If unsuccessful, retry as many times as specified */
while (!rfb_client && retries_remaining > 0) {
struct timespec guac_vnc_connect_interval = {
.tv_sec = GUAC_VNC_CONNECT_INTERVAL/1000,
.tv_nsec = (GUAC_VNC_CONNECT_INTERVAL%1000)*1000000
};
guac_client_log(client, GUAC_LOG_INFO,
"Connect failed. Waiting %ims before retrying...",
GUAC_VNC_CONNECT_INTERVAL);
/* Wait for given interval then retry */
nanosleep(&guac_vnc_connect_interval, NULL);
rfb_client = __guac_vnc_get_client(client);
retries_remaining--;
}
/* If the final connect attempt fails, return error */
if (!rfb_client) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Unable to connect to VNC server.");
return 1;
}
#ifdef ENABLE_PULSE
guac_client_data->audio_enabled =
(strcmp(argv[IDX_ENABLE_AUDIO], "true") == 0);
/* If an encoding is available, load an audio stream */
if (guac_client_data->audio_enabled) {
guac_client_data->audio = guac_audio_stream_alloc(client, NULL,
GUAC_VNC_AUDIO_RATE,
GUAC_VNC_AUDIO_CHANNELS,
GUAC_VNC_AUDIO_BPS);
/* Load servername if specified */
if (argv[IDX_AUDIO_SERVERNAME][0] != '\0')
guac_client_data->pa_servername =
strdup(argv[IDX_AUDIO_SERVERNAME]);
else
guac_client_data->pa_servername = NULL;
/* If successful, init audio system */
if (guac_client_data->audio != NULL) {
guac_client_log(client, GUAC_LOG_INFO,
"Audio will be encoded as %s",
guac_client_data->audio->encoder->mimetype);
/* Require threadsafe sockets if audio enabled */
guac_socket_require_threadsafe(client->socket);
/* Start audio stream */
guac_pa_start_stream(client);
}
/* Otherwise, audio loading failed */
else
guac_client_log(client, GUAC_LOG_INFO,
"No available audio encoding. Sound disabled.");
} /* end if audio enabled */
#endif
#ifdef ENABLE_COMMON_SSH
guac_common_ssh_init(client);
/* Connect via SSH if SFTP is enabled */
if (strcmp(argv[IDX_ENABLE_SFTP], "true") == 0) {
guac_client_log(client, GUAC_LOG_DEBUG,
"Connecting via SSH for SFTP filesystem access.");
guac_client_data->sftp_user =
guac_common_ssh_create_user(argv[IDX_SFTP_USERNAME]);
/* Import private key, if given */
if (argv[IDX_SFTP_PRIVATE_KEY][0] != '\0') {
guac_client_log(client, GUAC_LOG_DEBUG,
"Authenticating with private key.");
/* Abort if private key cannot be read */
if (guac_common_ssh_user_import_key(guac_client_data->sftp_user,
argv[IDX_SFTP_PRIVATE_KEY],
argv[IDX_SFTP_PASSPHRASE])) {
guac_common_ssh_destroy_user(guac_client_data->sftp_user);
return 1;
}
}
/* Otherwise, use specified password */
else {
guac_client_log(client, GUAC_LOG_DEBUG,
"Authenticating with password.");
guac_common_ssh_user_set_password(guac_client_data->sftp_user,
argv[IDX_SFTP_PASSWORD]);
}
/* Parse hostname - use VNC hostname by default */
const char* sftp_hostname = argv[IDX_SFTP_HOSTNAME];
if (sftp_hostname[0] == '\0')
sftp_hostname = guac_client_data->hostname;
/* Parse port, defaulting to standard SSH port */
const char* sftp_port = argv[IDX_SFTP_PORT];
if (sftp_port[0] == '\0')
sftp_port = "22";
/* Attempt SSH connection */
guac_client_data->sftp_session =
guac_common_ssh_create_session(client, sftp_hostname, sftp_port,
guac_client_data->sftp_user);
/* Fail if SSH connection does not succeed */
if (guac_client_data->sftp_session == NULL) {
/* Already aborted within guac_common_ssh_create_session() */
guac_common_ssh_destroy_user(guac_client_data->sftp_user);
return 1;
}
/* Load and expose filesystem */
guac_client_data->sftp_filesystem =
guac_common_ssh_create_sftp_filesystem(
guac_client_data->sftp_session, "/");
/* Abort if SFTP connection fails */
if (guac_client_data->sftp_filesystem == NULL) {
guac_common_ssh_destroy_session(guac_client_data->sftp_session);
guac_common_ssh_destroy_user(guac_client_data->sftp_user);
return 1;
}
/* Configure destination for basic uploads, if specified */
if (argv[IDX_SFTP_DIRECTORY][0] != '\0')
guac_common_ssh_sftp_set_upload_path(
guac_client_data->sftp_filesystem,
argv[IDX_SFTP_DIRECTORY]);
/* Set file handler for basic uploads */
client->file_handler = guac_vnc_sftp_file_handler;
guac_client_log(client, GUAC_LOG_DEBUG,
"SFTP connection succeeded.");
}
#endif
/* Set remaining client data */
guac_client_data->rfb_client = rfb_client;
guac_client_data->copy_rect_used = 0;
guac_client_data->cursor = guac_client_alloc_buffer(client);
/* Set handlers */
client->handle_messages = vnc_guac_client_handle_messages;
client->free_handler = vnc_guac_client_free_handler;
/* If not read-only, set input handlers and pointer */
if (guac_client_data->read_only == 0) {
/* Only handle mouse/keyboard/clipboard if not read-only */
client->mouse_handler = vnc_guac_client_mouse_handler;
client->key_handler = vnc_guac_client_key_handler;
client->clipboard_handler = guac_vnc_clipboard_handler;
/* If not read-only but cursor is remote, set a dot cursor */
if (guac_client_data->remote_cursor)
guac_common_set_dot_cursor(client);
/* Otherwise, set pointer until explicitly requested otherwise */
else
guac_common_set_pointer_cursor(client);
}
/* Send name */
guac_protocol_send_name(client->socket, rfb_client->desktopName);
/* Create default surface */
guac_client_data->default_surface = guac_common_surface_alloc(client,
client->socket, GUAC_DEFAULT_LAYER,
rfb_client->width, rfb_client->height);
return 0;
}
guacamole-server-0.9.9/src/protocols/vnc/guac_handlers.c 0000664 0001751 0001751 00000013570 12643542623 020300 0000000 0000000 /*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "guac_clipboard.h"
#include "guac_surface.h"
#include
#include
#include
#include
#ifdef ENABLE_COMMON_SSH
#include
#include