GUAC-1172: Remove use of stdbool.h and bool from guac_json - FreeRDP is not compatible with use of the standard bool.
This commit is contained in:
parent
8a36358e94
commit
4d7634da9e
@ -48,10 +48,10 @@ void guac_common_json_flush(guac_client* client, guac_stream* stream,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool guac_common_json_write(guac_client* client, guac_stream* stream,
|
int guac_common_json_write(guac_client* client, guac_stream* stream,
|
||||||
guac_common_json_state* json_state, const char* buffer, int length) {
|
guac_common_json_state* json_state, const char* buffer, int length) {
|
||||||
|
|
||||||
bool blob_written = false;
|
int blob_written = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Append to and flush the JSON buffer as necessary to write the given
|
* Append to and flush the JSON buffer as necessary to write the given
|
||||||
@ -67,7 +67,7 @@ bool guac_common_json_write(guac_client* client, guac_stream* stream,
|
|||||||
/* Flush if more room is needed */
|
/* Flush if more room is needed */
|
||||||
if (json_state->size + blob_length > sizeof(json_state->buffer)) {
|
if (json_state->size + blob_length > sizeof(json_state->buffer)) {
|
||||||
guac_common_json_flush(client, stream, json_state);
|
guac_common_json_flush(client, stream, json_state);
|
||||||
blob_written = true;
|
blob_written = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Append data to JSON buffer */
|
/* Append data to JSON buffer */
|
||||||
@ -86,11 +86,11 @@ bool guac_common_json_write(guac_client* client, guac_stream* stream,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool guac_common_json_write_string(guac_client* client,
|
int guac_common_json_write_string(guac_client* client,
|
||||||
guac_stream* stream, guac_common_json_state* json_state,
|
guac_stream* stream, guac_common_json_state* json_state,
|
||||||
const char* str) {
|
const char* str) {
|
||||||
|
|
||||||
bool blob_written = false;
|
int blob_written = 0;
|
||||||
|
|
||||||
/* Write starting quote */
|
/* Write starting quote */
|
||||||
blob_written |= guac_common_json_write(client, stream,
|
blob_written |= guac_common_json_write(client, stream,
|
||||||
@ -132,11 +132,11 @@ bool guac_common_json_write_string(guac_client* client,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool guac_common_json_write_property(guac_client* client, guac_stream* stream,
|
int guac_common_json_write_property(guac_client* client, guac_stream* stream,
|
||||||
guac_common_json_state* json_state, const char* name,
|
guac_common_json_state* json_state, const char* name,
|
||||||
const char* value) {
|
const char* value) {
|
||||||
|
|
||||||
bool blob_written = false;
|
int blob_written = 0;
|
||||||
|
|
||||||
/* Write leading comma if not first property */
|
/* Write leading comma if not first property */
|
||||||
if (json_state->properties_written != 0)
|
if (json_state->properties_written != 0)
|
||||||
@ -173,7 +173,7 @@ void guac_common_json_begin_object(guac_client* client, guac_stream* stream,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool guac_common_json_end_object(guac_client* client, guac_stream* stream,
|
int guac_common_json_end_object(guac_client* client, guac_stream* stream,
|
||||||
guac_common_json_state* json_state) {
|
guac_common_json_state* json_state) {
|
||||||
|
|
||||||
/* Write final brace of JSON object */
|
/* Write final brace of JSON object */
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#include <guacamole/client.h>
|
#include <guacamole/client.h>
|
||||||
#include <guacamole/stream.h>
|
#include <guacamole/stream.h>
|
||||||
|
|
||||||
@ -97,9 +95,9 @@ void guac_common_json_flush(guac_client* client, guac_stream* stream,
|
|||||||
* The number of bytes in the buffer.
|
* The number of bytes in the buffer.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* true if at least one blob was written, false otherwise.
|
* Non-zero if at least one blob was written, zero otherwise.
|
||||||
*/
|
*/
|
||||||
bool guac_common_json_write(guac_client* client, guac_stream* stream,
|
int guac_common_json_write(guac_client* client, guac_stream* stream,
|
||||||
guac_common_json_state* json_state, const char* buffer, int length);
|
guac_common_json_state* json_state, const char* buffer, int length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,9 +121,9 @@ bool guac_common_json_write(guac_client* client, guac_stream* stream,
|
|||||||
* The string to write.
|
* The string to write.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* true if at least one blob was written, false otherwise.
|
* Non-zero if at least one blob was written, zero otherwise.
|
||||||
*/
|
*/
|
||||||
bool guac_common_json_write_string(guac_client* client,
|
int guac_common_json_write_string(guac_client* client,
|
||||||
guac_stream* stream, guac_common_json_state* json_state,
|
guac_stream* stream, guac_common_json_state* json_state,
|
||||||
const char* str);
|
const char* str);
|
||||||
|
|
||||||
@ -152,9 +150,9 @@ bool guac_common_json_write_string(guac_client* client,
|
|||||||
* The value of the property to write.
|
* The value of the property to write.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* true if at least one blob was written, false otherwise.
|
* Non-zero if at least one blob was written, zero otherwise.
|
||||||
*/
|
*/
|
||||||
bool guac_common_json_write_property(guac_client* client, guac_stream* stream,
|
int guac_common_json_write_property(guac_client* client, guac_stream* stream,
|
||||||
guac_common_json_state* json_state, const char* name,
|
guac_common_json_state* json_state, const char* name,
|
||||||
const char* value);
|
const char* value);
|
||||||
|
|
||||||
@ -192,9 +190,9 @@ void guac_common_json_begin_object(guac_client* client, guac_stream* stream,
|
|||||||
* The state object whose in-progress JSON object should be terminated.
|
* The state object whose in-progress JSON object should be terminated.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* true if at least one blob was written, false otherwise.
|
* Non-zero if at least one blob was written, zero otherwise.
|
||||||
*/
|
*/
|
||||||
bool guac_common_json_end_object(guac_client* client, guac_stream* stream,
|
int guac_common_json_end_object(guac_client* client, guac_stream* stream,
|
||||||
guac_common_json_state* json_state);
|
guac_common_json_state* json_state);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user