Fix includes, renamed time.h to timestamp.h

This commit is contained in:
Michael Jumper 2012-09-05 00:47:21 -07:00
parent 63e39befef
commit 9c53b85393
8 changed files with 74 additions and 72 deletions

View File

@ -43,8 +43,9 @@
#include "instruction.h" #include "instruction.h"
#include "layer.h" #include "layer.h"
#include "resource.h"
#include "socket.h" #include "socket.h"
#include "time.h" #include "timestamp.h"
/** /**
* Provides functions and structures required for defining (and handling) a proxy client. * Provides functions and structures required for defining (and handling) a proxy client.
@ -476,6 +477,61 @@ void vguac_client_log_error(guac_client* client, const char* format, va_list ap)
*/ */
void guac_client_stop(guac_client* client); void guac_client_stop(guac_client* client);
/**
* Allocates a new buffer (invisible layer). An arbitrary index is
* automatically assigned if no existing buffer is available for use.
*
* @param client The proxy client to allocate the buffer for.
* @return The next available buffer, or a newly allocated buffer.
*/
guac_layer* guac_client_alloc_buffer(guac_client* client);
/**
* Allocates a new layer. An arbitrary index is automatically assigned
* if no existing layer is available for use.
*
* @param client The proxy client to allocate the layer buffer for.
* @return The next available layer, or a newly allocated layer.
*/
guac_layer* guac_client_alloc_layer(guac_client* client);
/**
* Returns the given buffer to the pool of available buffers, such that it
* can be reused by any subsequent call to guac_client_allow_buffer().
*
* @param client The proxy client to return the buffer to.
* @param layer The buffer to return to the pool of available buffers.
*/
void guac_client_free_buffer(guac_client* client, guac_layer* layer);
/**
* Returns the given layer to the pool of available layers, such that it
* can be reused by any subsequent call to guac_client_allow_layer().
*
* @param client The proxy client to return the layer to.
* @param layer The buffer to return to the pool of available layer.
*/
void guac_client_free_layer(guac_client* client, guac_layer* layer);
/**
* Allocates a new resource. An arbitrary index is automatically assigned
* if no existing resource index is available for use.
*
* @param client The proxy client to allocate the resource for.
* @return The next available resource, or a newly allocated resource.
*/
guac_resource* guac_client_alloc_resource(guac_client* client);
/**
* Frees an existing resource, re-adding it to the client's resource
* pool, such that it can be reused by a subsequent call to
* guac_client_alloc_resource().
*
* @param client The proxy client to free the resource for.
* @oaran resource The resource to return to the resource pool.
*/
void guac_client_free_resource(guac_client* client, guac_resource* resource);
/** /**
* The default Guacamole client layer, layer 0. * The default Guacamole client layer, layer 0.
*/ */

View File

@ -38,8 +38,6 @@
#ifndef _GUAC_LAYER_H #ifndef _GUAC_LAYER_H
#define _GUAC_LAYER_H #define _GUAC_LAYER_H
#include "client.h"
/** /**
* Provides functions and structures required for allocating and using layers. * Provides functions and structures required for allocating and using layers.
* *
@ -78,41 +76,5 @@ struct guac_layer {
}; };
/**
* Allocates a new buffer (invisible layer). An arbitrary index is
* automatically assigned if no existing buffer is available for use.
*
* @param client The proxy client to allocate the buffer for.
* @return The next available buffer, or a newly allocated buffer.
*/
guac_layer* guac_client_alloc_buffer(guac_client* client);
/**
* Allocates a new layer. An arbitrary index is automatically assigned
* if no existing layer is available for use.
*
* @param client The proxy client to allocate the layer buffer for.
* @return The next available layer, or a newly allocated layer.
*/
guac_layer* guac_client_alloc_layer(guac_client* client);
/**
* Returns the given buffer to the pool of available buffers, such that it
* can be reused by any subsequent call to guac_client_allow_buffer().
*
* @param client The proxy client to return the buffer to.
* @param layer The buffer to return to the pool of available buffers.
*/
void guac_client_free_buffer(guac_client* client, guac_layer* layer);
/**
* Returns the given layer to the pool of available layers, such that it
* can be reused by any subsequent call to guac_client_allow_layer().
*
* @param client The proxy client to return the layer to.
* @param layer The buffer to return to the pool of available layer.
*/
void guac_client_free_layer(guac_client* client, guac_layer* layer);
#endif #endif

