00001 
00011 #ifdef CPLUSPLUS
00012     #undef CPLUSPLUS
00013 #endif
00014 
00015 
00016 #include "isnet.h"
00017 
00018 
00019 #ifdef  ENABLE_SSL
00020 
00021 
00023 
00024 
00025 
00037 Buffer  get_command(Buffer msg)
00038 {
00039     unsigned int i;
00040     Buffer com;
00041 
00042     com = cawk_Buffer(msg, ' ', 1);
00043     if (com.buf==NULL) {
00044         com = make_Buffer(1);
00045         return com;
00046     }
00047 
00048     for (i=0; i<strlen((const char*)com.buf); i++) {
00049         if (com.buf[i]>='a' && com.buf[i]<='z') com.buf[i] += - 'a' + 'A';
00050     }
00051     return com;
00052 }
00053 
00054 
00055 
00067 Buffer  get_operand(Buffer msg)
00068 {
00069     Buffer opr;
00070 
00071     opr = cawk_Buffer(msg, ' ', 2);
00072     if (opr.buf==NULL) opr = make_Buffer(1);
00073 
00074     return opr;
00075 }
00076 
00077 
00078 
00090 Buffer  get_comment(Buffer msg)
00091 {
00092     int i, j, pos, cnt;
00093     char*  buf;
00094     Buffer com;
00095 
00096     buf = (char*)msg.buf;
00097     for(i=0, j=0; j<2; j++) {
00098         while (buf[i]!='\0' && buf[i]!=' ') i++;
00099         while (buf[i]!='\0' && buf[i]==' ') i++;
00100     }
00101 
00102     pos = i;
00103     while (buf[i]!='\0') i++;
00104     cnt = i - pos;
00105     com = make_Buffer(cnt+1);
00106 
00107     if (com.buf==NULL) com = make_Buffer(1);
00108     else {
00109         for (i=0; i<cnt; i++) com.buf[i] = buf[pos+i];
00110         com.vldsz = cnt;
00111     }
00112 
00113     return com;
00114 }
00115 
00116 
00117 
00118 #include "isnet_server.c"
00119 
00120 #include "isnet_client.c"
00121 
00122 
00123 #endif      // ENABLE_SSL