Rename Mongoose constants: NS_ -> MG_, NSF_ -> MG_F_

PUBLISHED_FROM=c9cc54df1883aa17606de2b1ffb30f0cd687d037
This commit is contained in:
Sergey Lyubka authored and Sergey Lyubka committed 2015-09-21 15:19:34 +01:00
1 parent 32ab35f61f
commit e1dd3f06fe
41 files changed
+887 -883

No files matched your search

+3 -3
View File
@@ -3,9 +3,9 @@ SOURCES = $(PROG).c ../../mongoose.c
CFLAGS = -W -Wall -I../.. $(CFLAGS_EXTRA)
ifeq ($(SSL), openssl)
CFLAGS += -DNS_ENABLE_SSL -lssl -lcrypto -lcrypto
CFLAGS += -DMG_ENABLE_SSL -lssl -lcrypto -lcrypto
else ifeq ($(SSL), krypton)
CFLAGS += -DNS_ENABLE_SSL ../../../krypton/krypton.c
CFLAGS += -DMG_ENABLE_SSL ../../../krypton/krypton.c
endif
all: $(PROG)
@@ -14,7 +14,7 @@ $(PROG): $(SOURCES)
$(CC) $(SOURCES) -o $@ $(CFLAGS)
$(PROG).exe: $(SOURCES)
cl $(SOURCES) /I../.. /MD /DNS_ENABLE_THREADS /Fe$@ advapi32.lib
cl $(SOURCES) /I../.. /MD /DMG_ENABLE_THREADS /Fe$@ advapi32.lib
clean:
rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)
+5 -5
View File
@@ -29,7 +29,7 @@ static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct http_message *hm = (struct http_message *) ev_data;
switch (ev) {
case NS_HTTP_REQUEST:
case MG_EV_HTTP_REQUEST:
if (mg_vcmp(&hm->uri, "/api/v1/sum") == 0) {
handle_sum_call(nc, hm); /* Handle RESTful call */
} else if (mg_vcmp(&hm->uri, "/printcontent") == 0) {
@@ -51,7 +51,7 @@ int main(int argc, char *argv[]) {
struct mg_connection *nc;
int i;
char *cp;
#ifdef NS_ENABLE_SSL
#ifdef MG_ENABLE_SSL
const char *ssl_cert = NULL;
#endif
@@ -73,11 +73,11 @@ int main(int argc, char *argv[]) {
s_http_server_opts.per_directory_auth_file = argv[++i];
} else if (strcmp(argv[i], "-r") == 0 && i + 1 < argc) {
s_http_server_opts.url_rewrites = argv[++i];
#ifndef NS_DISABLE_CGI
#ifndef MG_DISABLE_CGI
} else if (strcmp(argv[i], "-i") == 0 && i + 1 < argc) {
s_http_server_opts.cgi_interpreter = argv[++i];
#endif
#ifdef NS_ENABLE_SSL
#ifdef MG_ENABLE_SSL
} else if (strcmp(argv[i], "-s") == 0 && i + 1 < argc) {
ssl_cert = argv[++i];
#endif
@@ -91,7 +91,7 @@ int main(int argc, char *argv[]) {
exit(1);
}
#ifdef NS_ENABLE_SSL
#ifdef MG_ENABLE_SSL
if (ssl_cert != NULL) {
const char *err_str = mg_set_ssl(nc, ssl_cert, NULL);
if (err_str != NULL) {