Skip to content

Commit

Permalink
Rename skeleton.[ch] to net.[ch]
Browse files Browse the repository at this point in the history
Also renames remaining references of Net Skeleton to Fossa
  • Loading branch information
Marko Mikulicic committed Nov 20, 2014
1 parent 9e1486b commit 6f5d7c9
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
index.html
skeleton.adoc
net.adoc
http.adoc
json-rpc.adoc
mqtt.adoc
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# All rights reserved

DOCGEN=../scripts/docgen.py
GEN_ADOCS = skeleton.adoc iobuf.adoc http.adoc util.adoc mqtt.adoc json-rpc.adoc sha1.adoc
GEN_ADOCS = net.adoc iobuf.adoc http.adoc util.adoc mqtt.adoc json-rpc.adoc sha1.adoc
ADOCS = $(wildcard *.adoc) $(GEN_ADOCS)

all: index.html
Expand Down
2 changes: 1 addition & 1 deletion docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include::concept.adoc[]
include::tutorial.adoc[]
include::build_opts.adoc[]

include::skeleton.adoc[]
include::net.adoc[]
include::iobuf.adoc[]
include::http.adoc[]
include::json-rpc.adoc[]
Expand Down
2 changes: 1 addition & 1 deletion examples/restful_server/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<h1>RESTful API demo.</h1>

<p>
This page demonstrates how Net Skeleton could be used to implement
This page demonstrates how Fossa could be used to implement
RESTful APIs. Start typing numbers into the text fields below.
Browser sends two numbers to <tt>/api/v1/sum</tt> URI.
Web server calclulates the sum and returns the result.
Expand Down
2 changes: 1 addition & 1 deletion examples/websocket_chat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<h1>Websocket PubSub Demonstration</h1>

