diff --git a/src/common/cs_md5.c b/src/common/cs_md5.c index f8c8b68c..4591d95b 100644 --- a/src/common/cs_md5.c +++ b/src/common/cs_md5.c @@ -1,3 +1,4 @@ + /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was diff --git a/src/common/cs_sha1.c b/src/common/cs_sha1.c index 7eab3022..32767d07 100644 --- a/src/common/cs_sha1.c +++ b/src/common/cs_sha1.c @@ -1,3 +1,4 @@ + /* Copyright(c) By Steve Reid */ /* 100% Public Domain */ diff --git a/src/common/platform.h b/src/common/platform.h index af91973f..864b1977 100644 --- a/src/common/platform.h +++ b/src/common/platform.h @@ -1,3 +1,4 @@ + #ifndef CS_COMMON_PLATFORM_H_ #define CS_COMMON_PLATFORM_H_ diff --git a/src/common/platforms/platform_nrf51.h b/src/common/platforms/platform_nrf51.h index 791c6d1b..38a27c2e 100644 --- a/src/common/platforms/platform_nrf51.h +++ b/src/common/platforms/platform_nrf51.h @@ -1,3 +1,4 @@ + #ifndef CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_ #if CS_PLATFORM == CS_P_NRF51 diff --git a/src/common/platforms/platform_nrf52.h b/src/common/platforms/platform_nrf52.h index c8054dd9..c7c2102b 100644 --- a/src/common/platforms/platform_nrf52.h +++ b/src/common/platforms/platform_nrf52.h @@ -1,3 +1,4 @@ + #ifndef CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_ #define CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_ #if CS_PLATFORM == CS_P_NRF52 diff --git a/src/common/platforms/platform_unix.h b/src/common/platforms/platform_unix.h index 59a04e33..541f58d1 100644 --- a/src/common/platforms/platform_unix.h +++ b/src/common/platforms/platform_unix.h @@ -1,3 +1,4 @@ + #ifndef CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_ #define CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_ #if CS_PLATFORM == CS_P_UNIX diff --git a/src/common/platforms/platform_wince.h b/src/common/platforms/platform_wince.h index 48c51f60..b4d76aa2 100644 --- a/src/common/platforms/platform_wince.h +++ b/src/common/platforms/platform_wince.h @@ -1,3 +1,4 @@ + #ifndef CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_ #define CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_ diff --git a/src/common/platforms/platform_windows.h b/src/common/platforms/platform_windows.h index f2eb95ae..fe036f43 100644 --- a/src/common/platforms/platform_windows.h +++ b/src/common/platforms/platform_windows.h @@ -1,3 +1,4 @@ + #ifndef CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_ #define CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_ #if CS_PLATFORM == CS_P_WINDOWS diff --git a/src/common/platforms/simplelink/sl_mg_task.c b/src/common/platforms/simplelink/sl_mg_task.c index f9c76711..d17c3871 100644 --- a/src/common/platforms/simplelink/sl_mg_task.c +++ b/src/common/platforms/simplelink/sl_mg_task.c @@ -1,3 +1,4 @@ + #if MG_NET_IF == MG_NET_IF_SIMPLELINK && !defined(MG_SIMPLELINK_NO_OSI) #include "mg_task.h" diff --git a/src/common/queue.h b/src/common/queue.h index f12d8cae..29c86358 100644 --- a/src/common/queue.h +++ b/src/common/queue.h @@ -1,3 +1,4 @@ + /* clang-format off */ /*- * Copyright (c) 1991, 1993 diff --git a/src/mg_common.h b/src/mg_common.h index 4589412a..c098948b 100644 --- a/src/mg_common.h +++ b/src/mg_common.h @@ -1,3 +1,4 @@ + #ifndef CS_MONGOOSE_SRC_COMMON_H_ #define CS_MONGOOSE_SRC_COMMON_H_ diff --git a/src/mg_http_client.h b/src/mg_http_client.h index 9597ec58..7394d44b 100644 --- a/src/mg_http_client.h +++ b/src/mg_http_client.h @@ -1,3 +1,4 @@ + /* * === Client API reference */ diff --git a/src/mg_http_server.h b/src/mg_http_server.h index eacc5721..625310b3 100644 --- a/src/mg_http_server.h +++ b/src/mg_http_server.h @@ -1,3 +1,4 @@ + /* * === Server API reference */ diff --git a/src/mg_net_if.c b/src/mg_net_if.c index c91feb99..ab02a4d4 100644 --- a/src/mg_net_if.c +++ b/src/mg_net_if.c @@ -1,3 +1,4 @@ + #include "mg_net_if.h" #include "mg_internal.h" #include "mg_net_if_socket.h" diff --git a/tools/README.md b/tools/README.md index c4adcb53..4704b91c 100644 --- a/tools/README.md +++ b/tools/README.md @@ -16,9 +16,11 @@ $ tools/unamalgam.py mongoose.c This produces directories and files under `mongoose/` and `common/` that are easeier to work with. It also produces `mongoose.c.manifest` which can later be used to reconstruct the file back: ``` -$ tools/amalgam.py --prefix=MG --public-header=mongoose.h $(cat mongoose.c.manifest) > mongoose.c +$ tools/amalgam.py --prefix=MG --license=LICENSE --public-header=mongoose.h $(cat src/mongoose.c.manifest) > mongoose.c ``` -The same applies to `mongoose.h`, except `--public-header` should be omitted during amalgamation. +The same applies to `mongoose.h`, except `--public-header` should be omitted during amalgamation: -`tools/amalgam.py` can be used to assemble `mongoose.c` and `mongoose.h`. +``` +$ tools/amalgam.py --prefix=MG --license=LICENSE $(cat src/mongoose.h.manifest) > mongoose.h +``` diff --git a/tools/amalgam.sh b/tools/amalgam.sh index 7159dccf..da5ac812 100755 --- a/tools/amalgam.sh +++ b/tools/amalgam.sh @@ -3,4 +3,4 @@ set -x -e tools/amalgam.py --prefix=MG --license=LICENSE $(cat src/mongoose.h.manifest) > mongoose.h -tools/amalgam.py --prefix=MG --public-header=mongoose.h --license=LICENSE $(cat src/mongoose.c.manifest) > mongoose.c +tools/amalgam.py --prefix=MG --license=LICENSE --public-header=mongoose.h $(cat src/mongoose.c.manifest) > mongoose.c diff --git a/tools/unamalgam.py b/tools/unamalgam.py index 347c6acf..156b0a87 100755 --- a/tools/unamalgam.py +++ b/tools/unamalgam.py @@ -33,6 +33,7 @@ with open(fname) as f: # open next file for writing ofile = open(cur_src, "w") + ofile.write('\n') print('=> %s' % cur_src, file=sys.stderr) manifest.append(cur_src) next(f) diff --git a/tools/unamalgam.sh b/tools/unamalgam.sh new file mode 100755 index 00000000..bfb66463 --- /dev/null +++ b/tools/unamalgam.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e -x + +tools/unamalgam.py mongoose.h +tools/unamalgam.py mongoose.c