]> code.citadel.org Git - citadel.git/blobdiff - citadel/citadelapi.c
* Updated citmail.c with the latest stuff from the production system.
[citadel.git] / citadel / citadelapi.c
index ffdc6ca6d39a637c30f0c0f72acb9488d04f223d..68bd7f5805ee06c6f081b65e82ed429629d7c3b6 100644 (file)
@@ -9,6 +9,8 @@
 
 struct CtdlServerHandle CtdlAppHandle;
 struct CtdlServInfo CtdlAppServInfo;
+int CtdlErrno = 0;
+
 void CtdlMain();
 
 void logoff(exitcode) {
@@ -110,3 +112,26 @@ char *argv[]; {
        serv_puts("QUIT");
        exit(0);
        }
+
+
+int CtdlGetLastError() {
+       return CtdlErrno;
+       }
+
+
+int CtdlSendExpressMessage(char *ToUser, char *MsgText) {
+       char buf[256];
+
+       if (strlen(ToUser) + strlen(MsgText) > 248) {
+               CtdlErrno = ERROR + TOO_BIG;
+               return CtdlErrno;
+               }
+
+       sprintf(buf, "SEXP %s|%s", ToUser, MsgText);
+       serv_puts(buf);
+       serv_gets(buf);
+       
+       CtdlErrno = atoi(buf);
+       if (CtdlErrno == OK) CtdlErrno = 0;
+       return CtdlErrno;
+       }