2012-08-12 18:40:15 +02:00
|
|
|
/*
|
|
|
|
* vim:ts=4:sw=4:expandtab
|
|
|
|
*
|
|
|
|
* i3bar - an xcb-based status- and ws-bar for i3
|
2015-04-04 02:17:56 +02:00
|
|
|
* © 2010 Axel Wagner and contributors (see also: LICENSE)
|
2012-08-12 18:40:15 +02:00
|
|
|
*
|
2012-09-03 10:43:29 +02:00
|
|
|
* parse_json_header.c: Parse the JSON protocol header to determine
|
|
|
|
* protocol version and features.
|
2012-08-12 18:40:15 +02:00
|
|
|
*
|
|
|
|
*/
|
2013-12-29 03:11:50 +01:00
|
|
|
#pragma once
|
2012-08-12 18:40:15 +02:00
|
|
|
|
2016-10-11 09:13:35 +02:00
|
|
|
#include <config.h>
|
|
|
|
|
2012-08-12 18:40:15 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2012-08-20 22:20:37 +02:00
|
|
|
/**
|
|
|
|
* Parse the JSON protocol header to determine protocol version and features.
|
|
|
|
* In case the buffer does not contain a valid header (invalid JSON, or no
|
|
|
|
* version field found), the 'correct' field of the returned header is set to
|
|
|
|
* false. The amount of bytes consumed by parsing the header is returned in
|
|
|
|
* *consumed (if non-NULL).
|
2012-08-12 18:40:15 +02:00
|
|
|
*
|
|
|
|
*/
|
2012-09-03 10:43:29 +02:00
|
|
|
void parse_json_header(i3bar_child *child, const unsigned char *buffer, int length, unsigned int *consumed);
|