View File

@ -43,7 +43,7 @@
#include "layer.h" #include "layer.h"
#include "resource.h" #include "resource.h"
#include "socket.h" #include "socket.h"
#include "time.h" #include "timestamp.h"
/** /**
* Provides functions and structures required for communicating using the * Provides functions and structures required for communicating using the

View File

@ -39,8 +39,6 @@
#ifndef _GUAC_RESOURCE_H #ifndef _GUAC_RESOURCE_H
#define _GUAC_RESOURCE_H #define _GUAC_RESOURCE_H
#include "client.h"
/** /**
* Provides functions and structures required for handling resources. * Provides functions and structures required for handling resources.
* *
@ -88,23 +86,4 @@ typedef int guac_resource_accept_handler(guac_resource* resource, const char* mi
*/ */
typedef int guac_resource_reject_handler(guac_resource* resource); typedef int guac_resource_reject_handler(guac_resource* resource);
/**
* Allocates a new resource. An arbitrary index is automatically assigned
* if no existing resource index is available for use.
*
* @param client The proxy client to allocate the resource for.
* @return The next available resource, or a newly allocated resource.
*/
guac_resource* guac_client_alloc_resource(guac_client* client);
/**
* Frees an existing resource, re-adding it to the client's resource
* pool, such that it can be reused by a subsequent call to
* guac_client_alloc_resource().
*
* @param client The proxy client to free the resource for.
* @oaran resource The resource to return to the resource pool.
*/
void guac_client_free_resource(guac_client* client, guac_resource* resource);
#endif #endif

View File

@ -43,7 +43,7 @@
/** /**
* Provides functions and structures for creating timestamps. * Provides functions and structures for creating timestamps.
* *
* @file time.h * @file timestamp.h
*/ */
/** /**

View File

@ -48,7 +48,7 @@ libguacinc_HEADERS = \
../include/protocol.h \ ../include/protocol.h \
../include/resource.h \ ../include/resource.h \
../include/socket.h \ ../include/socket.h \
../include/time.h ../include/timestamp.h
noinst_HEADERS = \ noinst_HEADERS = \
../include/client-handlers.h \ ../include/client-handlers.h \

View File

@ -35,16 +35,19 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "socket.h"
#include "protocol.h"
#include "client.h" #include "client.h"
#include "client-handlers.h" #include "client-handlers.h"
#include "error.h" #include "error.h"
#include "layer.h"
#include "plugin.h"
#include "protocol.h"
#include "socket.h"
#include "time.h"
#define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MAX(a, b) (((a) > (b)) ? (a) : (b))
@ -263,7 +266,7 @@ guac_client* guac_client_alloc() {
memset(client, 0, sizeof(guac_client)); memset(client, 0, sizeof(guac_client));
client->last_received_timestamp = client->last_received_timestamp =
client->last_sent_timestamp = guac_protocol_get_timestamp(); client->last_sent_timestamp = guac_timestamp_current();
client->state = GUAC_CLIENT_RUNNING; client->state = GUAC_CLIENT_RUNNING;

View File

@ -66,10 +66,12 @@
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#include "socket.h"
#include "protocol.h"
#include "error.h" #include "error.h"
#include "instruction.h"
#include "layer.h"
#include "palette.h" #include "palette.h"
#include "protocol.h"
#include "socket.h"
#include "unicode.h" #include "unicode.h"
/* Output formatting functions */ /* Output formatting functions */
@ -600,7 +602,7 @@ guac_instruction* guac_protocol_expect_instruction(guac_socket* socket, int usec
guac_instruction* instruction; guac_instruction* instruction;
/* Wait for data until timeout */ /* Wait for data until timeout */
if (guac_protocol_instructions_waiting(socket, usec_timeout) <= 0) if (guac_instruction_waiting(socket, usec_timeout) <= 0)
return NULL; return NULL;
/* Read available instruction */ /* Read available instruction */