<p>
This page demonstrates how net skeleton could be used to implement
This page demonstrates how Fossa could be used to implement
<a href="http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern">
publish–subscribe pattern</a>. Open this page in several browser
windows. Each window initiates persistent
Expand Down
6 changes: 3 additions & 3 deletions fossa.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ static sock_t ns_open_listening_socket(union socket_address *sa, int proto) {

#ifdef NS_ENABLE_SSL
/* Certificate generation script is at */
/* https://github.com/cesanta/net_skeleton/blob/master/scripts/gen_certs.sh */
/* https://github.com/cesanta/fossa/blob/master/scripts/gen_certs.sh */

static int ns_use_ca_cert(SSL_CTX *ctx, const char *cert) {
if (ctx == NULL) {
Expand Down Expand Up @@ -1149,7 +1149,7 @@ struct ns_connection *ns_next(struct ns_mgr *s, struct ns_connection *conn) {
*
* Must be called from a different thread.
*
* Skeleton manager has a socketpair, `struct ns_mgr::ctl`,
* Fossa manager has a socketpair, `struct ns_mgr::ctl`,
* where `ns_broadcast()` pushes the message.
* `ns_mgr_poll()` wakes up, reads a message from the socket pair, and calls
* specified callback for each connection. Thus the callback function executes
Expand Down Expand Up @@ -1204,7 +1204,7 @@ void ns_mgr_init(struct ns_mgr *s, void *user_data) {
}

/*
* De-initializes skeleton manager.
* De-initializes fossa manager.
*
* Closes and deallocates all active connections.
*/
Expand Down
8 changes: 4 additions & 4 deletions fossa.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void iobuf_resize(struct iobuf *, size_t new_size);
* license, as set out in <http://cesanta.com/>.
*/

#ifndef NS_SKELETON_HEADER_INCLUDED
#define NS_SKELETON_HEADER_INCLUDED
#ifndef NS_NET_HEADER_INCLUDED
#define NS_NET_HEADER_INCLUDED


#ifdef NS_ENABLE_SSL
Expand Down Expand Up @@ -238,7 +238,7 @@ size_t strvbuf_append(struct iobuf *, const void *data, size_t data_size);
struct ns_str *strvbuf_extract(struct iobuf *, size_t *len);

/* Callback function (event handler) prototype, must be defined by user. */
/* Net skeleton will call event handler, passing events defined above. */
/* Fossa will call event handler, passing events defined above. */
struct ns_connection;
typedef void (*ns_event_handler_t)(struct ns_connection *, int ev, void *);

Expand Down Expand Up @@ -373,7 +373,7 @@ int ns_resolve(const char *domain_name, char *ip_addr_buf, size_t buf_len);
}
#endif /* __cplusplus */

#endif /* NS_SKELETON_HEADER_INCLUDED */
#endif /* NS_NET_HEADER_INCLUDED */
/*
* Copyright (c) 2004-2013 Sergey Lyubka <[email protected]>
* Copyright (c) 2013 Cesanta Software Limited
Expand Down
2 changes: 1 addition & 1 deletion modules/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef NS_HTTP_HEADER_DEFINED
#define NS_HTTP_HEADER_DEFINED

#include "skeleton.h"
#include "net.h"

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions modules/modules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FR = ../../frozen
HEADERS = common.h iobuf.h skeleton.h $(FR)/frozen.h sha1.h util.h http.h json-rpc.h mqtt.h
SOURCES = iobuf.c skeleton.c $(FR)/frozen.c http.c sha1.c util.c json-rpc.c mqtt.c
HEADERS = common.h iobuf.h net.h $(FR)/frozen.h sha1.h util.h http.h json-rpc.h mqtt.h
SOURCES = iobuf.c net.c $(FR)/frozen.c http.c sha1.c util.c json-rpc.c mqtt.c
2 changes: 1 addition & 1 deletion modules/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef NS_MQTT_HEADER_INCLUDED
#define NS_MQTT_HEADER_INCLUDED

#include "skeleton.h"
#include "net.h"

struct ns_mqtt_message {
int cmd;
Expand Down
6 changes: 3 additions & 3 deletions modules/skeleton.c → modules/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ static sock_t ns_open_listening_socket(union socket_address *sa, int proto) {

#ifdef NS_ENABLE_SSL
/* Certificate generation script is at */
/* https://github.com/cesanta/net_skeleton/blob/master/scripts/gen_certs.sh */
/* https://github.com/cesanta/fossa/blob/master/scripts/gen_certs.sh */

static int ns_use_ca_cert(SSL_CTX *ctx, const char *cert) {
if (ctx == NULL) {
Expand Down Expand Up @@ -1006,7 +1006,7 @@ struct ns_connection *ns_next(struct ns_mgr *s, struct ns_connection *conn) {
*
* Must be called from a different thread.
*
* Skeleton manager has a socketpair, `struct ns_mgr::ctl`,
* Fossa manager has a socketpair, `struct ns_mgr::ctl`,
* where `ns_broadcast()` pushes the message.
* `ns_mgr_poll()` wakes up, reads a message from the socket pair, and calls
* specified callback for each connection. Thus the callback function executes
Expand Down Expand Up @@ -1061,7 +1061,7 @@ void ns_mgr_init(struct ns_mgr *s, void *user_data) {
}

/*
* De-initializes skeleton manager.
* De-initializes fossa manager.
*
* Closes and deallocates all active connections.
*/
Expand Down
8 changes: 4 additions & 4 deletions modules/skeleton.h → modules/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* license, as set out in <http://cesanta.com/>.
*/

#ifndef NS_SKELETON_HEADER_INCLUDED
#define NS_SKELETON_HEADER_INCLUDED
#ifndef NS_NET_HEADER_INCLUDED
#define NS_NET_HEADER_INCLUDED

#include "common.h"
#include "iobuf.h"
Expand Down Expand Up @@ -58,7 +58,7 @@ size_t strvbuf_append(struct iobuf *, const void *data, size_t data_size);
struct ns_str *strvbuf_extract(struct iobuf *, size_t *len);

/* Callback function (event handler) prototype, must be defined by user. */
/* Net skeleton will call event handler, passing events defined above. */
/* Fossa will call event handler, passing events defined above. */
struct ns_connection;
typedef void (*ns_event_handler_t)(struct ns_connection *, int ev, void *);

Expand Down Expand Up @@ -193,4 +193,4 @@ int ns_resolve(const char *domain_name, char *ip_addr_buf, size_t buf_len);
}
#endif /* __cplusplus */

#endif /* NS_SKELETON_HEADER_INCLUDED */
#endif /* NS_NET_HEADER_INCLUDED */
2 changes: 1 addition & 1 deletion scripts/docgen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Usage: ./docgen.py ../modules/skeleton.c
# Usage: ./docgen.py ../modules/net.c

import argparse
import subprocess
Expand Down
28 changes: 28 additions & 0 deletions scripts/embed_fossa.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
#
# This script embeds fossa directly into the source file.
# The source file must have a placeholder for the fossa code,
# two following lines:

# // fossa start
# // fossa end
#
# Fossa code will be inserted between those two lines.

if ! test -f "$1" ; then
echo "Usage: $0 <source_file>"
exit 1
fi

D=`dirname $0`

F1=$D/../fossa.h
F2=$D/../fossa.c

sed '/#include "fossa.h"/d' $F2 > /tmp/$$
F2=/tmp/$$

A='\/\/ fossa start'
B='\/\/ fossa end'

sed -i .$$.bak -e "/$A/,/$B/ { /$A/{ n; r $F1" -e "r $F2" -e "}; /$B/!d; }" "$1"
28 changes: 0 additions & 28 deletions scripts/embed_net_skeleton.sh

This file was deleted.

0 comments on commit 6f5d7c9

Please sign in to comment.