int test(char *URL) { (void)URL; /* not used */ if(scopeid()) return 6; if(append()) return 5; if(set_url()) return 1; if(set_parts()) return 2; if(get_url()) return 3; if(get_parts()) return 4; printf("success\n"); return 0; }
static void set_request_path(VALUE env, const char* rui) { VALUE request_path; char *buf = xmalloc(strlen(rui) + 1); strcpy(buf, rui); set_parts(env, buf, '#', GE_FRAGMENT); set_parts(env, buf, '?', GE_QUERY_STRING); request_path = FRZSTR(buf); rb_hash_aset(env, global_envs[GE_PATH_INFO], request_path); rb_hash_aset(env, global_envs[GE_REQUEST_PATH], request_path); xfree(buf); }