Skip to content

Commit fe45d13

Browse files
author
Andy Piper
committed
Diffusion 5.8.1
Diffusion 5.8.1 Examples
1 parent fa6bd25 commit fe45d13

File tree

71 files changed

+2979
-2847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2979
-2847
lines changed

apple/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
# Apple Examples for the Diffusion and Reappt APIs
2+
13
This directory contains examples showing the use of the Apple API for Diffusion and Reappt.
24

35
The examples are provided with partial source code, without an Xcode project for build.
46
As such they are intended to demonstrate typical usage of the API and are agnostic as to their
57
runtime platform. They will require minimum modification to run on either OS X or iOS.
68

7-
See also:
89

9-
* [Reappt Developer Resources](http://developer.reappt.io/)
10-
* [Push Technology Downloads](http://download.pushtechnology.com/) (for Diffusion)
10+
## Client libraries
11+
12+
You can download the Apple client libraries from the following locations:
13+
14+
* For Reappt: [http://developer.reappt.io/clients/apple/](http://developer.reappt.io/clients/apple/)
15+
16+
* For Diffusion: [http://download.pushtechnology.com/](http://download.pushtechnology.com/)
17+
In Diffusion, the client libraries are available in the `clients` directory of the Diffusion server installation.
18+
19+

c/Makefile

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,39 @@
1-
include makefile.defs
1+
# The following two variables must be set.
2+
#
3+
# Directory containing the C client include files.
4+
# DIFFUSION_C_CLIENT_INCDIR =
5+
#
6+
# Directory containing libdiffusion.a
7+
# DIFFUSION_C_CLIENT_LIBDIR =
28

3-
DEPS_BASE = ../dependencies/$(PLATFORM)
9+
ifndef DIFFUSION_C_CLIENT_INCDIR
10+
$(error DIFFUSION_C_CLIENT_INCDIR is not set)
11+
endif
12+
13+
ifndef DIFFUSION_C_CLIENT_LIBDIR
14+
$(error DIFFUSION_C_CLIENT_LIBDIR is not set)
15+
endif
16+
17+
CC = gcc
18+
19+
# Extra definitions from parent directory, if they exist.
20+
-include ../makefile.defs
21+
22+
CFLAGS += -g -Wall -Werror -std=c99 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700 -c -I$(DIFFUSION_C_CLIENT_INCDIR)
23+
LDFLAGS += $(LIBS) $(DIFFUSION_C_CLIENT_LIBDIR)/libdiffusion.a -lpthread -lpcre -lssl -lcrypto
424

5-
CFLAGS += -c -fPIC -I/usr/include/apr-1 -I/usr/include/apr-1.0 -I$(DEPS_BASE)/libwebsockets/include
6-
LDFLAGS += -lapr-1 -laprutil-1 -lpcre -lssl -lcrypto $(DEPS_BASE)/libwebsockets/lib/libwebsockets.a
725
ARFLAGS +=
826
SOURCES = subscribe.c fetch.c rc-state.c rc-fortune.c fortune-client.c \
927
send-msg.c send-msg-to-session.c send-msg-to-filter.c \
1028
auth-service.c \
1129
change-principal.c add-topics.c update-topic.c \
1230
subscribe-multiple.c update-record.c connect.c \
1331
connect-async.c system-auth-control.c \
14-
msg-handler.c msg-listener.c \
32+
msg-handler.c msg-listener.c \
1533
session-properties-listener.c \
1634
get-session-properties.c \
1735
missing-topic-notification.c \
18-
subscription-control.c
36+
subscription-control.c reconnect.c
1937

2038
TARGETDIR = target
2139
OBJDIR = $(TARGETDIR)/objs
@@ -30,7 +48,7 @@ TARGETS = subscribe fetch rc-state rc-fortune fortune-client \
3048
session-properties-listener \
3149
get-session-properties \
3250
missing-topic-notification \
33-
subscription-control
51+
subscription-control reconnect
3452

3553
all: prepare $(TARGETS)
3654
.PHONY: all
@@ -110,5 +128,8 @@ missing-topic-notification: $(OBJDIR)/missing-topic-notification.o
110128
subscription-control: $(OBJDIR)/subscription-control.o
111129
$(CC) $< $(LDFLAGS) -o $(BINDIR)/$@
112130

131+
reconnect: $(OBJDIR)/reconnect.o
132+
$(CC) $< $(LDFLAGS) -o $(BINDIR)/$@
133+
113134
clean:
114135
rm -rf $(TARGETS) $(OBJECTS) $(TARGETDIR) core a.out

c/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# C Examples for the Diffusion and Reappt APIs
2+
3+
This directory contains examples showing the use of the C API for Diffusion and Reappt.
4+
5+
To use these examples, download the C client library for your operating system from the links below.
6+
The C API is available for the following operating systems:
7+
8+
* 64-bit Linux as a statically or dynamically linked library
9+
* 32-bit and 64-bit Windows as a statically linked library
10+
* 64-bit OS X as a statically linked library
11+
12+
13+
## Client libraries
14+
15+
You can download the C client libraries from the following locations:
16+
17+
* For Reappt: [http://developer.reappt.io/clients/c/](http://developer.reappt.io/clients/c/)
18+
19+
* For Diffusion: [http://download.pushtechnology.com/](http://download.pushtechnology.com/)
20+
In Diffusion, the client libraries are available in the `clients` directory of the Diffusion server installation.
21+
22+
23+
## Dependencies
24+
25+
The C client requires the following dependencies:
26+
27+
* [Perl Compatible Regular Expressions (PCRE)](http://pcre.org) library, version 8.3
28+
* [OpenSSL](https://www.openssl.org) library, version 1.0.2a
29+
30+
For Linux or OS X, you can download them through your operating system's package manager.
31+
For Windows™, Push Technology provides custom builds of these libraries built with the same compiler and on the same architecture as the C client libraries.
32+
33+
34+
## Running the examples
35+
36+
1. Install the required dependencies on your development system.
37+
2. Get the C client library zip for your platform and extract it.
38+
3. Uncomment the variables at the top of the `Makefile` in the examples directory. Set these variables to the location of the extracted Diffusion C client library:
39+
40+
DIFFUSION_C_CLIENT_INCDIR = <path_to_library>/include
41+
DIFFUSION_C_CLIENT_LIBDIR = <path_to_library>/lib
42+
43+
4. Run the `make` command in the examples directory.

0 commit comments

Comments
 (0)