aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src/libicalss
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-04-18 01:54:48 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-04-18 01:54:48 +0800
commite6f1da7f4681def1f8b0472a504dda549f9f4b89 (patch)
tree20975542002d583663c5c728e9f3cde0bd61573f /libical/src/libicalss
parent3a49d3e43d8e752162e5c4a098e1c0991a7611db (diff)
downloadgsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.gz
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.bz2
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.lz
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.xz
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.zst
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.zip
Finish merge of new libical 0.23a version
2001-04-17 JP Rosevear <jpr@ximian.com> * Finish merge of new libical 0.23a version svn path=/trunk/; revision=9420
Diffstat (limited to 'libical/src/libicalss')
-rw-r--r--libical/src/libicalss/Makefile.am14
-rw-r--r--libical/src/libicalss/icalcstp.h164
2 files changed, 48 insertions, 130 deletions
diff --git a/libical/src/libicalss/Makefile.am b/libical/src/libicalss/Makefile.am
index 732d970738..28a3adc6ee 100644
--- a/libical/src/libicalss/Makefile.am
+++ b/libical/src/libicalss/Makefile.am
@@ -7,11 +7,10 @@ LEX_OUTPUT_ROOT = lex.ss
all: icalss.h
INCLUDES = \
- -I$(top_builddir) \
-I$(top_srcdir)/src \
-I$(top_builddir)/src \
-I$(top_srcdir)/src/libical \
- -I$(srcdir)/libical
+ -I$(top_builddir)/src/libical
libicalss_la_LDFLAGS = -version-info 0:0:0
@@ -25,11 +24,14 @@ libicalss_la_SOURCES = \
icalfilesetimpl.h \
icalset.c \
icalsslexer.l \
- icalssutil.c \
icalssyacc.h \
icalssyacc.y \
icalspanlist.c \
icalmessage.c \
+ icalcstpclient.c \
+ icalcstpclient.h \
+ icalcstpserver.c \
+ icalcstpserver.h \
icalcstp.c
libicalssincludedir = $(includedir)
@@ -40,11 +42,13 @@ COMBINEDHEADERS = \
icalfileset.h \
icaldirset.h \
icalcalendar.h \
- icalssutil.h \
icalclassify.h \
icalspanlist.h \
icalmessage.h \
- icalcstp.h
+ icalcstp.h \
+ icalcstpclient.h \
+ icalcstpserver.h
+
icalss.h: $(COMBINEDHEADERS)
cat $(COMBINEDHEADERS) | egrep -v "#include.*\"ical" \
diff --git a/libical/src/libicalss/icalcstp.h b/libical/src/libicalss/icalcstp.h
index 2ebccd622a..dfc361830e 100644
--- a/libical/src/libicalss/icalcstp.h
+++ b/libical/src/libicalss/icalcstp.h
@@ -30,134 +30,48 @@
#include "ical.h"
-/********************** Server (Reciever) Interfaces *************************/
-
-/* On the server side, the caller will recieve data from the incoming
- socket and pass it to icalcstps_next_input. The caller then takes
- the return from icalcstps_next_outpu and sends it out through the
- socket. This gives the caller a point of control. If the cstp code
- connected to the socket itself, it would be hard for the caller to
- do anything else after the cstp code was started.
-
- All of the server abd client command routines will generate
- response codes. On the server side, these responses will be turned
- into text and sent to the client. On the client side, the reponse
- is the one sent from the server.
-
- Since each command can return multiple responses, the responses are
- stored in the icalcstps object and are accesses by
- icalcstps_first_response() and icalcstps_next_response()
-
- How to use:
-
- 1) Construct a new icalcstps, bound to your code via stubs
- 2) Repeat forever:
- 2a) Get string from client & give to icalcstps_next_input()
- 2b) Repeat until icalcstp_next_output returns 0:
- 2b1) Call icalcstps_next_output.
- 2b2) Send string to client.
-*/
-
-
-
-typedef void icalcstps;
-
-/* Er, they aren't really stubs, but pointers to the rountines that
- icalcstps_process_incoming will call when it recognizes a CSTP
- command in the data. BTW, the CONTINUE command is named 'cont'
- because 'continue' is a C keyword */
-struct icalcstps_stubs {
- icalerrorenum (*abort)(icalcstps* cstp);
- icalerrorenum (*authenticate)(icalcstps* cstp, char* mechanism,
- char* data);
- icalerrorenum (*calidexpand)(icalcstps* cstp, char* calid);
- icalerrorenum (*capability)(icalcstps* cstp);
- icalerrorenum (*cont)(icalcstps* cstp, unsigned int time);
- icalerrorenum (*identify)(icalcstps* cstp, char* id);
- icalerrorenum (*disconnect)(icalcstps* cstp);
- icalerrorenum (*sendata)(icalcstps* cstp, unsigned int time,
- icalcomponent *comp);
- icalerrorenum (*starttls)(icalcstps* cstp, char* command,
- char* data);
- icalerrorenum (*upnexpand)(icalcstps* cstp, char* upn);
- icalerrorenum (*unknown)(icalcstps* cstp, char* command, char* data);
+/* Connection state, from the state machine in RFC2445 */
+enum cstps_state {
+ NO_STATE,
+ CONNECTED,
+ AUTHENTICATED,
+ IDENTIFIED,
+ DISCONNECTED,
+ RECEIVE
};
+/* CSTP Commands that a client can issue to a server */
+typedef enum icalcstp_command {
+ ICAL_ABORT_COMMAND,
+ ICAL_AUTHENTICATE_COMMAND,
+ ICAL_CAPABILITY_COMMAND,
+ ICAL_CONTINUE_COMMAND,
+ ICAL_CALIDEXPAND_COMMAND,
+ ICAL_IDENTIFY_COMMAND,
+ ICAL_DISCONNECT_COMMAND,
+ ICAL_SENDDATA_COMMAND,
+ ICAL_STARTTLS_COMMAND,
+ ICAL_UPNEXPAND_COMMAND,
+ ICAL_COMPLETE_COMMAND,
+ ICAL_UNKNOWN_COMMAND
+} icalcstp_command;
+
+
+
+/* A statement is a combination of command or response code and a
+ component that the server and client exchage with each other. */
+struct icalcstp_statement {
+ icalcstp_command command;
+ char* str_data; /* If non-NUll use as arguments to command */
+ int int_data; /* If non-NULL use as arguments to command */
+
+ icalrequeststatus code;
+
+ icalcomponent* data;
+};
-icalcstps* icalcstps_new(struct icalcstps_stubs stubs);
-
-void icalcstps_free(icalcstps* cstp);
-
-int icalcstps_set_timeout(icalcstps* cstp, int sec);
-
-/* Get the next string to send to the client */
-char* icalcstps_next_output(icalcstps* cstp);
-
-/* process the next string from the client */
-int icalcstps_next_input(icalcstps* cstp);
-
-
-/********************** Client (Sender) Interfaces **************************/
-
-/* How to use:
-
- 1) Construct a new icalcstpc
- 2) Issue a command by calling one of the command routines.
- 3) Repeat until both call icalcstpc_next_output and
- icalcstpc_next_input return 0:
- 3a) Call icalcstpc_next_output. Send string to server.
- 3b) Get string from server, & give to icalcstp_next_input()
- 4) Iterate with icalcstpc_first_response & icalcstp_next_response to
- get the servers responses
- 5) Repeat at #2
-*/
-
-typedef void* icalcstpc;
-
-/* Response code sent by the server. */
-typedef struct icalcstpc_response {
- icalrequeststatus code;
- char *arg; /* These strings are owned by libical */
- char *debug_text;
- char *more_text;
- void* result;
-} icalcstpc_response;
-
-icalcstps* icalcstpc_new();
-
-void* icalcstpc_free(icalcstpc* cstpc);
-
-int icalcstpc_set_timeout(icalcstpc* cstp, int sec);
-
-
-/* Get the next string to send to the server */
-char* icalcstpc_next_output(icalcstpc* cstp);
-
-/* process the next string from the server */
-int icalcstpc_next_input(icalcstpc* cstp);
-
-/* After icalcstpc_next_input returns a 0, there are responses
- ready. use these to get them */
-icalcstpc_response icalcstpc_first_response(icalcstpc* cstp);
-icalcstpc_response icalcstpc_next_response(icalcstpc* cstp);
-
-/* Issue a command */
-icalerrorenum icalcstpc_abort(icalcstpc* cstp);
-icalerrorenum icalcstpc_authenticate(icalcstpc* cstp, char* mechanism,
- char* init_data, char* f(char*) );
-icalerrorenum icalcstpc_capability(icalcstpc* cstp);
-icalerrorenum icalcstpc_calidexpand(icalcstpc* cstp,char* calid);
-icalerrorenum icalcstpc_continue(icalcstpc* cstp, unsigned int time);
-icalerrorenum icalcstpc_disconnect(icalcstpc* cstp);
-icalerrorenum icalcstpc_identify(icalcstpc* cstp, char* id);
-icalerrorenum icalcstpc_starttls(icalcstpc* cstp, char* command,
- char* init_data, char* f(char*));
-icalerrorenum icalcstpc_senddata(icalcstpc* cstp, unsigned int time,
- icalcomponent *comp);
-icalerrorenum icalcstpc_upnexpand(icalcstpc* cstp,char* calid);
-icalerrorenum icalcstpc_sendata(icalcstpc* cstp, unsigned int time,
- icalcomponent *comp);
-
+const char* icalcstp_command_to_string(icalcstp_command command);
+icalcstp_command icalcstp_string_to_command(const char* str);
#endif /* !ICALCSTP_H */