Commit bc15e9ce authored by Deomid "rojer" Ryabkov's avatar Deomid "rojer" Ryabkov Committed by Cesanta Bot

Fix value of MG_MQTT_DUP

PUBLISHED_FROM=de1772bd6ea01f3dc467ceebb3b2af5cbe8eb240
parent 70dc6d8d
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (c) 2004-2013 Sergey Lyubka
* Copyright (c) 2013-2015 Cesanta Software Limited
* All rights reserved
*
* This software is dual-licensed: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. For the terms of this
* license, see <http://www.gnu.org/licenses/>.
*
* You are free to use this software under the terms of the GNU General
* Public License, 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.
*
* Alternatively, you can license this software under a commercial
* license, as set out in <https://www.cesanta.com/license>.
*/
#ifndef CS_MONGOOSE_SRC_COMMON_H_ #ifndef CS_MONGOOSE_SRC_COMMON_H_
#define CS_MONGOOSE_SRC_COMMON_H_ #define CS_MONGOOSE_SRC_COMMON_H_
......
/*
* Copyright (c) 2004-2013 Sergey Lyubka
* Copyright (c) 2013-2020 Cesanta Software Limited
* All rights reserved
*
* This software is dual-licensed: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. For the terms of this
* license, see <http://www.gnu.org/licenses/>.
*
* You are free to use this software under the terms of the GNU General
* Public License, 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.
*
* Alternatively, you can license this software under a commercial
* license, as set out in <https://www.cesanta.com/license>.
*/
...@@ -101,10 +101,10 @@ struct mg_mqtt_proto_data { ...@@ -101,10 +101,10 @@ struct mg_mqtt_proto_data {
/* Message flags */ /* Message flags */
#define MG_MQTT_RETAIN 0x1 #define MG_MQTT_RETAIN 0x1
#define MG_MQTT_DUP 0x4
#define MG_MQTT_QOS(qos) ((qos) << 1) #define MG_MQTT_QOS(qos) ((qos) << 1)
#define MG_MQTT_GET_QOS(flags) (((flags) &0x6) >> 1) #define MG_MQTT_GET_QOS(flags) (((flags) &0x6) >> 1)
#define MG_MQTT_SET_QOS(flags, qos) (flags) = ((flags) & ~0x6) | ((qos) << 1) #define MG_MQTT_SET_QOS(flags, qos) (flags) = ((flags) & ~0x6) | ((qos) << 1)
#define MG_MQTT_DUP 0x8
/* Connection flags */ /* Connection flags */
#define MG_MQTT_CLEAN_SESSION 0x02 #define MG_MQTT_CLEAN_SESSION 0x02
......
...@@ -59,6 +59,7 @@ parser.add_argument('--exportable-headers', dest="export", action='store_true', ...@@ -59,6 +59,7 @@ parser.add_argument('--exportable-headers', dest="export", action='store_true',
help='allow exporting internal headers') help='allow exporting internal headers')
parser.add_argument('-I', default=['.'], dest='include_path', help='include path', action='append') parser.add_argument('-I', default=['.'], dest='include_path', help='include path', action='append')
parser.add_argument('sources', nargs='*', help='sources') parser.add_argument('sources', nargs='*', help='sources')
parser.add_argument('--license', dest="license", help='License file')
class File(object): class File(object):
def __init__(self, name, parent_name): def __init__(self, name, parent_name):
...@@ -121,7 +122,22 @@ def emit_body(out, name, parent_name): ...@@ -121,7 +122,22 @@ def emit_body(out, name, parent_name):
return return
with open(resolved_name) as f: with open(resolved_name) as f:
in_comment = False
comment = ''
for l in f: for l in f:
if in_comment:
comment += l
if re.match('\s*\*/$', l):
in_comment = False
if not re.match('.*Copyright.*Cesanta', comment, re.M | re.S):
print >>out, comment,
continue
if re.match('/\*$', l):
in_comment = True
comment = l
continue
match = re.match('( *#include "(.*)")', l) match = re.match('( *#include "(.*)")', l)
if match: if match:
all, path_to_include = match.groups() all, path_to_include = match.groups()
...@@ -155,6 +171,11 @@ if sys.platform == "win32": ...@@ -155,6 +171,11 @@ if sys.platform == "win32":
import os, msvcrt import os, msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
if args.license:
with open(args.license) as f:
print f.read()
if args.public: if args.public:
print '#include "%s"' % (args.public) print '#include "%s"' % (args.public)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment