to-symbol function.
return M_NONE;
else if (match (requestMethod, CharConst (kMETHOD_GET)))
return M_GET;
+ else if (match (requestMethod, CharConst (kMETHOD_HEAD)))
+ return M_HEAD;
else if (match (requestMethod, CharConst (kMETHOD_POST)))
return M_POST;
+ else if (match (requestMethod, CharConst (kMETHOD_OPTIONS)))
+ return M_OPTIONS;
+ else if (match (requestMethod, CharConst (kMETHOD_PUT)))
+ return M_PUT;
+ else if (match (requestMethod, CharConst (kMETHOD_DELETE)))
+ return M_DELETE;
else
return M_OTHER;
}
typedef enum {
M_NONE,
M_GET,
+ M_HEAD,
M_POST,
+ M_OPTIONS,
+ M_PUT,
+ M_DELETE,
M_OTHER,
} method_type;
typedef enum {
#define kSSL_SERVER_V_START "SSL_SERVER_V_START"
#define kSSL_SESSION_ID "SSL_SESSION_ID"
#define kMETHOD_GET "GET"
+#define kMETHOD_HEAD "HEAD"
#define kMETHOD_POST "POST"
+#define kMETHOD_OPTIONS "OPTIONS"
+#define kMETHOD_PUT "PUT"
+#define kMETHOD_DELETE "DELETE"
#define kMIME_FORMDATA "multipart/form-data"
#define kMIME_HTML "text/html"
#define kMIME_TEXT "text/plain"
} else {
switch (form->method) {
case CGIForm::M_GET:
+ case CGIForm::M_DELETE:
form->read_get ();
break;
case CGIForm::M_POST:
}
/*DOC:
+===to-symbol===
+ (to-symbol STRING) -> SYMBOL
+
+*/
+//#AFUNC to-symbol ml_to_symbol
+//#WIKIFUNC to-symbol
+MNode* ml_to_symbol (MNode* cell, MlEnv* mlenv) {
+ MNode* arg = cell->cdr ();
+ MNodePtr text;
+
+ if (! arg)
+ throw (uErrorWrongNumber);
+ text = eval (arg->car (), mlenv);
+ nextNode (arg);
+ if (arg)
+ throw (uErrorWrongNumber);
+
+ if (text ()) {
+ if (text ()->isSym ()) {
+ return text.release ();
+ } else {
+ return newMNode_sym (new ustring (text ()->to_string ()));
+ }
+ } else {
+ return NULL;
+ }
+// return newMNode_str (new ustring (text));
+}
+
+/*DOC:
===dump-to-sexp===
(dump-to-sexp OBJECT...) -> STRING
MNode* ml_gmdate_format (MNode* cell, MlEnv* mlenv);
MNode* ml_random_key (MNode* cell, MlEnv* mlenv);
MNode* ml_to_string (MNode* cell, MlEnv* mlenv);
+MNode* ml_to_symbol (MNode* cell, MlEnv* mlenv);
MNode* ml_dump_to_sexp (MNode* cell, MlEnv* mlenv);
//MNode* ml_to_sexp (MNode* cell, MlEnv* mlenv);
MNode* ml_read_sexp (MNode* cell, MlEnv* mlenv);