Created
June 5, 2026 14:00
-
-
Save rubys/a7100f84f37d5a2d84290259b67b5190 to your computer and use it in GitHub Desktop.
spinel master a2c2318 — real-blog articles_controller_test.c fails C compile (matz/spinel#1344): specialized base cls_id 67 dispatched but methods pruned -> undeclared fn -> int/sp_RbVal mismatch. cc -Ispinel/lib articles_controller_test.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Generated by Spinel AOT compiler */ | |
| #include "sp_runtime.h" | |
| /* sp_sym intern table */ | |
| #define SP_SYM_COUNT 119 | |
| static const char *const sp_sym_names[119] = {(&("\xff" "OK")[1]),(&("\xff" "ROW")[1]),(&("\xff" "DONE")[1]),(&("\xff" "sqlite3_open")[1]),(&("\xff" "str")[1]),(&("\xff" "ptr")[1]),(&("\xff" "int")[1]),(&("\xff" "sqlite3_close")[1]),(&("\xff" "sqlite3_exec")[1]),(&("\xff" "sqlite3_prepare_v2")[1]),(&("\xff" "sqlite3_step")[1]),(&("\xff" "sqlite3_finalize")[1]),(&("\xff" "sqlite3_reset")[1]),(&("\xff" "sqlite3_clear_bindings")[1]),(&("\xff" "sqlite3_column_int")[1]),(&("\xff" "sqlite3_column_text")[1]),(&("\xff" "sqlite3_column_count")[1]),(&("\xff" "sqlite3_column_name")[1]),(&("\xff" "sqlite3_errmsg")[1]),(&("\xff" "sqlite3_last_insert_rowid")[1]),(&("\xff" "long")[1]),(&("\xff" "sqlite3_changes")[1]),(&("\xff" "db_out")[1]),(&("\xff" "stmt_out")[1]),(&("\xff" "read_ptr")[1]),(&("\xff" "db_conn")[1]),(&("\xff" "opt")[1]),(&("\xff" "i")[1]),(&("\xff" "record")[1]),(&("\xff" "size")[1]),(&("\xff" "free")[1]),(&("\xff" "adapter")[1]),(&("\xff" "id")[1]),(&("\xff" "row")[1]),(&("\xff" "r")[1]),(&("\xff" "updated_at")[1]),(&("\xff" "created_at")[1]),(&("\xff" "verb")[1]),(&("\xff" "pattern")[1]),(&("\xff" "controller")[1]),(&("\xff" "action")[1]),(&("\xff" "path_params")[1]),(&("\xff" "notice")[1]),(&("\xff" "alert")[1]),(&("\xff" "k")[1]),(&("\xff" "v")[1]),(&("\xff" "__body__")[1]),(&("\xff" "href")[1]),(&("\xff" "method")[1]),(&("\xff" "form_class")[1]),(&("\xff" "class")[1]),(&("\xff" "type")[1]),(&("\xff" "rel")[1]),(&("\xff" "p")[1]),(&("\xff" "name")[1]),(&("\xff" "path")[1]),(&("\xff" "inner_k")[1]),(&("\xff" "inner_v")[1]),(&("\xff" "ok")[1]),(&("\xff" "created")[1]),(&("\xff" "accepted")[1]),(&("\xff" "no_content")[1]),(&("\xff" "moved_permanently")[1]),(&("\xff" "found")[1]),(&("\xff" "see_other")[1]),(&("\xff" "not_modified")[1]),(&("\xff" "bad_request")[1]),(&("\xff" "unauthorized")[1]),(&("\xff" "forbidden")[1]),(&("\xff" "not_found")[1]),(&("\xff" "unprocessable_entity")[1]),(&("\xff" "unprocessable_content")[1]),(&("\xff" "internal_server_error")[1]),(&("\xff" "params")[1]),(&("\xff" "session")[1]),(&("\xff" "flash")[1]),(&("\xff" "request_method")[1]),(&("\xff" "request_path")[1]),(&("\xff" "request_format")[1]),(&("\xff" "status")[1]),(&("\xff" "body")[1]),(&("\xff" "location")[1]),(&("\xff" "content_type")[1]),(&("\xff" "html")[1]),(&("\xff" "append")[1]),(&("\xff" "stream")[1]),(&("\xff" "target")[1]),(&("\xff" "prepend")[1]),(&("\xff" "replace")[1]),(&("\xff" "remove")[1]),(&("\xff" "delete")[1]),(&("\xff" "comments_count")[1]),(&("\xff" "length")[1]),(&("\xff" "patch")[1]),(&("\xff" "post")[1]),(&("\xff" "error")[1]),(&("\xff" "title")[1]),(&("\xff" "a")[1]),(&("\xff" "article_id")[1]),(&("\xff" "commenter")[1]),(&("\xff" "c")[1]),(&("\xff" "head")[1]),(&("\xff" "data-turbo-track")[1]),(&("\xff" "article")[1]),(&("\xff" "index")[1]),(&("\xff" "show")[1]),(&("\xff" "new")[1]),(&("\xff" "edit")[1]),(&("\xff" "create")[1]),(&("\xff" "update")[1]),(&("\xff" "destroy")[1]),(&("\xff" "json")[1]),(&("\xff" "articles")[1]),(&("\xff" "comments")[1]),(&("\xff" "sql")[1]),(&("\xff" "success")[1]),(&("\xff" "redirect")[1]),(&("\xff" "missing")[1]),(&("\xff" "minimum")[1])}; | |
| static const char *sp_sym_to_s(sp_sym id) __attribute__((unused)); | |
| static const char *sp_sym_to_s(sp_sym id){if(id>=0&&id<SP_SYM_COUNT)return sp_sym_names[id];return "";} | |
| #define SPS_OK ((sp_sym)0) | |
| #define SPS_ROW ((sp_sym)1) | |
| #define SPS_DONE ((sp_sym)2) | |
| #define SPS_sqlite3_open ((sp_sym)3) | |
| #define SPS_str ((sp_sym)4) | |
| #define SPS_ptr ((sp_sym)5) | |
| #define SPS_int ((sp_sym)6) | |
| #define SPS_sqlite3_close ((sp_sym)7) | |
| #define SPS_sqlite3_exec ((sp_sym)8) | |
| #define SPS_sqlite3_prepare_v2 ((sp_sym)9) | |
| #define SPS_sqlite3_step ((sp_sym)10) | |
| #define SPS_sqlite3_finalize ((sp_sym)11) | |
| #define SPS_sqlite3_reset ((sp_sym)12) | |
| #define SPS_sqlite3_clear_bindings ((sp_sym)13) | |
| #define SPS_sqlite3_column_int ((sp_sym)14) | |
| #define SPS_sqlite3_column_text ((sp_sym)15) | |
| #define SPS_sqlite3_column_count ((sp_sym)16) | |
| #define SPS_sqlite3_column_name ((sp_sym)17) | |
| #define SPS_sqlite3_errmsg ((sp_sym)18) | |
| #define SPS_sqlite3_last_insert_rowid ((sp_sym)19) | |
| #define SPS_long ((sp_sym)20) | |
| #define SPS_sqlite3_changes ((sp_sym)21) | |
| #define SPS_db_out ((sp_sym)22) | |
| #define SPS_stmt_out ((sp_sym)23) | |
| #define SPS_read_ptr ((sp_sym)24) | |
| #define SPS_db_conn ((sp_sym)25) | |
| #define SPS_opt ((sp_sym)26) | |
| #define SPS_i ((sp_sym)27) | |
| #define SPS_record ((sp_sym)28) | |
| #define SPS_size ((sp_sym)29) | |
| #define SPS_free ((sp_sym)30) | |
| #define SPS_adapter ((sp_sym)31) | |
| #define SPS_id ((sp_sym)32) | |
| #define SPS_row ((sp_sym)33) | |
| #define SPS_r ((sp_sym)34) | |
| #define SPS_updated_at ((sp_sym)35) | |
| #define SPS_created_at ((sp_sym)36) | |
| #define SPS_verb ((sp_sym)37) | |
| #define SPS_pattern ((sp_sym)38) | |
| #define SPS_controller ((sp_sym)39) | |
| #define SPS_action ((sp_sym)40) | |
| #define SPS_path_params ((sp_sym)41) | |
| #define SPS_notice ((sp_sym)42) | |
| #define SPS_alert ((sp_sym)43) | |
| #define SPS_k ((sp_sym)44) | |
| #define SPS_v ((sp_sym)45) | |
| #define SPS___body__ ((sp_sym)46) | |
| #define SPS_href ((sp_sym)47) | |
| #define SPS_method ((sp_sym)48) | |
| #define SPS_form_class ((sp_sym)49) | |
| #define SPS_class ((sp_sym)50) | |
| #define SPS_type ((sp_sym)51) | |
| #define SPS_rel ((sp_sym)52) | |
| #define SPS_p ((sp_sym)53) | |
| #define SPS_name ((sp_sym)54) | |
| #define SPS_path ((sp_sym)55) | |
| #define SPS_inner_k ((sp_sym)56) | |
| #define SPS_inner_v ((sp_sym)57) | |
| #define SPS_ok ((sp_sym)58) | |
| #define SPS_created ((sp_sym)59) | |
| #define SPS_accepted ((sp_sym)60) | |
| #define SPS_no_content ((sp_sym)61) | |
| #define SPS_moved_permanently ((sp_sym)62) | |
| #define SPS_found ((sp_sym)63) | |
| #define SPS_see_other ((sp_sym)64) | |
| #define SPS_not_modified ((sp_sym)65) | |
| #define SPS_bad_request ((sp_sym)66) | |
| #define SPS_unauthorized ((sp_sym)67) | |
| #define SPS_forbidden ((sp_sym)68) | |
| #define SPS_not_found ((sp_sym)69) | |
| #define SPS_unprocessable_entity ((sp_sym)70) | |
| #define SPS_unprocessable_content ((sp_sym)71) | |
| #define SPS_internal_server_error ((sp_sym)72) | |
| #define SPS_params ((sp_sym)73) | |
| #define SPS_session ((sp_sym)74) | |
| #define SPS_flash ((sp_sym)75) | |
| #define SPS_request_method ((sp_sym)76) | |
| #define SPS_request_path ((sp_sym)77) | |
| #define SPS_request_format ((sp_sym)78) | |
| #define SPS_status ((sp_sym)79) | |
| #define SPS_body ((sp_sym)80) | |
| #define SPS_location ((sp_sym)81) | |
| #define SPS_content_type ((sp_sym)82) | |
| #define SPS_html ((sp_sym)83) | |
| #define SPS_append ((sp_sym)84) | |
| #define SPS_stream ((sp_sym)85) | |
| #define SPS_target ((sp_sym)86) | |
| #define SPS_prepend ((sp_sym)87) | |
| #define SPS_replace ((sp_sym)88) | |
| #define SPS_remove ((sp_sym)89) | |
| #define SPS_delete ((sp_sym)90) | |
| #define SPS_comments_count ((sp_sym)91) | |
| #define SPS_length ((sp_sym)92) | |
| #define SPS_patch ((sp_sym)93) | |
| #define SPS_post ((sp_sym)94) | |
| #define SPS_error ((sp_sym)95) | |
| #define SPS_title ((sp_sym)96) | |
| #define SPS_a ((sp_sym)97) | |
| #define SPS_article_id ((sp_sym)98) | |
| #define SPS_commenter ((sp_sym)99) | |
| #define SPS_c ((sp_sym)100) | |
| #define SPS_head ((sp_sym)101) | |
| #define SPS_article ((sp_sym)103) | |
| #define SPS_index ((sp_sym)104) | |
| #define SPS_show ((sp_sym)105) | |
| #define SPS_new ((sp_sym)106) | |
| #define SPS_edit ((sp_sym)107) | |
| #define SPS_create ((sp_sym)108) | |
| #define SPS_update ((sp_sym)109) | |
| #define SPS_destroy ((sp_sym)110) | |
| #define SPS_json ((sp_sym)111) | |
| #define SPS_articles ((sp_sym)112) | |
| #define SPS_comments ((sp_sym)113) | |
| #define SPS_sql ((sp_sym)114) | |
| #define SPS_success ((sp_sym)115) | |
| #define SPS_redirect ((sp_sym)116) | |
| #define SPS_missing ((sp_sym)117) | |
| #define SPS_minimum ((sp_sym)118) | |
| typedef struct{sp_sym*keys;mrb_int*vals;sp_sym*order;mrb_int len;mrb_int cap;mrb_int mask;mrb_int default_v;}sp_SymIntHash; | |
| static void sp_SymIntHash_fin(void*p){sp_SymIntHash*h=(sp_SymIntHash*)p;free(h->keys);free(h->vals);free(h->order);} | |
| static sp_SymIntHash*sp_SymIntHash_new(void){sp_SymIntHash*h=(sp_SymIntHash*)sp_gc_alloc(sizeof(sp_SymIntHash),sp_SymIntHash_fin,NULL);h->cap=16;h->mask=15;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(mrb_int*)calloc(h->cap,sizeof(mrb_int));h->order=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);h->len=0;h->default_v=0;return h;} | |
| static sp_SymIntHash*sp_SymIntHash_new_with_default(mrb_int d){sp_SymIntHash*h=sp_SymIntHash_new();h->default_v=d;return h;} | |
| static void sp_SymIntHash_grow(sp_SymIntHash*h){mrb_int oc=h->cap;sp_sym*ok=h->keys;mrb_int*ov=h->vals;h->cap*=2;h->mask=h->cap-1;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(mrb_int*)calloc(h->cap,sizeof(mrb_int));h->order=(sp_sym*)realloc(h->order,sizeof(sp_sym)*h->cap);h->len=0;for(mrb_int i=0;i<oc;i++){if(ok[i]>=0){mrb_int idx=(mrb_int)(((mrb_int)ok[i])&h->mask);while(h->keys[idx]>=0)idx=(idx+1)&h->mask;h->keys[idx]=ok[i];h->vals[idx]=ov[i];h->len++;}}free(ok);free(ov);} | |
| static mrb_int sp_SymIntHash_get(sp_SymIntHash*h,sp_sym k){if(!h)return 0;mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return h->vals[idx];idx=(idx+1)&h->mask;}return h->default_v;} | |
| static void sp_SymIntHash_set(sp_SymIntHash*h,sp_sym k,mrb_int v){if(h->len*2>=h->cap)sp_SymIntHash_grow(h);mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->vals[idx]=v;return;}idx=(idx+1)&h->mask;}h->keys[idx]=k;h->vals[idx]=v;h->order[h->len]=k;h->len++;} | |
| static mrb_bool sp_SymIntHash_has_key(sp_SymIntHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return TRUE;idx=(idx+1)&h->mask;}return FALSE;} | |
| static mrb_bool sp_SymIntHash_has_value(sp_SymIntHash*h,mrb_int v){for(mrb_int i=0;i<h->len;i++)if(sp_SymIntHash_get(h,h->order[i])==v)return TRUE;return FALSE;} | |
| static mrb_int sp_SymIntHash_length(sp_SymIntHash*h){return h->len;} | |
| static void sp_SymIntHash_delete(sp_SymIntHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->keys[idx]=-1;h->vals[idx]=0;h->len--;mrb_int j=(idx+1)&h->mask;while(h->keys[j]>=0){mrb_int nj=(mrb_int)(((mrb_int)h->keys[j])&h->mask);if((j>idx&&(nj<=idx||nj>j))||(j<idx&&nj<=idx&&nj>j)){h->keys[idx]=h->keys[j];h->vals[idx]=h->vals[j];h->keys[j]=-1;h->vals[j]=0;idx=j;}j=(j+1)&h->mask;}{mrb_int oi=0;while(oi<=h->len){if(h->order[oi]==k){while(oi<h->len){h->order[oi]=h->order[oi+1];oi++;}break;}oi++;}}return;}idx=(idx+1)&h->mask;}} | |
| static sp_IntArray*sp_SymIntHash_keys(sp_SymIntHash*h){sp_IntArray*a=sp_IntArray_new();for(mrb_int i=0;i<h->len;i++)sp_IntArray_push(a,(mrb_int)h->order[i]);return a;} | |
| static sp_IntArray*sp_SymIntHash_values(sp_SymIntHash*h){sp_IntArray*a=sp_IntArray_new();for(mrb_int i=0;i<h->len;i++)sp_IntArray_push(a,sp_SymIntHash_get(h,h->order[i]));return a;} | |
| static sp_SymIntHash*sp_SymIntHash_dup(sp_SymIntHash*h){sp_SymIntHash*r=sp_SymIntHash_new();r->default_v=h->default_v;for(mrb_int i=0;i<h->len;i++)sp_SymIntHash_set(r,h->order[i],sp_SymIntHash_get(h,h->order[i]));return r;} | |
| static sp_PolyArray*sp_SymIntHash_to_a(sp_SymIntHash*h){sp_PolyArray*r=sp_PolyArray_new();for(mrb_int i=0;i<h->len;i++){sp_PolyArray*p=sp_PolyArray_new();sp_PolyArray_push(p,sp_box_sym(h->order[i]));sp_PolyArray_push(p,sp_box_int(sp_SymIntHash_get(h,h->order[i])));sp_PolyArray_push(r,sp_box_poly_array(p));}return r;} | |
| static sp_PolyPolyHash*sp_SymIntHash_invert(sp_SymIntHash*h){sp_PolyPolyHash*r=sp_PolyPolyHash_new();for(mrb_int i=0;i<h->len;i++)sp_PolyPolyHash_set(r,sp_box_int(sp_SymIntHash_get(h,h->order[i])),sp_box_sym(h->order[i]));return r;} | |
| static sp_SymIntHash*sp_SymIntHash_merge(sp_SymIntHash*a,sp_SymIntHash*b){sp_SymIntHash*r=sp_SymIntHash_new();r->default_v=a->default_v;for(mrb_int i=0;i<a->len;i++)sp_SymIntHash_set(r,a->order[i],sp_SymIntHash_get(a,a->order[i]));if(b){for(mrb_int i=0;i<b->len;i++)sp_SymIntHash_set(r,b->order[i],sp_SymIntHash_get(b,b->order[i]));}return r;} | |
| static mrb_bool sp_SymIntHash_eq(sp_SymIntHash*a,sp_SymIntHash*b){if(!a||!b)return a==b;if(a->len!=b->len)return FALSE;for(mrb_int i=0;i<a->len;i++){sp_sym k=a->order[i];if(!sp_SymIntHash_has_key(b,k))return FALSE;if(sp_SymIntHash_get(a,k)!=sp_SymIntHash_get(b,k))return FALSE;}return TRUE;} | |
| static const char*sp_SymIntHash_inspect(sp_SymIntHash*h){sp_String*s=sp_String_new("{");for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(s,", ");sp_String_append(s,sp_sym_to_s(h->order[i]));sp_String_append(s,": ");sp_String_append(s,sp_int_to_s(sp_SymIntHash_get(h,h->order[i])));}sp_String_append(s,"}");return s->data;} | |
| static const char*sp_SymIntHash_json(sp_SymIntHash*h) __attribute__((unused)); | |
| static const char*sp_SymIntHash_json(sp_SymIntHash*h){sp_String*o=sp_String_new("{");SP_GC_ROOT(o);if(h){for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(o,",");sp_String_append(o,sp_json_str(sp_sym_to_s(h->order[i])));sp_String_append(o,":");sp_String_append(o,sp_int_to_s(sp_SymIntHash_get(h,h->order[i])));}}sp_String_append(o,"}");return o->data;} | |
| static mrb_int sp_SymIntHash_proc_fn(void*cap,mrb_int*args){return sp_SymIntHash_get((sp_SymIntHash*)cap,(sp_sym)args[0]);} | |
| static sp_SymIntHash*sp_SymArray_tally(sp_IntArray*a){sp_SymIntHash*h=sp_SymIntHash_new();for(mrb_int i=0;i<a->len;i++){sp_sym k=(sp_sym)a->data[a->start+i];sp_SymIntHash_set(h,k,sp_SymIntHash_get(h,k)+1);}return h;} | |
| static sp_SymPolyHash*sp_SymPolyHash_merge_int(sp_SymPolyHash*a,sp_SymIntHash*b){sp_SymPolyHash*r=sp_SymPolyHash_new();for(mrb_int i=0;i<a->len;i++)sp_SymPolyHash_set(r,a->order[i],sp_SymPolyHash_get(a,a->order[i]));for(mrb_int i=0;i<b->len;i++)sp_SymPolyHash_set(r,b->order[i],sp_box_int(sp_SymIntHash_get(b,b->order[i])));return r;} | |
| static sp_SymPolyHash*sp_SymIntHash_to_sym_poly(sp_SymIntHash*h){sp_SymPolyHash*r=sp_SymPolyHash_new();for(mrb_int i=0;i<h->len;i++)sp_SymPolyHash_set(r,h->order[i],sp_box_int(sp_SymIntHash_get(h,h->order[i])));return r;} | |
| typedef struct{sp_sym*keys;const char**vals;sp_sym*order;mrb_int len;mrb_int cap;mrb_int mask;const char*default_v;}sp_SymStrHash; | |
| static void sp_SymStrHash_fin(void*p){sp_SymStrHash*h=(sp_SymStrHash*)p;free(h->keys);free(h->vals);free(h->order);} | |
| static sp_SymStrHash*sp_SymStrHash_new(void){sp_SymStrHash*h=(sp_SymStrHash*)sp_gc_alloc(sizeof(sp_SymStrHash),sp_SymStrHash_fin,NULL);h->cap=16;h->mask=15;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(const char**)calloc(h->cap,sizeof(const char*));h->order=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);h->len=0;h->default_v=NULL;return h;} | |
| static sp_SymStrHash*sp_SymStrHash_new_with_default(const char*d){sp_SymStrHash*h=sp_SymStrHash_new();h->default_v=d;return h;} | |
| static void sp_SymStrHash_grow(sp_SymStrHash*h){mrb_int oc=h->cap;sp_sym*ok=h->keys;const char**ov=h->vals;h->cap*=2;h->mask=h->cap-1;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(const char**)calloc(h->cap,sizeof(const char*));h->order=(sp_sym*)realloc(h->order,sizeof(sp_sym)*h->cap);h->len=0;for(mrb_int i=0;i<oc;i++){if(ok[i]>=0){mrb_int idx=(mrb_int)(((mrb_int)ok[i])&h->mask);while(h->keys[idx]>=0)idx=(idx+1)&h->mask;h->keys[idx]=ok[i];h->vals[idx]=ov[i];h->len++;}}free(ok);free(ov);} | |
| static const char*sp_SymStrHash_get(sp_SymStrHash*h,sp_sym k){if(!h)return NULL;mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return h->vals[idx];idx=(idx+1)&h->mask;}return h->default_v;} | |
| static void sp_SymStrHash_set(sp_SymStrHash*h,sp_sym k,const char*v){if(h->len*2>=h->cap)sp_SymStrHash_grow(h);mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->vals[idx]=v;return;}idx=(idx+1)&h->mask;}h->keys[idx]=k;h->vals[idx]=v;h->order[h->len]=k;h->len++;} | |
| static mrb_bool sp_SymStrHash_has_key(sp_SymStrHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return TRUE;idx=(idx+1)&h->mask;}return FALSE;} | |
| static mrb_int sp_SymStrHash_length(sp_SymStrHash*h){return h->len;} | |
| static void sp_SymStrHash_delete(sp_SymStrHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->keys[idx]=-1;h->vals[idx]=NULL;h->len--;mrb_int j=(idx+1)&h->mask;while(h->keys[j]>=0){mrb_int nj=(mrb_int)(((mrb_int)h->keys[j])&h->mask);if((j>idx&&(nj<=idx||nj>j))||(j<idx&&nj<=idx&&nj>j)){h->keys[idx]=h->keys[j];h->vals[idx]=h->vals[j];h->keys[j]=-1;h->vals[j]=NULL;idx=j;}j=(j+1)&h->mask;}{mrb_int oi=0;while(oi<=h->len){if(h->order[oi]==k){while(oi<h->len){h->order[oi]=h->order[oi+1];oi++;}break;}oi++;}}return;}idx=(idx+1)&h->mask;}} | |
| static sp_IntArray*sp_SymStrHash_keys(sp_SymStrHash*h){sp_IntArray*a=sp_IntArray_new();for(mrb_int i=0;i<h->len;i++)sp_IntArray_push(a,(mrb_int)h->order[i]);return a;} | |
| static sp_StrArray*sp_SymStrHash_values(sp_SymStrHash*h){sp_StrArray*a=sp_StrArray_new();for(mrb_int i=0;i<h->len;i++)sp_StrArray_push(a,sp_SymStrHash_get(h,h->order[i]));return a;} | |
| static mrb_bool sp_SymStrHash_has_value(sp_SymStrHash*h,const char*v){if(!h||!v)return FALSE;for(mrb_int i=0;i<h->len;i++){const char*x=sp_SymStrHash_get(h,h->order[i]);if(x&&strcmp(x,v)==0)return TRUE;}return FALSE;} | |
| static sp_SymStrHash*sp_SymStrHash_dup(sp_SymStrHash*h){sp_SymStrHash*r=sp_SymStrHash_new();r->default_v=h->default_v;for(mrb_int i=0;i<h->len;i++)sp_SymStrHash_set(r,h->order[i],sp_SymStrHash_get(h,h->order[i]));return r;} | |
| static sp_PolyArray*sp_SymStrHash_to_a(sp_SymStrHash*h){sp_PolyArray*r=sp_PolyArray_new();for(mrb_int i=0;i<h->len;i++){sp_PolyArray*p=sp_PolyArray_new();sp_PolyArray_push(p,sp_box_sym(h->order[i]));sp_PolyArray_push(p,sp_box_str(sp_SymStrHash_get(h,h->order[i])));sp_PolyArray_push(r,sp_box_poly_array(p));}return r;} | |
| static sp_PolyPolyHash*sp_SymStrHash_invert(sp_SymStrHash*h){sp_PolyPolyHash*r=sp_PolyPolyHash_new();for(mrb_int i=0;i<h->len;i++)sp_PolyPolyHash_set(r,sp_box_str(sp_SymStrHash_get(h,h->order[i])),sp_box_sym(h->order[i]));return r;} | |
| static sp_SymStrHash*sp_SymStrHash_merge(sp_SymStrHash*a,sp_SymStrHash*b){sp_SymStrHash*r=sp_SymStrHash_new();r->default_v=a->default_v;for(mrb_int i=0;i<a->len;i++)sp_SymStrHash_set(r,a->order[i],sp_SymStrHash_get(a,a->order[i]));for(mrb_int i=0;i<b->len;i++)sp_SymStrHash_set(r,b->order[i],sp_SymStrHash_get(b,b->order[i]));return r;} | |
| static mrb_bool sp_SymStrHash_eq(sp_SymStrHash*a,sp_SymStrHash*b){if(!a||!b)return a==b;if(a->len!=b->len)return FALSE;for(mrb_int i=0;i<a->len;i++){sp_sym k=a->order[i];if(!sp_SymStrHash_has_key(b,k))return FALSE;if(!sp_str_eq(sp_SymStrHash_get(a,k),sp_SymStrHash_get(b,k)))return FALSE;}return TRUE;} | |
| static const char*sp_SymStrHash_inspect(sp_SymStrHash*h){sp_String*s=sp_String_new("{");if(h){for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(s,", ");sp_String_append(s,sp_sym_to_s(h->order[i]));sp_String_append(s,": ");sp_String_append(s,sp_str_inspect(sp_SymStrHash_get(h,h->order[i])));}}sp_String_append(s,"}");return s->data;} | |
| static const char*sp_SymStrHash_json(sp_SymStrHash*h) __attribute__((unused)); | |
| static const char*sp_SymStrHash_json(sp_SymStrHash*h){sp_String*o=sp_String_new("{");SP_GC_ROOT(o);if(h){for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(o,",");sp_String_append(o,sp_json_str(sp_sym_to_s(h->order[i])));sp_String_append(o,":");sp_String_append(o,sp_json_str(sp_SymStrHash_get(h,h->order[i])));}}sp_String_append(o,"}");return o->data;} | |
| static sp_SymPolyHash*sp_SymStrHash_to_sym_poly(sp_SymStrHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_SymPolyHash*r=sp_SymPolyHash_new();SP_GC_ROOT(r);for(mrb_int i=0;i<h->len;i++)sp_SymPolyHash_set(r,h->order[i],sp_box_str(sp_SymStrHash_get(h,h->order[i])));return r;} | |
| static sp_SymPolyHash*sp_SymPolyHash_merge_str(sp_SymPolyHash*a,sp_SymStrHash*b){SP_GC_SAVE();SP_GC_ROOT(a);SP_GC_ROOT(b);sp_SymPolyHash*r=sp_SymPolyHash_new();SP_GC_ROOT(r);for(mrb_int i=0;i<a->len;i++)sp_SymPolyHash_set(r,a->order[i],sp_SymPolyHash_get(a,a->order[i]));for(mrb_int i=0;i<b->len;i++)sp_SymPolyHash_set(r,b->order[i],sp_box_str(sp_SymStrHash_get(b,b->order[i])));return r;} | |
| static sp_StrPolyHash*sp_StrPolyHash_from_sym_int_hash(sp_SymIntHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_StrPolyHash*r=sp_StrPolyHash_new();SP_GC_ROOT(r);if(!h)return r;r->default_v=sp_box_int(h->default_v);for(mrb_int i=0;i<h->len;i++){sp_sym k=h->order[i];sp_StrPolyHash_set(r,sp_sym_to_s(k),sp_box_int(sp_SymIntHash_get(h,k)));}return r;} | |
| static sp_StrPolyHash*sp_StrPolyHash_from_sym_str_hash(sp_SymStrHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_StrPolyHash*r=sp_StrPolyHash_new();SP_GC_ROOT(r);if(!h)return r;if(h->default_v)r->default_v=sp_box_str(h->default_v);for(mrb_int i=0;i<h->len;i++){sp_sym k=h->order[i];sp_StrPolyHash_set(r,sp_sym_to_s(k),sp_box_str(sp_SymStrHash_get(h,k)));}return r;} | |
| static sp_StrPolyHash*sp_StrPolyHash_from_sym_poly_hash(sp_SymPolyHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_StrPolyHash*r=sp_StrPolyHash_new();SP_GC_ROOT(r);if(!h)return r;r->default_v=h->default_v;for(mrb_int i=0;i<h->len;i++){sp_sym k=h->order[i];sp_StrPolyHash_set(r,sp_sym_to_s(k),sp_SymPolyHash_get(h,k));}return r;} | |
| /* ---- FFI externs ---- */ | |
| #include <stdint.h> | |
| #include <stddef.h> | |
| /* SPINEL_LINK: -lsqlite3 */ | |
| extern int sqlite3_open(const char *, void *); | |
| extern int sqlite3_close(void *); | |
| extern int sqlite3_exec(void *, const char *, void *, void *, void *); | |
| extern int sqlite3_prepare_v2(void *, const char *, int, void *, void *); | |
| extern int sqlite3_step(void *); | |
| extern int sqlite3_finalize(void *); | |
| extern int sqlite3_reset(void *); | |
| extern int sqlite3_clear_bindings(void *); | |
| extern int sqlite3_column_int(void *, int); | |
| extern const char * sqlite3_column_text(void *, int); | |
| extern int sqlite3_column_count(void *); | |
| extern const char * sqlite3_column_name(void *, int); | |
| extern const char * sqlite3_errmsg(void *); | |
| extern long sqlite3_last_insert_rowid(void *); | |
| extern int sqlite3_changes(void *); | |
| static char sp_ffi_buf_SQL_db_out[8]; | |
| static char sp_ffi_buf_SQL_stmt_out[8]; | |
| static mrb_regexp_pattern *sp_re_pat_0; | |
| static const char *sp_re_pat_err_0 = NULL; | |
| static mrb_regexp_pattern *sp_re_pat_1; | |
| static const char *sp_re_pat_err_1 = NULL; | |
| static mrb_regexp_pattern *sp_re_pat_2; | |
| static const char *sp_re_pat_err_2 = NULL; | |
| static void sp_re_init(void) { | |
| sp_re_set_error_handler(sp_re_startup_error_handler); | |
| sp_re_startup_err = NULL; | |
| if (setjmp(sp_re_startup_jmp) == 0) { | |
| sp_re_pat_0 = re_compile("[&<>\"']", 7, 0); | |
| } else { | |
| sp_re_pat_0 = NULL; | |
| sp_re_pat_err_0 = sp_re_startup_err; | |
| } | |
| sp_re_startup_err = NULL; | |
| if (setjmp(sp_re_startup_jmp) == 0) { | |
| sp_re_pat_1 = re_compile("[\\\\\"\\n\\r\\t\\x08\\f]", 17, 0); | |
| } else { | |
| sp_re_pat_1 = NULL; | |
| sp_re_pat_err_1 = sp_re_startup_err; | |
| } | |
| sp_re_startup_err = NULL; | |
| if (setjmp(sp_re_startup_jmp) == 0) { | |
| sp_re_pat_2 = re_compile("\\A[a-z]+", 8, 0); | |
| } else { | |
| sp_re_pat_2 = NULL; | |
| sp_re_pat_err_2 = sp_re_startup_err; | |
| } | |
| sp_re_set_error_handler(sp_re_default_error_handler); | |
| } | |
| static mrb_regexp_pattern *sp_re_dyn_0(const char *new_pat) { | |
| static char *cached_str = NULL; | |
| static mrb_regexp_pattern *cached_pat = NULL; | |
| if (cached_str != NULL && strcmp(cached_str, new_pat) == 0) return cached_pat; | |
| re_free(cached_pat); | |
| free(cached_str); | |
| cached_str = strdup(new_pat); | |
| cached_pat = re_compile(new_pat, (int64_t)strlen(new_pat), 0); | |
| return cached_pat; | |
| } | |
| static mrb_regexp_pattern *sp_re_dyn_1(const char *new_pat) { | |
| static char *cached_str = NULL; | |
| static mrb_regexp_pattern *cached_pat = NULL; | |
| if (cached_str != NULL && strcmp(cached_str, new_pat) == 0) return cached_pat; | |
| re_free(cached_pat); | |
| free(cached_str); | |
| cached_str = strdup(new_pat); | |
| cached_pat = re_compile(new_pat, (int64_t)strlen(new_pat), 0); | |
| return cached_pat; | |
| } | |
| static mrb_regexp_pattern *sp_re_dyn_2(const char *new_pat) { | |
| static char *cached_str = NULL; | |
| static mrb_regexp_pattern *cached_pat = NULL; | |
| if (cached_str != NULL && strcmp(cached_str, new_pat) == 0) return cached_pat; | |
| re_free(cached_pat); | |
| free(cached_str); | |
| cached_str = strdup(new_pat); | |
| cached_pat = re_compile(new_pat, (int64_t)strlen(new_pat), 0); | |
| return cached_pat; | |
| } | |
| /* sp_Class names table */ | |
| #define SP_CLASS_COUNT 137 | |
| static const char *const sp_class_names[137] = {(&("\xff" "BasicObject")[1]),(&("\xff" "Object")[1]),(&("\xff" "Kernel")[1]),(&("\xff" "Comparable")[1]),(&("\xff" "Enumerable")[1]),(&("\xff" "NilClass")[1]),(&("\xff" "TrueClass")[1]),(&("\xff" "FalseClass")[1]),(&("\xff" "Numeric")[1]),(&("\xff" "Integer")[1]),(&("\xff" "Float")[1]),(&("\xff" "String")[1]),(&("\xff" "Symbol")[1]),(&("\xff" "Array")[1]),(&("\xff" "Hash")[1]),(&("\xff" "Range")[1]),(&("\xff" "Time")[1]),(&("\xff" "Module")[1]),(&("\xff" "Class")[1]),(&("\xff" "Complex")[1]),(&("\xff" "Proc")[1]),(&("\xff" "Exception")[1]),(&("\xff" "StandardError")[1]),(&("\xff" "RuntimeError")[1]),(&("\xff" "ArgumentError")[1]),(&("\xff" "TypeError")[1]),(&("\xff" "IndexError")[1]),(&("\xff" "KeyError")[1]),(&("\xff" "RangeError")[1]),(&("\xff" "FloatDomainError")[1]),(&("\xff" "NameError")[1]),(&("\xff" "NoMethodError")[1]),(&("\xff" "ZeroDivisionError")[1]),(&("\xff" "IOError")[1]),(&("\xff" "EOFError")[1]),(&("\xff" "FrozenError")[1]),(&("\xff" "ScriptError")[1]),(&("\xff" "NotImplementedError")[1]),(&("\xff" "LoadError")[1]),(&("\xff" "SyntaxError")[1]),(&("\xff" "StopIteration")[1]),(&("\xff" "RegexpError")[1]),(&("\xff" "EncodingError")[1]),(&("\xff" "SystemCallError")[1]),(&("\xff" "LocalJumpError")[1]),(&("\xff" "FiberError")[1]),(&("\xff" "Encoding")[1]),(&("\xff" "ActiveRecord::RecordNotFound")[1]),(&("\xff" "ActiveRecord::RecordInvalid")[1]),(&("\xff" "ActiveRecord::ConnectionAdapters::ConnectionPool")[1]),(&("\xff" "ActiveRecord::Base")[1]),(&("\xff" "ActionDispatch::Router::Route")[1]),(&("\xff" "ActionDispatch::Router::MatchResult")[1]),(&("\xff" "ActionDispatch::Flash")[1]),(&("\xff" "ActionDispatch::Session")[1]),(&("\xff" "ActionView::Slots")[1]),(&("\xff" "ActionController::Base")[1]),(&("\xff" "Broadcasts::SeedTransport")[1]),(&("\xff" "ActionDispatch::IntegrationTest")[1]),(&("\xff" "Stmt")[1]),(&("\xff" "DbConn")[1]),(&("\xff" "DbPool")[1]),(&("\xff" "ApplicationController")[1]),(&("\xff" "ApplicationRecord")[1]),(&("\xff" "CommentRow")[1]),(&("\xff" "Comment")[1]),(&("\xff" "ArticleRow")[1]),(&("\xff" "Article")[1]),(&("\xff" "ArticleParams")[1]),(&("\xff" "ArticlesController")[1]),(&("\xff" "CommentParams")[1]),(&("\xff" "CommentsController")[1]),(&("\xff" "ActionResponse")[1]),(&("\xff" "TestBase")[1]),(&("\xff" "ArticlesControllerTest")[1]),(&("\xff" "Method")[1]),(&("\xff" "Article::_implicit_6872")[1]),(&("\xff" "Article::_implicit_6906")[1]),(&("\xff" "Article::_implicit_7484")[1]),(&("\xff" "Article::_implicit_7995")[1]),(&("\xff" "Article::_implicit_9355")[1]),(&("\xff" "Article::_implicit_9372")[1]),(&("\xff" "Base64")[1]),(&("\xff" "JSON")[1]),(&("\xff" "SQL")[1]),(&("\xff" "Db")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "ActiveRecord::ConnectionAdapters")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "ActiveRecord::Registry")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "Schema")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "ActionDispatch::Router")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "ActionView")[1]),(&("\xff" "ActionView")[1]),(&("\xff" "ActionView::ViewHelpers")[1]),(&("\xff" "ActionController")[1]),(&("\xff" "JsonBuilder")[1]),(&("\xff" "Broadcasts")[1]),(&("\xff" "Importmap")[1]),(&("\xff" "Importmap")[1]),(&("\xff" "RouteHelpers")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Comments")[1]),(&("\xff" "Inflector")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Layouts")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Routes")[1]),(&("\xff" "SchemaSetup")[1]),(&("\xff" "FixtureLoader")[1]),(&("\xff" "RequestDispatch")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "RequestDispatch")[1]),(&("\xff" "ArticlesFixtures")[1]),(&("\xff" "CommentsFixtures")[1])}; | |
| static const char *sp_class_to_s(sp_Class c) __attribute__((unused)); | |
| static const char *sp_class_to_s(sp_Class c){if(c.cls_id>=0&&c.cls_id<SP_CLASS_COUNT)return sp_class_names[c.cls_id];return "";} | |
| static mrb_bool sp_class_eq(sp_Class a, sp_Class b) __attribute__((unused)); | |
| static mrb_bool sp_class_eq(sp_Class a, sp_Class b){return a.cls_id == b.cls_id;} | |
| #define SP_USER_MODULE_BASE 82 | |
| static mrb_bool sp_class_is_module(sp_Class c) __attribute__((unused)); | |
| static mrb_bool sp_class_is_module(sp_Class c){return c.cls_id >= SP_USER_MODULE_BASE;} | |
| static const mrb_int sp_class_ancestors_off[138] __attribute__((unused)) = {0LL,1LL,4LL,5LL,6LL,7LL,11LL,15LL,19LL,24LL,30LL,36LL,41LL,46LL,51LL,56LL,61LL,66LL,70LL,75LL,81LL,85LL,89LL,94LL,100LL,106LL,112LL,118LL,125LL,131LL,138LL,144LL,151LL,157LL,163LL,170LL,177LL,182LL,188LL,194LL,200LL,207LL,213LL,219LL,225LL,231LL,237LL,241LL,247LL,253LL,254LL,255LL,256LL,257LL,258LL,259LL,260LL,261LL,262LL,265LL,266LL,267LL,268LL,270LL,272LL,273LL,276LL,277LL,280LL,281LL,284LL,285LL,288LL,289LL,290LL,294LL,295LL,298LL,301LL,304LL,307LL,310LL,313LL,314LL,315LL,316LL,317LL,318LL,319LL,320LL,321LL,322LL,323LL,324LL,325LL,326LL,327LL,328LL,329LL,330LL,331LL,332LL,333LL,334LL,335LL,336LL,337LL,338LL,339LL,340LL,341LL,342LL,343LL,344LL,345LL,346LL,347LL,348LL,349LL,350LL,351LL,352LL,353LL,354LL,355LL,356LL,357LL,358LL,359LL,360LL,361LL,362LL,363LL,364LL,365LL,366LL,367LL,368LL}; | |
| static const mrb_int sp_class_ancestors_flat[368] __attribute__((unused)) = {0LL,1LL,2LL,0LL,2LL,3LL,4LL,5LL,1LL,2LL,0LL,6LL,1LL,2LL,0LL,7LL,1LL,2LL,0LL,8LL,3LL,1LL,2LL,0LL,9LL,8LL,3LL,1LL,2LL,0LL,10LL,8LL,3LL,1LL,2LL,0LL,11LL,3LL,1LL,2LL,0LL,12LL,3LL,1LL,2LL,0LL,13LL,4LL,1LL,2LL,0LL,14LL,4LL,1LL,2LL,0LL,15LL,4LL,1LL,2LL,0LL,16LL,3LL,1LL,2LL,0LL,17LL,1LL,2LL,0LL,18LL,17LL,1LL,2LL,0LL,19LL,8LL,3LL,1LL,2LL,0LL,20LL,1LL,2LL,0LL,21LL,1LL,2LL,0LL,22LL,21LL,1LL,2LL,0LL,23LL,22LL,21LL,1LL,2LL,0LL,24LL,22LL,21LL,1LL,2LL,0LL,25LL,22LL,21LL,1LL,2LL,0LL,26LL,22LL,21LL,1LL,2LL,0LL,27LL,26LL,22LL,21LL,1LL,2LL,0LL,28LL,22LL,21LL,1LL,2LL,0LL,29LL,28LL,22LL,21LL,1LL,2LL,0LL,30LL,22LL,21LL,1LL,2LL,0LL,31LL,30LL,22LL,21LL,1LL,2LL,0LL,32LL,22LL,21LL,1LL,2LL,0LL,33LL,22LL,21LL,1LL,2LL,0LL,34LL,33LL,22LL,21LL,1LL,2LL,0LL,35LL,23LL,22LL,21LL,1LL,2LL,0LL,36LL,21LL,1LL,2LL,0LL,37LL,36LL,21LL,1LL,2LL,0LL,38LL,36LL,21LL,1LL,2LL,0LL,39LL,36LL,21LL,1LL,2LL,0LL,40LL,26LL,22LL,21LL,1LL,2LL,0LL,41LL,22LL,21LL,1LL,2LL,0LL,42LL,22LL,21LL,1LL,2LL,0LL,43LL,22LL,21LL,1LL,2LL,0LL,44LL,22LL,21LL,1LL,2LL,0LL,45LL,22LL,21LL,1LL,2LL,0LL,46LL,1LL,2LL,0LL,47LL,22LL,21LL,1LL,2LL,0LL,48LL,22LL,21LL,1LL,2LL,0LL,49LL,50LL,51LL,52LL,53LL,54LL,55LL,56LL,57LL,58LL,132LL,73LL,59LL,60LL,61LL,62LL,56LL,63LL,50LL,64LL,65LL,63LL,50LL,66LL,67LL,63LL,50LL,68LL,69LL,62LL,56LL,70LL,71LL,62LL,56LL,72LL,73LL,74LL,58LL,132LL,73LL,75LL,76LL,63LL,50LL,77LL,63LL,50LL,78LL,63LL,50LL,79LL,63LL,50LL,80LL,63LL,50LL,81LL,63LL,50LL,82LL,83LL,84LL,85LL,86LL,87LL,88LL,89LL,90LL,91LL,92LL,93LL,94LL,95LL,96LL,97LL,98LL,99LL,100LL,101LL,102LL,103LL,104LL,105LL,106LL,107LL,108LL,109LL,110LL,111LL,112LL,113LL,114LL,115LL,116LL,117LL,118LL,119LL,120LL,121LL,122LL,123LL,124LL,125LL,126LL,127LL,128LL,129LL,130LL,131LL,132LL,133LL,134LL,135LL,136LL}; | |
| static mrb_bool sp_class_le(sp_Class child, sp_Class anc) __attribute__((unused)); | |
| static mrb_bool sp_class_le(sp_Class child, sp_Class anc){if(child.cls_id<0||child.cls_id>=SP_CLASS_COUNT)return FALSE;mrb_int s=sp_class_ancestors_off[child.cls_id];mrb_int e=sp_class_ancestors_off[child.cls_id+1];for(mrb_int k=s;k<e;k++){if(sp_class_ancestors_flat[k]==anc.cls_id)return TRUE;}return FALSE;} | |
| static mrb_bool sp_class_lt(sp_Class child, sp_Class anc) __attribute__((unused)); | |
| static mrb_bool sp_class_lt(sp_Class child, sp_Class anc){if(child.cls_id==anc.cls_id)return FALSE;return sp_class_le(child,anc);} | |
| static sp_PolyArray *sp_class_ancestors_arr(sp_Class c) __attribute__((unused)); | |
| static sp_PolyArray *sp_class_ancestors_arr(sp_Class c){sp_PolyArray*r=sp_PolyArray_new();if(c.cls_id<0||c.cls_id>=SP_CLASS_COUNT)return r;mrb_int s=sp_class_ancestors_off[c.cls_id];mrb_int e=sp_class_ancestors_off[c.cls_id+1];for(mrb_int k=s;k<e;k++){sp_Class el={sp_class_ancestors_flat[k]};sp_PolyArray_push(r,sp_box_class(el));}return r;} | |
| static sp_Class sp_class_for_poly(sp_RbVal v) __attribute__((unused)); | |
| static sp_Class sp_class_for_poly(sp_RbVal v){switch(v.tag){case SP_TAG_NIL:return (sp_Class){5};case SP_TAG_BOOL:return (sp_Class){v.v.b?6:7};case SP_TAG_INT:return (sp_Class){9};case SP_TAG_FLT:return (sp_Class){10};case SP_TAG_STR:return (sp_Class){11};case SP_TAG_SYM:return (sp_Class){12};case SP_TAG_CLASS:return (sp_Class){(mrb_int)v.cls_id};case SP_TAG_ENCODING:return (sp_Class){46};case SP_TAG_OBJ:if(v.cls_id>=0)return (sp_Class){(mrb_int)v.cls_id};switch(v.cls_id){case SP_BUILTIN_INT_ARRAY:case SP_BUILTIN_STR_ARRAY:case SP_BUILTIN_FLT_ARRAY:case SP_BUILTIN_SYM_ARRAY:case SP_BUILTIN_PTR_ARRAY:case SP_BUILTIN_POLY_ARRAY:return (sp_Class){13};case SP_BUILTIN_STR_INT_HASH:case SP_BUILTIN_STR_STR_HASH:case SP_BUILTIN_INT_STR_HASH:case SP_BUILTIN_SYM_INT_HASH:case SP_BUILTIN_SYM_STR_HASH:case SP_BUILTIN_STR_POLY_HASH:case SP_BUILTIN_SYM_POLY_HASH:case SP_BUILTIN_POLY_POLY_HASH:return (sp_Class){14};case SP_BUILTIN_RANGE:return (sp_Class){15};case SP_BUILTIN_TIME:return (sp_Class){16};case SP_BUILTIN_PROC:return (sp_Class){20};default:return (sp_Class){-1};}}return (sp_Class){-1};} | |
| typedef struct sp_ActiveRecord_RecordNotFound_s sp_ActiveRecord_RecordNotFound; | |
| typedef struct sp_ActiveRecord_RecordInvalid_s sp_ActiveRecord_RecordInvalid; | |
| typedef struct sp_ActiveRecord_ConnectionAdapters_ConnectionPool_s sp_ActiveRecord_ConnectionAdapters_ConnectionPool; | |
| typedef struct sp_ActiveRecord_Base_s sp_ActiveRecord_Base; | |
| typedef struct sp_ActionDispatch_Router_Route_s sp_ActionDispatch_Router_Route; | |
| typedef struct sp_ActionDispatch_Router_MatchResult_s sp_ActionDispatch_Router_MatchResult; | |
| typedef struct sp_ActionDispatch_Flash_s sp_ActionDispatch_Flash; | |
| typedef struct sp_ActionDispatch_Session_s sp_ActionDispatch_Session; | |
| typedef struct sp_ActionView_Slots_s sp_ActionView_Slots; | |
| typedef struct sp_ActionController_Base_s sp_ActionController_Base; | |
| typedef struct sp_Broadcasts_SeedTransport_s sp_Broadcasts_SeedTransport; | |
| typedef struct sp_ActionDispatch_IntegrationTest_s sp_ActionDispatch_IntegrationTest; | |
| typedef struct sp_Stmt_s sp_Stmt; | |
| typedef struct sp_DbConn_s sp_DbConn; | |
| typedef struct sp_DbPool_s sp_DbPool; | |
| typedef struct sp_ApplicationController_s sp_ApplicationController; | |
| typedef struct sp_ApplicationRecord_s sp_ApplicationRecord; | |
| typedef struct sp_CommentRow_s sp_CommentRow; | |
| typedef struct sp_Comment_s sp_Comment; | |
| typedef struct sp_ArticleRow_s sp_ArticleRow; | |
| typedef struct sp_Article_s sp_Article; | |
| typedef struct sp_ArticleParams_s sp_ArticleParams; | |
| typedef struct sp_ArticlesController_s sp_ArticlesController; | |
| typedef struct sp_CommentParams_s sp_CommentParams; | |
| typedef struct sp_CommentsController_s sp_CommentsController; | |
| typedef struct sp_ActionResponse_s sp_ActionResponse; | |
| typedef struct sp_TestBase_s sp_TestBase; | |
| typedef struct sp_ArticlesControllerTest_s sp_ArticlesControllerTest; | |
| typedef struct sp_Method_s sp_Method; | |
| typedef struct sp_Article__implicit_6872_s sp_Article__implicit_6872; | |
| typedef struct sp_Article__implicit_6906_s sp_Article__implicit_6906; | |
| typedef struct sp_Article__implicit_7484_s sp_Article__implicit_7484; | |
| typedef struct sp_Article__implicit_7995_s sp_Article__implicit_7995; | |
| typedef struct sp_Article__implicit_9355_s sp_Article__implicit_9355; | |
| typedef struct sp_Article__implicit_9372_s sp_Article__implicit_9372; | |
| struct sp_ActiveRecord_RecordNotFound_s { | |
| mrb_int cls_id; | |
| }; | |
| struct sp_ActiveRecord_RecordInvalid_s { | |
| mrb_int cls_id; | |
| sp_ActiveRecord_Base * iv_record; | |
| }; | |
| struct sp_ActiveRecord_ConnectionAdapters_ConnectionPool_s { | |
| mrb_int cls_id; | |
| mrb_int iv_size; | |
| sp_IntArray * iv_free; | |
| }; | |
| struct sp_ActiveRecord_Base_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| }; | |
| struct sp_ActionDispatch_Router_Route_s { | |
| mrb_int cls_id; | |
| const char * iv_verb; | |
| const char * iv_pattern; | |
| sp_sym iv_controller; | |
| sp_sym iv_action; | |
| }; | |
| struct sp_ActionDispatch_Router_MatchResult_s { | |
| mrb_int cls_id; | |
| sp_sym iv_controller; | |
| sp_sym iv_action; | |
| sp_StrStrHash * iv_path_params; | |
| }; | |
| struct sp_ActionDispatch_Flash_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_notice; | |
| sp_RbVal iv_alert; | |
| }; | |
| struct sp_ActionDispatch_Session_s { | |
| mrb_int cls_id; | |
| sp_StrPolyHash * iv_data; | |
| }; | |
| struct sp_ActionView_Slots_s { | |
| mrb_int cls_id; | |
| sp_SymIntHash * iv_slots; | |
| }; | |
| struct sp_ActionController_Base_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| }; | |
| struct sp_Broadcasts_SeedTransport_s { | |
| mrb_int cls_id; | |
| }; | |
| struct sp_ActionDispatch_IntegrationTest_s { | |
| mrb_int cls_id; | |
| sp_ActionDispatch_Session * iv___session; | |
| sp_RbVal iv___flash; | |
| sp_ActionResponse * iv___response; | |
| }; | |
| struct sp_Stmt_s { | |
| mrb_int cls_id; | |
| const char * iv_sql; | |
| void * iv_ptr; | |
| }; | |
| struct sp_DbConn_s { | |
| mrb_int cls_id; | |
| void * iv_dbh; | |
| sp_PtrArray * iv_entries; | |
| }; | |
| struct sp_DbPool_s { | |
| mrb_int cls_id; | |
| sp_PtrArray * iv_conns; | |
| sp_IntArray * iv_free; | |
| }; | |
| struct sp_ApplicationController_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| }; | |
| struct sp_ApplicationRecord_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| }; | |
| struct sp_CommentRow_s { | |
| mrb_int cls_id; | |
| mrb_int iv_id; | |
| mrb_int iv_article_id; | |
| const char * iv_body; | |
| const char * iv_commenter; | |
| const char * iv_created_at; | |
| const char * iv_updated_at; | |
| }; | |
| struct sp_Comment_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_article_id; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_commenter; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_updated_at; | |
| }; | |
| struct sp_ArticleRow_s { | |
| mrb_int cls_id; | |
| mrb_int iv_id; | |
| const char * iv_body; | |
| const char * iv_created_at; | |
| const char * iv_title; | |
| const char * iv_updated_at; | |
| }; | |
| struct sp_Article_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_ArticleParams_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_body; | |
| }; | |
| struct sp_ArticlesController_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| sp_PtrArray * iv_articles; | |
| sp_RbVal iv_article; | |
| }; | |
| struct sp_CommentParams_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_commenter; | |
| sp_RbVal iv_body; | |
| }; | |
| struct sp_CommentsController_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| sp_Article__implicit_6906 * iv_article; | |
| sp_Comment * iv_comment; | |
| }; | |
| struct sp_ActionResponse_s { | |
| mrb_int cls_id; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_location; | |
| sp_RbVal iv_flash; | |
| }; | |
| struct sp_TestBase_s { | |
| mrb_int cls_id; | |
| }; | |
| struct sp_ArticlesControllerTest_s { | |
| mrb_int cls_id; | |
| sp_ActionDispatch_Session * iv___session; | |
| sp_RbVal iv___flash; | |
| sp_ActionResponse * iv___response; | |
| sp_Article__implicit_6906 * iv_article; | |
| }; | |
| struct sp_Method_s { | |
| mrb_int cls_id; | |
| sp_Method * iv_self_obj; | |
| mrb_int iv_fn_ptr; | |
| const char * iv_name; | |
| }; | |
| struct sp_Article__implicit_6872_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_6906_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_PtrArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_7484_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_7995_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_9355_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_9372_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| mrb_int iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| static void sp_ActiveRecord_RecordInvalid_gc_scan(void *p); | |
| static void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_gc_scan(void *p); | |
| static void sp_ActiveRecord_Base_gc_scan(void *p); | |
| static void sp_ActionDispatch_Router_Route_gc_scan(void *p); | |
| static void sp_ActionDispatch_Router_MatchResult_gc_scan(void *p); | |
| static void sp_ActionDispatch_Flash_gc_scan(void *p); | |
| static void sp_ActionDispatch_Session_gc_scan(void *p); | |
| static void sp_ActionView_Slots_gc_scan(void *p); | |
| static void sp_ActionController_Base_gc_scan(void *p); | |
| static void sp_ActionDispatch_IntegrationTest_gc_scan(void *p); | |
| static void sp_Stmt_gc_scan(void *p); | |
| static void sp_DbConn_gc_scan(void *p); | |
| static void sp_DbPool_gc_scan(void *p); | |
| static void sp_ApplicationController_gc_scan(void *p); | |
| static void sp_ApplicationRecord_gc_scan(void *p); | |
| static void sp_CommentRow_gc_scan(void *p); | |
| static void sp_Comment_gc_scan(void *p); | |
| static void sp_ArticleRow_gc_scan(void *p); | |
| static void sp_Article_gc_scan(void *p); | |
| static void sp_ArticleParams_gc_scan(void *p); | |
| static void sp_ArticlesController_gc_scan(void *p); | |
| static void sp_CommentParams_gc_scan(void *p); | |
| static void sp_CommentsController_gc_scan(void *p); | |
| static void sp_ActionResponse_gc_scan(void *p); | |
| static void sp_ArticlesControllerTest_gc_scan(void *p); | |
| static void sp_Method_gc_scan(void *p); | |
| static void sp_Article__implicit_6872_gc_scan(void *p); | |
| static void sp_Article__implicit_6906_gc_scan(void *p); | |
| static void sp_Article__implicit_7484_gc_scan(void *p); | |
| static void sp_Article__implicit_7995_gc_scan(void *p); | |
| static void sp_Article__implicit_9355_gc_scan(void *p); | |
| static void sp_Article__implicit_9372_gc_scan(void *p); | |
| static void sp_ActiveRecord_RecordInvalid_gc_scan(void *p) { | |
| sp_ActiveRecord_RecordInvalid *self = (sp_ActiveRecord_RecordInvalid *)p; | |
| if (self->iv_record) sp_gc_mark((void *)self->iv_record); | |
| } | |
| static void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_gc_scan(void *p) { | |
| sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self = (sp_ActiveRecord_ConnectionAdapters_ConnectionPool *)p; | |
| if (self->iv_free) sp_gc_mark((void *)self->iv_free); | |
| } | |
| static void sp_ActiveRecord_Base_gc_scan(void *p) { | |
| sp_ActiveRecord_Base *self = (sp_ActiveRecord_Base *)p; | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_ActionDispatch_Router_Route_gc_scan(void *p) { | |
| sp_ActionDispatch_Router_Route *self = (sp_ActionDispatch_Router_Route *)p; | |
| if (self->iv_verb) sp_gc_mark((void *)self->iv_verb); | |
| if (self->iv_pattern) sp_gc_mark((void *)self->iv_pattern); | |
| } | |
| static void sp_ActionDispatch_Router_MatchResult_gc_scan(void *p) { | |
| sp_ActionDispatch_Router_MatchResult *self = (sp_ActionDispatch_Router_MatchResult *)p; | |
| if (self->iv_path_params) sp_gc_mark((void *)self->iv_path_params); | |
| } | |
| static void sp_ActionDispatch_Flash_gc_scan(void *p) { | |
| sp_ActionDispatch_Flash *self = (sp_ActionDispatch_Flash *)p; | |
| sp_mark_rbval(self->iv_notice); | |
| sp_mark_rbval(self->iv_alert); | |
| } | |
| static void sp_ActionDispatch_Session_gc_scan(void *p) { | |
| sp_ActionDispatch_Session *self = (sp_ActionDispatch_Session *)p; | |
| if (self->iv_data) sp_gc_mark((void *)self->iv_data); | |
| } | |
| static void sp_ActionView_Slots_gc_scan(void *p) { | |
| sp_ActionView_Slots *self = (sp_ActionView_Slots *)p; | |
| if (self->iv_slots) sp_gc_mark((void *)self->iv_slots); | |
| } | |
| static void sp_ActionController_Base_gc_scan(void *p) { | |
| sp_ActionController_Base *self = (sp_ActionController_Base *)p; | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_ActionDispatch_IntegrationTest_gc_scan(void *p) { | |
| sp_ActionDispatch_IntegrationTest *self = (sp_ActionDispatch_IntegrationTest *)p; | |
| if (self->iv___session) sp_gc_mark((void *)self->iv___session); | |
| sp_mark_rbval(self->iv___flash); | |
| if (self->iv___response) sp_gc_mark((void *)self->iv___response); | |
| } | |
| static void sp_Stmt_gc_scan(void *p) { | |
| sp_Stmt *self = (sp_Stmt *)p; | |
| if (self->iv_sql) sp_gc_mark((void *)self->iv_sql); | |
| } | |
| static void sp_DbConn_gc_scan(void *p) { | |
| sp_DbConn *self = (sp_DbConn *)p; | |
| if (self->iv_entries) sp_gc_mark((void *)self->iv_entries); | |
| } | |
| static void sp_DbPool_gc_scan(void *p) { | |
| sp_DbPool *self = (sp_DbPool *)p; | |
| if (self->iv_conns) sp_gc_mark((void *)self->iv_conns); | |
| if (self->iv_free) sp_gc_mark((void *)self->iv_free); | |
| } | |
| static void sp_ApplicationController_gc_scan(void *p) { | |
| sp_ApplicationController *self = (sp_ApplicationController *)p; | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_ApplicationRecord_gc_scan(void *p) { | |
| sp_ApplicationRecord *self = (sp_ApplicationRecord *)p; | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_CommentRow_gc_scan(void *p) { | |
| sp_CommentRow *self = (sp_CommentRow *)p; | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| if (self->iv_commenter) sp_gc_mark((void *)self->iv_commenter); | |
| if (self->iv_created_at) sp_gc_mark((void *)self->iv_created_at); | |
| if (self->iv_updated_at) sp_gc_mark((void *)self->iv_updated_at); | |
| } | |
| static void sp_Comment_gc_scan(void *p) { | |
| sp_Comment *self = (sp_Comment *)p; | |
| sp_mark_rbval(self->iv_article_id); | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_commenter); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_ArticleRow_gc_scan(void *p) { | |
| sp_ArticleRow *self = (sp_ArticleRow *)p; | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| if (self->iv_created_at) sp_gc_mark((void *)self->iv_created_at); | |
| if (self->iv_title) sp_gc_mark((void *)self->iv_title); | |
| if (self->iv_updated_at) sp_gc_mark((void *)self->iv_updated_at); | |
| } | |
| static void sp_Article_gc_scan(void *p) { | |
| sp_Article *self = (sp_Article *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_ArticleParams_gc_scan(void *p) { | |
| sp_ArticleParams *self = (sp_ArticleParams *)p; | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_body); | |
| } | |
| static void sp_ArticlesController_gc_scan(void *p) { | |
| sp_ArticlesController *self = (sp_ArticlesController *)p; | |
| if (self->iv_articles) sp_gc_mark((void *)self->iv_articles); | |
| sp_mark_rbval(self->iv_article); | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_CommentParams_gc_scan(void *p) { | |
| sp_CommentParams *self = (sp_CommentParams *)p; | |
| sp_mark_rbval(self->iv_commenter); | |
| sp_mark_rbval(self->iv_body); | |
| } | |
| static void sp_CommentsController_gc_scan(void *p) { | |
| sp_CommentsController *self = (sp_CommentsController *)p; | |
| if (self->iv_article) sp_gc_mark((void *)self->iv_article); | |
| if (self->iv_comment) sp_gc_mark((void *)self->iv_comment); | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_ActionResponse_gc_scan(void *p) { | |
| sp_ActionResponse *self = (sp_ActionResponse *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_location); | |
| sp_mark_rbval(self->iv_flash); | |
| } | |
| static void sp_ArticlesControllerTest_gc_scan(void *p) { | |
| sp_ArticlesControllerTest *self = (sp_ArticlesControllerTest *)p; | |
| if (self->iv_article) sp_gc_mark((void *)self->iv_article); | |
| if (self->iv___session) sp_gc_mark((void *)self->iv___session); | |
| sp_mark_rbval(self->iv___flash); | |
| if (self->iv___response) sp_gc_mark((void *)self->iv___response); | |
| } | |
| static void sp_Method_gc_scan(void *p) { | |
| sp_Method *self = (sp_Method *)p; | |
| if (self->iv_self_obj) sp_gc_mark((void *)self->iv_self_obj); | |
| if (self->iv_name) sp_gc_mark((void *)self->iv_name); | |
| } | |
| static void sp_Article__implicit_6872_gc_scan(void *p) { | |
| sp_Article__implicit_6872 *self = (sp_Article__implicit_6872 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_Article__implicit_6906_gc_scan(void *p) { | |
| sp_Article__implicit_6906 *self = (sp_Article__implicit_6906 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_Article__implicit_7484_gc_scan(void *p) { | |
| sp_Article__implicit_7484 *self = (sp_Article__implicit_7484 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_Article__implicit_7995_gc_scan(void *p) { | |
| sp_Article__implicit_7995 *self = (sp_Article__implicit_7995 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_Article__implicit_9355_gc_scan(void *p) { | |
| sp_Article__implicit_9355 *self = (sp_Article__implicit_9355 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static void sp_Article__implicit_9372_gc_scan(void *p) { | |
| sp_Article__implicit_9372 *self = (sp_Article__implicit_9372 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| } | |
| static const char * sp_Base64_cls_strict_encode64(const char * lv_s); | |
| static const char * sp_Base64_cls_strict_decode64(sp_RbVal lv_s); | |
| static inline mrb_int sp_Base64_cls_char_value(sp_RbVal lv_c); | |
| static inline const char * sp_JSON_cls_generate(const char * lv_value); | |
| static const char * sp_JSON_cls_escape_string(const char * lv_s); | |
| static mrb_int sp_Db_cls_configure(const char * lv_path, mrb_int lv_pool_size); | |
| static inline sp_RbVal sp_Db_cls_current_conn(void); | |
| static mrb_int sp_Db_cls_with_connection(void); | |
| static inline mrb_int sp_Db_cls_close(void); | |
| static mrb_int sp_Db_cls_exec(const char * lv_sql); | |
| static inline void * sp_Db_cls_prepare(const char * lv_sql); | |
| static sp_IntArray * sp_Db_cls_capture_sql(void); | |
| static inline sp_RbVal sp_Db_cls_record_query(const char * lv_sql); | |
| static inline mrb_bool sp_Db_cls_step_p(void * lv_stmt); | |
| static inline mrb_int sp_Db_cls_column_int(void * lv_stmt, mrb_int lv_i); | |
| static inline const char * sp_Db_cls_column_text(void * lv_stmt, mrb_int lv_i); | |
| static inline mrb_int sp_Db_cls_column_count(mrb_int lv_stmt); | |
| static inline const char * sp_Db_cls_column_name(mrb_int lv_stmt, mrb_int lv_i); | |
| static inline mrb_int sp_Db_cls_finalize(void * lv_stmt); | |
| static inline mrb_int sp_Db_cls_last_insert_rowid(void); | |
| static inline mrb_int sp_Db_cls_changes(void); | |
| static inline const char * sp_Db_cls_escape_string(sp_RbVal lv_s); | |
| static inline const char * sp_Db_cls_escape_int(sp_RbVal lv_n); | |
| static inline const char * sp_Db_cls_escape_int_list(sp_IntArray * lv_ids); | |
| static inline const char * sp_Db_cls_escape_bool(mrb_int lv_b); | |
| static inline mrb_bool sp_Db_cls_column_bool(void * lv_stmt, mrb_int lv_idx); | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_register(mrb_int lv_name, mrb_int lv_klass); | |
| static inline sp_RbVal sp_ActiveRecord_Registry_cls_lookup(mrb_int lv_name); | |
| static inline mrb_bool sp_ActiveRecord_Registry_cls_registered_p(mrb_int lv_name); | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_clear_bang(void); | |
| static inline sp_StrArray * sp_Schema_cls_statements(void); | |
| static sp_ActionDispatch_Router_MatchResult * sp_ActionDispatch_Router_cls_match(const char * lv_method, const char * lv_path, sp_PtrArray * lv_table); | |
| static sp_StrStrHash * sp_ActionDispatch_Router_cls_match_pattern(const char * lv_pattern, const char * lv_path); | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_reset_slots_bang(void); | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_content_for_set(sp_sym lv_slot, const char * lv_value); | |
| static inline sp_RbVal sp_ActionView_ViewHelpers_cls_content_for_get(sp_sym lv_slot); | |
| static inline sp_RbVal sp_ActionView_ViewHelpers_cls_get_slot(sp_sym lv_slot); | |
| static inline sp_RbVal sp_ActionView_ViewHelpers_cls_get_yield(void); | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_set_yield(mrb_int lv_content); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_html_escape(sp_RbVal lv_s); | |
| static sp_RbVal sp_ActionView_ViewHelpers_cls_truncate(sp_RbVal lv_s, mrb_int lv_length, const char * lv_omission); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_dom_id(sp_RbVal lv_record, sp_RbVal lv_suffix); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_link_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts); | |
| static const char * sp_ActionView_ViewHelpers_cls_button_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_meta_tags(void); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csp_meta_tag(void); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_stylesheet_link_tag(const char * lv_name, sp_SymStrHash * lv_opts); | |
| static const char * sp_ActionView_ViewHelpers_cls_javascript_importmap_tags(sp_RbVal lv_pins, const char * lv_entry); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_turbo_stream_from(const char * lv_stream); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(void); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_method_override_input(sp_sym lv_method); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_optional_value_attr(sp_RbVal lv_value); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_escape_or_empty(sp_RbVal lv_value); | |
| static const char * sp_ActionView_ViewHelpers_cls_render_attrs(sp_StrPolyHash * lv_attrs); | |
| static inline const char * sp_JsonBuilder_cls_encode_string(const char * lv_s); | |
| static const char * sp_JsonBuilder_cls_encode_value(sp_RbVal lv_v); | |
| static const char * sp_JsonBuilder_cls_encode_datetime(sp_RbVal lv_s); | |
| static inline sp_PolyArray * sp_Broadcasts_cls_reset_log_bang(void); | |
| static inline sp_PolyArray * sp_Broadcasts_cls_log(void); | |
| static inline sp_IntArray * sp_Broadcasts_cls_set_transport(mrb_int lv_transport); | |
| static inline mrb_int sp_Broadcasts_cls_append(const char * lv_stream, const char * lv_target, sp_String * lv_html); | |
| static inline mrb_int sp_Broadcasts_cls_prepend(const char * lv_stream, const char * lv_target, sp_String * lv_html); | |
| static inline mrb_int sp_Broadcasts_cls_replace(const char * lv_stream, const char * lv_target, sp_String * lv_html); | |
| static inline mrb_int sp_Broadcasts_cls_remove(const char * lv_stream, const char * lv_target); | |
| static mrb_int sp_Broadcasts_cls_record(sp_sym lv_action, const char * lv_stream, const char * lv_target, sp_RbVal lv_html); | |
| static inline const char * sp_Broadcasts_cls_render_fragment(sp_sym lv_action, const char * lv_target, sp_RbVal lv_html); | |
| static inline sp_PolyArray * sp_Importmap_cls_pins(void); | |
| static inline const char * sp_Importmap_cls_entry(void); | |
| static inline const char * sp_RouteHelpers_cls_root_path(void); | |
| static inline const char * sp_RouteHelpers_cls_articles_path(void); | |
| static inline const char * sp_RouteHelpers_cls_new_article_path(void); | |
| static inline const char * sp_RouteHelpers_cls_article_path(mrb_int lv_id); | |
| static inline const char * sp_RouteHelpers_cls_edit_article_path(mrb_int lv_id); | |
| static inline const char * sp_RouteHelpers_cls_article_comments_path(mrb_int lv_article_id); | |
| static inline const char * sp_RouteHelpers_cls_article_comment_path(sp_RbVal lv_article_id, mrb_int lv_id); | |
| static inline sp_String * sp_Views_Comments_cls_comment(sp_Comment * lv_comment, sp_String * lv_notice, sp_String * lv_alert); | |
| static inline const char * sp_Inflector_cls_pluralize(mrb_int lv_count, const char * lv_word); | |
| static inline sp_String * sp_Views_Articles_cls_article(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert); | |
| static sp_String * sp_Views_Articles_cls_form(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert); | |
| static sp_String * sp_Views_Articles_cls_index(sp_PtrArray * lv_articles, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static sp_String * sp_Views_Articles_cls_show(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static sp_String * sp_Views_Articles_cls_new(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static sp_String * sp_Views_Articles_cls_edit(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static inline sp_String * sp_Views_Layouts_cls_application(mrb_int lv_body, sp_String * lv_notice, sp_String * lv_alert); | |
| static sp_String * sp_Views_Articles_cls_article_json(sp_RbVal lv_article); | |
| static sp_String * sp_Views_Articles_cls_index_json(sp_PtrArray * lv_articles); | |
| static inline sp_String * sp_Views_Articles_cls_show_json(sp_RbVal lv_article); | |
| static inline sp_PtrArray * sp_Routes_cls_table(void); | |
| static inline sp_ActionDispatch_Router_Route * sp_Routes_cls_root(void); | |
| static inline mrb_bool sp_SchemaSetup_cls_reset_bang(void); | |
| static inline mrb_bool sp_FixtureLoader_cls_load_all_bang(void); | |
| static inline sp_Article__implicit_6906 * sp_ArticlesFixtures_cls_one(void); | |
| static inline sp_Article__implicit_6906 * sp_ArticlesFixtures_cls_two(void); | |
| static mrb_bool sp_ArticlesFixtures_cls__fixtures_load_bang(void); | |
| static inline sp_Comment * sp_CommentsFixtures_cls_one(void); | |
| static inline sp_Comment * sp_CommentsFixtures_cls_two(void); | |
| static mrb_bool sp_CommentsFixtures_cls__fixtures_load_bang(void); | |
| static sp_ActiveRecord_RecordNotFound *sp_ActiveRecord_RecordNotFound_new(const char * lv_message); | |
| static inline void sp_ActiveRecord_RecordNotFound_initialize(sp_ActiveRecord_RecordNotFound *self, const char * lv_message); | |
| static sp_ActiveRecord_RecordInvalid *sp_ActiveRecord_RecordInvalid_new(sp_ActiveRecord_Base * lv_record); | |
| static inline void sp_ActiveRecord_RecordInvalid_initialize(sp_ActiveRecord_RecordInvalid *self, sp_ActiveRecord_Base * lv_record); | |
| static sp_ActiveRecord_ConnectionAdapters_ConnectionPool *sp_ActiveRecord_ConnectionAdapters_ConnectionPool_new(mrb_int lv_size, sp_Proc *_ctor_blk); | |
| static inline void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_initialize(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_size); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkout(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static inline sp_IntArray * sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkin(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_handle); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_wait_for_handle(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_available_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_in_use_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static sp_ActiveRecord_Base *sp_ActiveRecord_Base_new(sp_StrIntHash * lv__attrs); | |
| static inline void sp_ActiveRecord_Base_initialize(sp_ActiveRecord_Base *self, sp_StrIntHash * lv__attrs); | |
| static inline sp_StrArray * sp_ActiveRecord_Base_errors(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_insert(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_update(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_delete(sp_ActiveRecord_Base *self); | |
| static inline sp_RbVal sp_ActiveRecord_Base__adapter_reload(sp_ActiveRecord_Base *self); | |
| static inline sp_RbVal sp_ActiveRecord_Base_attributes(sp_ActiveRecord_Base *self); | |
| static inline sp_RbVal sp_ActiveRecord_Base__aref(sp_ActiveRecord_Base *self, sp_RbVal lv__name); | |
| static inline mrb_int sp_ActiveRecord_Base__aset(sp_ActiveRecord_Base *self, sp_sym lv__name, const char * lv__value); | |
| static inline mrb_int sp_ActiveRecord_Base_assign_from_row(sp_ActiveRecord_Base *self, mrb_int lv__row); | |
| static inline const char * sp_ActiveRecord_Base_dom_prefix(sp_ActiveRecord_Base *self); | |
| static inline mrb_bool sp_ActiveRecord_Base_persisted_p(sp_ActiveRecord_Base *self); | |
| static inline mrb_bool sp_ActiveRecord_Base_new_record_p(sp_ActiveRecord_Base *self); | |
| static inline mrb_bool sp_ActiveRecord_Base_destroyed_p(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_mark_persisted_bang(sp_ActiveRecord_Base *self); | |
| static mrb_bool sp_ActiveRecord_Base_save(sp_ActiveRecord_Base *self); | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_save_bang(sp_ActiveRecord_Base *self); | |
| static sp_ActiveRecord_Base * sp_ActiveRecord_Base_destroy(sp_ActiveRecord_Base *self); | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_reload(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_validation(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_validation(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_save(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_save(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_create(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_create(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_update(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_update(sp_ActiveRecord_Base *self); | |
| static inline sp_RbVal sp_ActiveRecord_Base_before_destroy(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_create_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_update_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_save_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_touch(sp_ActiveRecord_Base *self); | |
| static inline sp_StrArray * sp_ActiveRecord_Base_validate(sp_ActiveRecord_Base *self); | |
| static mrb_int sp_ActiveRecord_Base_fill_timestamps(sp_ActiveRecord_Base *self, mrb_bool lv_creating); | |
| static inline mrb_bool sp_ActiveRecord_Base_valid_p(sp_ActiveRecord_Base *self); | |
| static mrb_int sp_ActiveRecord_Base_cls_schema_columns(void); | |
| static sp_ActionDispatch_Router_Route *sp_ActionDispatch_Router_Route_new(const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action); | |
| static inline void sp_ActionDispatch_Router_Route_initialize(sp_ActionDispatch_Router_Route *self, const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action); | |
| static sp_ActionDispatch_Router_MatchResult *sp_ActionDispatch_Router_MatchResult_new(sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params); | |
| static inline void sp_ActionDispatch_Router_MatchResult_initialize(sp_ActionDispatch_Router_MatchResult *self, sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params); | |
| static sp_ActionDispatch_Flash *sp_ActionDispatch_Flash_new(sp_RbVal lv_other); | |
| static inline void sp_ActionDispatch_Flash_initialize(sp_ActionDispatch_Flash *self, sp_RbVal lv_other); | |
| static sp_RbVal sp_ActionDispatch_Flash__aref(sp_ActionDispatch_Flash *self, sp_RbVal lv_key); | |
| static inline const char * sp_ActionDispatch_Flash__aset(sp_ActionDispatch_Flash *self, sp_sym lv_key, const char * lv_value); | |
| static inline sp_RbVal sp_ActionDispatch_Flash_fetch(sp_ActionDispatch_Flash *self, const char * lv_key, sp_RbVal lv_default); | |
| static inline mrb_bool sp_ActionDispatch_Flash_key_p(sp_ActionDispatch_Flash *self, sp_sym lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Flash_has_key_p(sp_ActionDispatch_Flash *self, mrb_int lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Flash_include_p(sp_ActionDispatch_Flash *self, sp_sym lv_key); | |
| static sp_RbVal sp_ActionDispatch_Flash_delete(sp_ActionDispatch_Flash *self, mrb_int lv_key); | |
| static mrb_int sp_ActionDispatch_Flash_length(sp_ActionDispatch_Flash *self); | |
| static mrb_int sp_ActionDispatch_Flash_size(sp_ActionDispatch_Flash *self); | |
| static inline mrb_bool sp_ActionDispatch_Flash_empty_p(sp_ActionDispatch_Flash *self); | |
| static sp_StrArray * sp_ActionDispatch_Flash_keys(sp_ActionDispatch_Flash *self); | |
| static sp_PolyArray * sp_ActionDispatch_Flash_values(sp_ActionDispatch_Flash *self); | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_each(sp_ActionDispatch_Flash *self, void (*_block)(const char *, sp_RbVal, void*), void *_benv); | |
| static sp_StrPolyHash * sp_ActionDispatch_Flash_to_h(sp_ActionDispatch_Flash *self); | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_merge(sp_ActionDispatch_Flash *self, mrb_int lv_other); | |
| static sp_ActionDispatch_Session *sp_ActionDispatch_Session_new(sp_RbVal lv_other); | |
| static inline void sp_ActionDispatch_Session_initialize(sp_ActionDispatch_Session *self, sp_RbVal lv_other); | |
| static sp_RbVal sp_ActionDispatch_Session__aref(sp_ActionDispatch_Session *self, sp_RbVal lv_key); | |
| static sp_RbVal sp_ActionDispatch_Session__aset(sp_ActionDispatch_Session *self, mrb_int lv_key, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_ActionDispatch_Session_fetch(sp_ActionDispatch_Session *self, const char * lv_key, sp_RbVal lv_default); | |
| static mrb_bool sp_ActionDispatch_Session_key_p(sp_ActionDispatch_Session *self, mrb_int lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Session_has_key_p(sp_ActionDispatch_Session *self, mrb_int lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Session_include_p(sp_ActionDispatch_Session *self, sp_sym lv_key); | |
| static sp_RbVal sp_ActionDispatch_Session_delete(sp_ActionDispatch_Session *self, mrb_int lv_key); | |
| static mrb_int sp_ActionDispatch_Session_length(sp_ActionDispatch_Session *self); | |
| static inline mrb_int sp_ActionDispatch_Session_size(sp_ActionDispatch_Session *self); | |
| static mrb_bool sp_ActionDispatch_Session_empty_p(sp_ActionDispatch_Session *self); | |
| static sp_StrArray * sp_ActionDispatch_Session_keys(sp_ActionDispatch_Session *self); | |
| static sp_PolyArray * sp_ActionDispatch_Session_values(sp_ActionDispatch_Session *self); | |
| static sp_ActionDispatch_Session * sp_ActionDispatch_Session_each(sp_ActionDispatch_Session *self, void (*_block)(const char *, sp_RbVal, void*), void *_benv); | |
| static inline sp_StrPolyHash * sp_ActionDispatch_Session_to_h(sp_ActionDispatch_Session *self); | |
| static inline sp_ActionDispatch_Session * sp_ActionDispatch_Session_merge(sp_ActionDispatch_Session *self, mrb_int lv_other); | |
| static sp_ActionView_Slots *sp_ActionView_Slots_new(void); | |
| static inline void sp_ActionView_Slots_initialize(sp_ActionView_Slots *self); | |
| static inline mrb_int sp_ActionView_Slots_reset_bang(sp_ActionView_Slots *self); | |
| static inline mrb_int sp_ActionView_Slots_set(sp_ActionView_Slots *self, sp_sym lv_slot, mrb_int lv_value); | |
| static inline mrb_int sp_ActionView_Slots_get(sp_ActionView_Slots *self, mrb_int lv_slot); | |
| static inline sp_RbVal sp_ActionView_Slots_bracket_get(sp_ActionView_Slots *self, mrb_int lv_slot); | |
| static inline sp_RbVal sp_ActionView_Slots_get_yield(sp_ActionView_Slots *self); | |
| static inline mrb_int sp_ActionView_Slots_set_yield(sp_ActionView_Slots *self, mrb_int lv_content); | |
| static sp_ActionController_Base *sp_ActionController_Base_new(void); | |
| static inline void sp_ActionController_Base_initialize(sp_ActionController_Base *self); | |
| static inline mrb_int sp_ActionController_Base_process_action(sp_ActionController_Base *self, sp_sym lv__action_name); | |
| static mrb_int sp_ActionController_Base_render(sp_ActionController_Base *self, sp_String * lv_body, sp_sym lv_status, const char * lv_content_type, sp_RbVal lv_location); | |
| static mrb_int sp_ActionController_Base_redirect_to(sp_ActionController_Base *self, const char * lv_path, const char * lv_notice, const char * lv_alert, sp_sym lv_status); | |
| static mrb_int sp_ActionController_Base_head(sp_ActionController_Base *self, sp_sym lv_status, const char * lv_content_type); | |
| static inline mrb_int sp_ActionController_Base_resolve_status(sp_ActionController_Base *self, sp_sym lv_s); | |
| static sp_Broadcasts_SeedTransport *sp_Broadcasts_SeedTransport_new(void); | |
| static inline mrb_int sp_Broadcasts_SeedTransport_broadcast(sp_Broadcasts_SeedTransport *self, const char * lv_stream, const char * lv_fragment); | |
| static sp_ActionDispatch_IntegrationTest *sp_ActionDispatch_IntegrationTest_new(void); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_get(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_StrIntHash * lv_params); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_post(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_SymPolyHash * lv_params); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_patch(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_SymPolyHash * lv_params); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_delete(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_StrIntHash * lv_params); | |
| static sp_ActionResponse * sp_ActionDispatch_IntegrationTest_dispatch_request(sp_ActionDispatch_IntegrationTest *self, const char * lv_method, const char * lv_path, sp_SymPolyHash * lv_params); | |
| static inline sp_StrPolyHash * sp_ActionDispatch_IntegrationTest_stringify_keys(sp_ActionDispatch_IntegrationTest *self, sp_StrStrHash * lv_hash); | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_response(sp_ActionDispatch_IntegrationTest *self, sp_sym lv_expected, sp_ActionResponse * lv_response); | |
| static inline mrb_int sp_ActionDispatch_IntegrationTest_assert_redirected_to(sp_ActionDispatch_IntegrationTest *self, const char * lv_expected_path, sp_ActionResponse * lv_response); | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_select(sp_ActionDispatch_IntegrationTest *self, const char * lv_selector, sp_RbVal lv_content_or_opts, sp_RbVal lv_opts, sp_Proc * lv_block, void (*_block)(mrb_int, void*), void *_benv); | |
| static sp_Stmt *sp_Stmt_new(const char * lv_sql, void * lv_ptr); | |
| static inline void sp_Stmt_initialize(sp_Stmt *self, const char * lv_sql, void * lv_ptr); | |
| static inline const char * sp_Stmt_sql(sp_Stmt *self); | |
| static inline void * sp_Stmt_ptr(sp_Stmt *self); | |
| static sp_DbConn *sp_DbConn_new(void * lv_dbh); | |
| static inline void sp_DbConn_initialize(sp_DbConn *self, void * lv_dbh); | |
| static inline void * sp_DbConn_dbh(sp_DbConn *self); | |
| static void * sp_DbConn_prepare_cached(sp_DbConn *self, const char * lv_sql); | |
| static inline mrb_int sp_DbConn_finalize_all(sp_DbConn *self); | |
| static sp_DbPool *sp_DbPool_new(const char * lv_path, mrb_int lv_n); | |
| static inline void sp_DbPool_initialize(sp_DbPool *self, const char * lv_path, mrb_int lv_n); | |
| static inline mrb_int sp_DbPool_available(sp_DbPool *self); | |
| static inline mrb_int sp_DbPool_lease(sp_DbPool *self); | |
| static inline sp_IntArray * sp_DbPool_release(sp_DbPool *self, mrb_int lv_idx); | |
| static inline sp_DbConn * sp_DbPool_conn(sp_DbPool *self, mrb_int lv_idx); | |
| static inline sp_DbConn * sp_DbPool_first(sp_DbPool *self); | |
| static inline mrb_int sp_DbPool_close_all(sp_DbPool *self); | |
| static sp_ApplicationController *sp_ApplicationController_new(void); | |
| static sp_ApplicationRecord *sp_ApplicationRecord_new(sp_StrIntHash * lv__attrs); | |
| static mrb_int sp_ApplicationRecord_cls_schema_columns(void); | |
| static sp_CommentRow *sp_CommentRow_new(void); | |
| static inline void sp_CommentRow_initialize(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_id(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_id_eq(sp_CommentRow *self, mrb_int lv_value); | |
| static inline mrb_int sp_CommentRow_article_id(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_article_id_eq(sp_CommentRow *self, mrb_int lv_value); | |
| static inline const char * sp_CommentRow_body(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_body_eq(sp_CommentRow *self, const char * lv_value); | |
| static inline const char * sp_CommentRow_commenter(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_commenter_eq(sp_CommentRow *self, const char * lv_value); | |
| static inline const char * sp_CommentRow_created_at(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_created_at_eq(sp_CommentRow *self, const char * lv_value); | |
| static inline const char * sp_CommentRow_updated_at(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_updated_at_eq(sp_CommentRow *self, const char * lv_value); | |
| static sp_CommentRow * sp_CommentRow_cls_from_raw(mrb_int lv_row); | |
| static sp_Comment *sp_Comment_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Comment_initialize(sp_Comment *self, sp_StrIntHash * lv_attrs); | |
| static inline mrb_int sp_Comment_id(sp_Comment *self); | |
| static inline mrb_int sp_Comment_id_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_article_id(sp_Comment *self); | |
| static inline mrb_int sp_Comment_article_id_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_body(sp_Comment *self); | |
| static inline mrb_int sp_Comment_body_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_commenter(sp_Comment *self); | |
| static inline mrb_int sp_Comment_commenter_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_created_at(sp_Comment *self); | |
| static inline mrb_int sp_Comment_created_at_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_updated_at(sp_Comment *self); | |
| static inline mrb_int sp_Comment_updated_at_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static mrb_int sp_Comment_assign_from_row(sp_Comment *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Comment_attributes(sp_Comment *self); | |
| static inline sp_RbVal sp_Comment__aref(sp_Comment *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Comment__aset(sp_Comment *self, sp_sym lv_name, const char * lv_value); | |
| static inline mrb_bool sp_Comment_update(sp_Comment *self, mrb_int lv_p); | |
| static inline mrb_int sp_Comment__adapter_insert(sp_Comment *self); | |
| static inline mrb_int sp_Comment__adapter_update(sp_Comment *self); | |
| static inline mrb_int sp_Comment__adapter_delete(sp_Comment *self); | |
| static sp_RbVal sp_Comment__adapter_reload(sp_Comment *self); | |
| static inline sp_StrArray * sp_Comment_validate(sp_Comment *self); | |
| static inline sp_Article__implicit_6906 * sp_Comment_article(sp_Comment *self); | |
| static inline const char * sp_Comment_dom_prefix(sp_Comment *self); | |
| static mrb_int sp_Comment_after_create_commit(sp_Comment *self); | |
| static inline mrb_int sp_Comment_after_update_commit(sp_Comment *self); | |
| static mrb_int sp_Comment_after_destroy_commit(sp_Comment *self); | |
| static sp_IntArray * sp_Comment_cls_schema_columns(void); | |
| static sp_Comment * sp_Comment_cls_from_row(sp_CommentRow * lv_row); | |
| static sp_Comment * sp_Comment_cls_from_stmt(void * lv_stmt); | |
| static sp_Comment * sp_Comment_cls__adapter_find_by_id(mrb_int lv_id); | |
| static mrb_int sp_Comment_cls__adapter_truncate(void); | |
| static sp_Comment * sp_Comment_cls_from_params(sp_CommentParams * lv_p); | |
| static sp_Comment * sp_Comment_cls_find(mrb_int lv_id); | |
| static sp_ArticleRow *sp_ArticleRow_new(void); | |
| static inline void sp_ArticleRow_initialize(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_id(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_id_eq(sp_ArticleRow *self, mrb_int lv_value); | |
| static inline const char * sp_ArticleRow_body(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_body_eq(sp_ArticleRow *self, const char * lv_value); | |
| static inline const char * sp_ArticleRow_created_at(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_created_at_eq(sp_ArticleRow *self, const char * lv_value); | |
| static inline const char * sp_ArticleRow_title(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_title_eq(sp_ArticleRow *self, const char * lv_value); | |
| static inline const char * sp_ArticleRow_updated_at(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_updated_at_eq(sp_ArticleRow *self, const char * lv_value); | |
| static sp_ArticleRow * sp_ArticleRow_cls_from_raw(mrb_int lv_row); | |
| static sp_Article *sp_Article_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article_initialize(sp_Article *self, sp_StrIntHash * lv_attrs); | |
| static sp_IntArray * sp_Article_cls_schema_columns(void); | |
| static sp_Article__implicit_6872 * sp_Article_cls_from_row(sp_ArticleRow * lv_row); | |
| static sp_Article__implicit_6906 * sp_Article_cls_from_stmt(void * lv_stmt); | |
| static sp_Article__implicit_6906 * sp_Article_cls__adapter_find_by_id(mrb_int lv_id); | |
| static sp_PtrArray * sp_Article_cls__adapter_all(void); | |
| static mrb_int sp_Article_cls__adapter_count(void); | |
| static mrb_bool sp_Article_cls__adapter_exists_by_id_p(sp_RbVal lv_id); | |
| static mrb_int sp_Article_cls__adapter_truncate(void); | |
| static sp_Article__implicit_7484 * sp_Article_cls_from_params(sp_ArticleParams * lv_p); | |
| static sp_PtrArray * sp_Article_cls_all(void); | |
| static sp_Article__implicit_6906 * sp_Article_cls_find(mrb_int lv_id); | |
| static mrb_int sp_Article_cls_count(void); | |
| static mrb_bool sp_Article_cls_exists_p(sp_RbVal lv_id); | |
| static sp_Article__implicit_6906 * sp_Article_cls_last(void); | |
| static sp_ArticleParams *sp_ArticleParams_new(void); | |
| static inline void sp_ArticleParams_initialize(sp_ArticleParams *self); | |
| static inline sp_RbVal sp_ArticleParams_title(sp_ArticleParams *self); | |
| static inline mrb_int sp_ArticleParams_title_eq(sp_ArticleParams *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_ArticleParams_body(sp_ArticleParams *self); | |
| static inline mrb_int sp_ArticleParams_body_eq(sp_ArticleParams *self, sp_RbVal lv_value); | |
| static inline sp_StrPolyHash * sp_ArticleParams_to_h(sp_ArticleParams *self); | |
| static sp_ArticleParams * sp_ArticleParams_cls_from_raw(sp_RbVal lv_params); | |
| static sp_ArticlesController *sp_ArticlesController_new(void); | |
| static inline mrb_int sp_ArticlesController_process_action(sp_ArticlesController *self, sp_sym lv_action_name); | |
| static mrb_int sp_ArticlesController_index(sp_ArticlesController *self); | |
| static mrb_int sp_ArticlesController_show(sp_ArticlesController *self); | |
| static inline mrb_int sp_ArticlesController_new_action(sp_ArticlesController *self); | |
| static mrb_int sp_ArticlesController_edit(sp_ArticlesController *self); | |
| static inline mrb_int sp_ArticlesController_create(sp_ArticlesController *self); | |
| static inline mrb_int sp_ArticlesController_update(sp_ArticlesController *self); | |
| static mrb_int sp_ArticlesController_destroy(sp_ArticlesController *self); | |
| static inline sp_ArticleParams * sp_ArticlesController_article_params(sp_ArticlesController *self); | |
| static sp_CommentParams *sp_CommentParams_new(void); | |
| static inline void sp_CommentParams_initialize(sp_CommentParams *self); | |
| static inline sp_RbVal sp_CommentParams_commenter(sp_CommentParams *self); | |
| static inline mrb_int sp_CommentParams_commenter_eq(sp_CommentParams *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_CommentParams_body(sp_CommentParams *self); | |
| static inline mrb_int sp_CommentParams_body_eq(sp_CommentParams *self, sp_RbVal lv_value); | |
| static inline sp_StrPolyHash * sp_CommentParams_to_h(sp_CommentParams *self); | |
| static sp_CommentParams * sp_CommentParams_cls_from_raw(sp_RbVal lv_params); | |
| static sp_CommentsController *sp_CommentsController_new(void); | |
| static inline mrb_int sp_CommentsController_process_action(sp_CommentsController *self, sp_sym lv_action_name); | |
| static mrb_int sp_CommentsController_create(sp_CommentsController *self); | |
| static mrb_int sp_CommentsController_destroy(sp_CommentsController *self); | |
| static inline sp_CommentParams * sp_CommentsController_comment_params(sp_CommentsController *self); | |
| static sp_ActionResponse *sp_ActionResponse_new(mrb_int lv_status, sp_RbVal lv_body, sp_RbVal lv_location, sp_RbVal lv_flash); | |
| static inline void sp_ActionResponse_initialize(sp_ActionResponse *self, mrb_int lv_status, sp_RbVal lv_body, sp_RbVal lv_location, sp_RbVal lv_flash); | |
| static inline mrb_bool sp_ActionResponse_redirect_p(sp_ActionResponse *self); | |
| static inline mrb_bool sp_ActionResponse_success_p(sp_ActionResponse *self); | |
| static inline mrb_bool sp_ActionResponse_unprocessable_p(sp_ActionResponse *self); | |
| static sp_TestBase *sp_TestBase_new(void); | |
| static inline void sp_TestBase_initialize(sp_TestBase *self); | |
| static inline mrb_bool sp_TestBase_setup(sp_TestBase *self); | |
| static inline mrb_int sp_TestBase_teardown(sp_TestBase *self); | |
| static inline mrb_int sp_TestBase_assert_match(sp_TestBase *self, mrb_int lv_pattern, mrb_int lv_value, mrb_int lv_msg); | |
| static sp_ArticlesControllerTest *sp_ArticlesControllerTest_new(void); | |
| static mrb_int sp_ArticlesControllerTest_test_should_get_index(sp_ArticlesControllerTest *self); | |
| static mrb_int sp_ArticlesControllerTest_test_should_get_new(sp_ArticlesControllerTest *self); | |
| static mrb_int sp_ArticlesControllerTest_test_should_create_article(sp_ArticlesControllerTest *self); | |
| static mrb_int sp_ArticlesControllerTest_test_should_not_create_article_with_invalid_params(sp_ArticlesControllerTest *self); | |
| static mrb_int sp_ArticlesControllerTest_test_should_show_article(sp_ArticlesControllerTest *self); | |
| static mrb_int sp_ArticlesControllerTest_test_should_get_edit(sp_ArticlesControllerTest *self); | |
| static mrb_int sp_ArticlesControllerTest_test_should_update_article(sp_ArticlesControllerTest *self); | |
| static inline mrb_int sp_ArticlesControllerTest_test_should_not_update_article_with_invalid_params(sp_ArticlesControllerTest *self); | |
| static mrb_int sp_ArticlesControllerTest_test_should_destroy_article(sp_ArticlesControllerTest *self); | |
| static sp_Method *sp_Method_new(sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name); | |
| static inline void sp_Method_initialize(sp_Method *self, sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name); | |
| static sp_Article__implicit_6872 *sp_Article__implicit_6872_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_6872_initialize(sp_Article__implicit_6872 *self, sp_StrIntHash * lv_attrs); | |
| static inline mrb_int sp_Article__implicit_6872_id(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_id_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_body(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_body_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_created_at(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_created_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_title(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_title_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_updated_at(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_updated_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_6872_assign_from_row(sp_Article__implicit_6872 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_6872_attributes(sp_Article__implicit_6872 *self); | |
| static inline sp_RbVal sp_Article__implicit_6872__aref(sp_Article__implicit_6872 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_6872__aset(sp_Article__implicit_6872 *self, sp_sym lv_name, const char * lv_value); | |
| static inline mrb_bool sp_Article__implicit_6872_update(sp_Article__implicit_6872 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_6872__adapter_insert(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872__adapter_update(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872__adapter_delete(sp_Article__implicit_6872 *self); | |
| static sp_RbVal sp_Article__implicit_6872__adapter_reload(sp_Article__implicit_6872 *self); | |
| static inline sp_StrArray * sp_Article__implicit_6872_validate(sp_Article__implicit_6872 *self); | |
| static sp_RbVal sp_Article__implicit_6872_comments(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872__preload_comments(sp_Article__implicit_6872 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_6872_before_destroy(sp_Article__implicit_6872 *self); | |
| static inline const char * sp_Article__implicit_6872_dom_prefix(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_after_create_commit(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_after_update_commit(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_after_destroy_commit(sp_Article__implicit_6872 *self); | |
| static sp_IntArray * sp_Article__implicit_6872_cls_schema_columns(void); | |
| static sp_Article__implicit_6906 *sp_Article__implicit_6906_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_6906_initialize(sp_Article__implicit_6906 *self, sp_StrIntHash * lv_attrs); | |
| static inline mrb_int sp_Article__implicit_6906_id(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_id_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_body(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_body_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_created_at(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_created_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_title(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_title_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_updated_at(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_updated_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_6906_assign_from_row(sp_Article__implicit_6906 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_6906_attributes(sp_Article__implicit_6906 *self); | |
| static inline sp_RbVal sp_Article__implicit_6906__aref(sp_Article__implicit_6906 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_6906__aset(sp_Article__implicit_6906 *self, sp_sym lv_name, const char * lv_value); | |
| static inline mrb_bool sp_Article__implicit_6906_update(sp_Article__implicit_6906 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_6906__adapter_insert(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906__adapter_update(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906__adapter_delete(sp_Article__implicit_6906 *self); | |
| static sp_RbVal sp_Article__implicit_6906__adapter_reload(sp_Article__implicit_6906 *self); | |
| static inline sp_StrArray * sp_Article__implicit_6906_validate(sp_Article__implicit_6906 *self); | |
| static sp_PtrArray * sp_Article__implicit_6906_comments(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906__preload_comments(sp_Article__implicit_6906 *self, sp_PtrArray * lv_list); | |
| static inline sp_RbVal sp_Article__implicit_6906_before_destroy(sp_Article__implicit_6906 *self); | |
| static inline const char * sp_Article__implicit_6906_dom_prefix(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_after_create_commit(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_after_update_commit(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_after_destroy_commit(sp_Article__implicit_6906 *self); | |
| static sp_IntArray * sp_Article__implicit_6906_cls_schema_columns(void); | |
| static sp_Article__implicit_7484 *sp_Article__implicit_7484_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_7484_initialize(sp_Article__implicit_7484 *self, sp_StrIntHash * lv_attrs); | |
| static inline mrb_int sp_Article__implicit_7484_id(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_id_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_body(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_body_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_created_at(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_created_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_title(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_title_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_updated_at(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_updated_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_7484_assign_from_row(sp_Article__implicit_7484 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_7484_attributes(sp_Article__implicit_7484 *self); | |
| static inline sp_RbVal sp_Article__implicit_7484__aref(sp_Article__implicit_7484 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_7484__aset(sp_Article__implicit_7484 *self, sp_sym lv_name, const char * lv_value); | |
| static inline mrb_bool sp_Article__implicit_7484_update(sp_Article__implicit_7484 *self, sp_ArticleParams * lv_p); | |
| static inline mrb_int sp_Article__implicit_7484__adapter_insert(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484__adapter_update(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484__adapter_delete(sp_Article__implicit_7484 *self); | |
| static sp_RbVal sp_Article__implicit_7484__adapter_reload(sp_Article__implicit_7484 *self); | |
| static inline sp_StrArray * sp_Article__implicit_7484_validate(sp_Article__implicit_7484 *self); | |
| static sp_RbVal sp_Article__implicit_7484_comments(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484__preload_comments(sp_Article__implicit_7484 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_7484_before_destroy(sp_Article__implicit_7484 *self); | |
| static inline const char * sp_Article__implicit_7484_dom_prefix(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_after_create_commit(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_after_update_commit(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_after_destroy_commit(sp_Article__implicit_7484 *self); | |
| static sp_IntArray * sp_Article__implicit_7484_cls_schema_columns(void); | |
| static sp_Article__implicit_7995 *sp_Article__implicit_7995_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_7995_initialize(sp_Article__implicit_7995 *self, sp_StrIntHash * lv_attrs); | |
| static inline mrb_int sp_Article__implicit_7995_id(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_id_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_body(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_body_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_created_at(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_created_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_title(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_title_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_updated_at(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_updated_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_7995_assign_from_row(sp_Article__implicit_7995 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_7995_attributes(sp_Article__implicit_7995 *self); | |
| static inline sp_RbVal sp_Article__implicit_7995__aref(sp_Article__implicit_7995 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_7995__aset(sp_Article__implicit_7995 *self, sp_sym lv_name, const char * lv_value); | |
| static inline mrb_bool sp_Article__implicit_7995_update(sp_Article__implicit_7995 *self, sp_ArticleParams * lv_p); | |
| static inline mrb_int sp_Article__implicit_7995__adapter_insert(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995__adapter_update(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995__adapter_delete(sp_Article__implicit_7995 *self); | |
| static sp_RbVal sp_Article__implicit_7995__adapter_reload(sp_Article__implicit_7995 *self); | |
| static inline sp_StrArray * sp_Article__implicit_7995_validate(sp_Article__implicit_7995 *self); | |
| static sp_RbVal sp_Article__implicit_7995_comments(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995__preload_comments(sp_Article__implicit_7995 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_7995_before_destroy(sp_Article__implicit_7995 *self); | |
| static inline const char * sp_Article__implicit_7995_dom_prefix(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_after_create_commit(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_after_update_commit(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_after_destroy_commit(sp_Article__implicit_7995 *self); | |
| static sp_IntArray * sp_Article__implicit_7995_cls_schema_columns(void); | |
| static sp_Article__implicit_9355 *sp_Article__implicit_9355_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_9355_initialize(sp_Article__implicit_9355 *self, sp_StrIntHash * lv_attrs); | |
| static inline mrb_int sp_Article__implicit_9355_id(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_id_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_body(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_body_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_created_at(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_created_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_title(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_title_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_updated_at(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_updated_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_9355_assign_from_row(sp_Article__implicit_9355 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_9355_attributes(sp_Article__implicit_9355 *self); | |
| static inline sp_RbVal sp_Article__implicit_9355__aref(sp_Article__implicit_9355 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_9355__aset(sp_Article__implicit_9355 *self, sp_sym lv_name, const char * lv_value); | |
| static inline mrb_bool sp_Article__implicit_9355_update(sp_Article__implicit_9355 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_9355__adapter_insert(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355__adapter_update(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355__adapter_delete(sp_Article__implicit_9355 *self); | |
| static sp_RbVal sp_Article__implicit_9355__adapter_reload(sp_Article__implicit_9355 *self); | |
| static inline sp_StrArray * sp_Article__implicit_9355_validate(sp_Article__implicit_9355 *self); | |
| static sp_RbVal sp_Article__implicit_9355_comments(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355__preload_comments(sp_Article__implicit_9355 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_9355_before_destroy(sp_Article__implicit_9355 *self); | |
| static inline const char * sp_Article__implicit_9355_dom_prefix(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_after_create_commit(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_after_update_commit(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_after_destroy_commit(sp_Article__implicit_9355 *self); | |
| static sp_IntArray * sp_Article__implicit_9355_cls_schema_columns(void); | |
| static sp_Article__implicit_9372 *sp_Article__implicit_9372_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_9372_initialize(sp_Article__implicit_9372 *self, sp_StrIntHash * lv_attrs); | |
| static inline mrb_int sp_Article__implicit_9372_id(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_id_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_body(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_created_at(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_title(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_updated_at(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_9372_assign_from_row(sp_Article__implicit_9372 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_9372_attributes(sp_Article__implicit_9372 *self); | |
| static inline sp_RbVal sp_Article__implicit_9372__aref(sp_Article__implicit_9372 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_9372__aset(sp_Article__implicit_9372 *self, sp_sym lv_name, const char * lv_value); | |
| static inline mrb_bool sp_Article__implicit_9372_update(sp_Article__implicit_9372 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_9372__adapter_insert(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372__adapter_update(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372__adapter_delete(sp_Article__implicit_9372 *self); | |
| static sp_RbVal sp_Article__implicit_9372__adapter_reload(sp_Article__implicit_9372 *self); | |
| static inline sp_StrArray * sp_Article__implicit_9372_validate(sp_Article__implicit_9372 *self); | |
| static sp_RbVal sp_Article__implicit_9372_comments(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372__preload_comments(sp_Article__implicit_9372 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_9372_before_destroy(sp_Article__implicit_9372 *self); | |
| static inline const char * sp_Article__implicit_9372_dom_prefix(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_after_create_commit(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_after_update_commit(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_after_destroy_commit(sp_Article__implicit_9372 *self); | |
| static sp_IntArray * sp_Article__implicit_9372_cls_schema_columns(void); | |
| static const char * cst_Base64_ALPHABET = (&("\xff")[1]); | |
| static mrb_int cst_SQL_OK = 0; | |
| static mrb_int cst_SQL_ROW = 0; | |
| static mrb_int cst_SQL_DONE = 0; | |
| static sp_DbPool * cst_Db_pool = NULL; | |
| static sp_RbVal cst_Db_query_log = {SP_TAG_NIL, 0, {0}}; | |
| static sp_PolyPolyHash * cst_ActiveRecord_Registry_entries = NULL; | |
| static sp_RbVal cst_ActiveRecord_adapter = {SP_TAG_NIL, 0, {0}}; | |
| static sp_SymPolyHash * cst_ActionView_ViewHelpers_slots = NULL; | |
| static sp_StrStrHash * cst_ActionView_ViewHelpers_HTML_ESCAPES = NULL; | |
| static mrb_regexp_pattern * cst_ActionView_ViewHelpers_HTML_ESCAPE_PATTERN = NULL; | |
| static sp_SymIntHash * cst_ActionController_STATUS_CODES = NULL; | |
| static sp_StrStrHash * cst_JsonBuilder_ESCAPES = NULL; | |
| static mrb_regexp_pattern * cst_JsonBuilder_ESCAPE_PATTERN = NULL; | |
| static sp_PolyArray * cst_Broadcasts_LOG = NULL; | |
| static sp_IntArray * cst_Broadcasts_TRANSPORTS = NULL; | |
| static sp_SymPolyHash * cst_RequestDispatch_STATUS_SYMBOLS = NULL; | |
| static mrb_int cst_DbConn_CAP = 0; | |
| static mrb_int _sp_proc_fn_1(void *_cap, mrb_int *args) { | |
| (void)_cap; | |
| mrb_int lv__unused = args[0]; | |
| return sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "h2")[1]), ((void)(0), sp_box_nil()), ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| } | |
| SP_POOL_DEFINE(ActiveRecord_RecordNotFound) | |
| static inline sp_ActiveRecord_RecordNotFound *sp_ActiveRecord_RecordNotFound_new(const char * lv_message) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_message); | |
| sp_ActiveRecord_RecordNotFound *self = SP_POOL_NEW(ActiveRecord_RecordNotFound, NULL); | |
| self->cls_id = 47LL; | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_message); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_RecordNotFound_initialize(sp_ActiveRecord_RecordNotFound *self, const char * lv_message) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_message); | |
| } | |
| SP_POOL_DEFINE(ActiveRecord_RecordInvalid) | |
| static inline sp_ActiveRecord_RecordInvalid *sp_ActiveRecord_RecordInvalid_new(sp_ActiveRecord_Base * lv_record) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_record); | |
| sp_ActiveRecord_RecordInvalid *self = SP_POOL_NEW(ActiveRecord_RecordInvalid, sp_ActiveRecord_RecordInvalid_gc_scan); | |
| self->cls_id = 48LL; | |
| SP_GC_ROOT(self); | |
| self->iv_record = NULL; | |
| SP_GC_ROOT(lv_record); | |
| self->iv_record = lv_record; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_RecordInvalid_initialize(sp_ActiveRecord_RecordInvalid *self, sp_ActiveRecord_Base * lv_record) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_record); | |
| self->iv_record = lv_record; | |
| } | |
| SP_POOL_DEFINE(ActiveRecord_ConnectionAdapters_ConnectionPool) | |
| static inline sp_ActiveRecord_ConnectionAdapters_ConnectionPool *sp_ActiveRecord_ConnectionAdapters_ConnectionPool_new(mrb_int lv_size, sp_Proc *_ctor_blk) { | |
| SP_GC_SAVE(); | |
| sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self = SP_POOL_NEW(ActiveRecord_ConnectionAdapters_ConnectionPool, sp_ActiveRecord_ConnectionAdapters_ConnectionPool_gc_scan); | |
| self->cls_id = 49LL; | |
| SP_GC_ROOT(self); | |
| self->iv_free = NULL; | |
| mrb_int lv_i = 0; | |
| self->iv_size = lv_size; | |
| self->iv_free = sp_IntArray_new(); | |
| lv_i = 0LL; | |
| while ((lv_i < lv_size)) { | |
| sp_redo_1: ; | |
| sp_IntArray_push(self->iv_free, sp_proc_call(_ctor_blk, (mrb_int[]){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); | |
| lv_i += 1LL; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_initialize(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_size) { | |
| mrb_int lv_i = 0; | |
| self->iv_size = lv_size; | |
| self->iv_free = sp_IntArray_new(); | |
| lv_i = 0LL; | |
| while ((lv_i < lv_size)) { | |
| sp_redo_2: ; | |
| sp_IntArray_push(self->iv_free, 0); | |
| lv_i += 1LL; | |
| } | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkout(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| return 0; | |
| } | |
| static inline sp_IntArray * sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkin(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_handle) { | |
| (void)lv_handle; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_wait_for_handle(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t1 = (&("\xff" "ConnectionPool exhausted (size=")[1]); | |
| SP_GC_ROOT(_t1); | |
| const char * _t2 = sp_int_to_s(self->iv_size); | |
| SP_GC_ROOT(_t2); | |
| const char * _t3 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t3); | |
| sp_raise(sp_str_concat3(_t1, _t2, _t3)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_available_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_in_use_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ActiveRecord_Base) | |
| static inline sp_ActiveRecord_Base *sp_ActiveRecord_Base_new(sp_StrIntHash * lv__attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv__attrs); | |
| sp_ActiveRecord_Base *self = SP_POOL_NEW(ActiveRecord_Base, sp_ActiveRecord_Base_gc_scan); | |
| self->cls_id = 50LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| SP_GC_ROOT(lv__attrs); | |
| self->iv_id = 0LL; | |
| self->iv_errors = sp_StrArray_new(); | |
| self->iv_persisted = FALSE; | |
| self->iv_destroyed = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_Base_initialize(sp_ActiveRecord_Base *self, sp_StrIntHash * lv__attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv__attrs); | |
| self->iv_id = 0LL; | |
| self->iv_errors = sp_StrArray_new(); | |
| self->iv_persisted = FALSE; | |
| self->iv_destroyed = FALSE; | |
| } | |
| static inline sp_StrArray * sp_ActiveRecord_Base_errors(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_errors; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_insert(sp_ActiveRecord_Base *self) { | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_update(sp_ActiveRecord_Base *self) { | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_delete(sp_ActiveRecord_Base *self) { | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Base__adapter_reload(sp_ActiveRecord_Base *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Base_attributes(sp_ActiveRecord_Base *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Base__aref(sp_ActiveRecord_Base *self, sp_RbVal lv__name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv__name); | |
| SP_GC_ROOT(self); | |
| sp_raise_cls("NotImplementedError", (&("\xff" "[] must be overridden by subclass")[1])); | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base__aset(sp_ActiveRecord_Base *self, sp_sym lv__name, const char * lv__value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv__value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv__value); | |
| sp_raise_cls("NotImplementedError", (&("\xff" "[]= must be overridden by subclass")[1])); | |
| return SP_INT_NIL; | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_assign_from_row(sp_ActiveRecord_Base *self, mrb_int lv__row) { | |
| (void)lv__row; | |
| return SP_INT_NIL; | |
| } | |
| static inline const char * sp_ActiveRecord_Base_dom_prefix(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_raise_cls("NotImplementedError", (&("\xff" "dom_prefix must be overridden by subclass")[1])); | |
| return (&("\xff")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_persisted_p(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_persisted; | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_new_record_p(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (!self->iv_persisted); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_destroyed_p(sp_ActiveRecord_Base *self) { | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_mark_persisted_bang(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_persisted = TRUE; | |
| self->iv_destroyed = FALSE; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_bool sp_ActiveRecord_Base_save(sp_ActiveRecord_Base *self) { | |
| mrb_bool lv_ok = FALSE; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_ActiveRecord_Base_before_validation(self); | |
| lv_ok = sp_ActiveRecord_Base_valid_p(self); | |
| sp_ActiveRecord_Base_after_validation(self); | |
| if (!(lv_ok)) { | |
| mrb_bool _t4 = FALSE; | |
| SP_GC_RESTORE(); | |
| return _t4; | |
| } | |
| sp_ActiveRecord_Base_before_save(self); | |
| if (sp_ActiveRecord_Base_new_record_p(self)) { | |
| sp_ActiveRecord_Base_before_create(self); | |
| sp_ActiveRecord_Base_fill_timestamps(self, TRUE); | |
| mrb_int _t5 = SP_INT_NIL; | |
| switch (self->cls_id) { | |
| case 65LL: _t5 = sp_Comment__adapter_insert((sp_Comment *)self); break; | |
| case 67LL: _t5 = sp_Article__adapter_insert((sp_Article *)self); break; | |
| case 76LL: _t5 = sp_Article__implicit_6872__adapter_insert((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t5 = sp_Article__implicit_6906__adapter_insert((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t5 = sp_Article__implicit_7484__adapter_insert((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t5 = sp_Article__implicit_7995__adapter_insert((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t5 = sp_Article__implicit_9355__adapter_insert((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t5 = sp_Article__implicit_9372__adapter_insert((sp_Article__implicit_9372 *)self); break; | |
| default: _t5 = sp_ActiveRecord_Base__adapter_insert(self); break; | |
| } | |
| self->iv_id = _t5; | |
| self->iv_persisted = TRUE; | |
| sp_ActiveRecord_Base_after_create(self); | |
| mrb_int _t6 = 0; | |
| switch (self->cls_id) { | |
| case 65LL: _t6 = sp_Comment_after_create_commit((sp_Comment *)self); break; | |
| case 67LL: _t6 = sp_Article_after_create_commit((sp_Article *)self); break; | |
| case 76LL: _t6 = sp_Article__implicit_6872_after_create_commit((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t6 = sp_Article__implicit_6906_after_create_commit((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t6 = sp_Article__implicit_7484_after_create_commit((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t6 = sp_Article__implicit_7995_after_create_commit((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t6 = sp_Article__implicit_9355_after_create_commit((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t6 = sp_Article__implicit_9372_after_create_commit((sp_Article__implicit_9372 *)self); break; | |
| default: _t6 = sp_ActiveRecord_Base_after_create_commit(self); break; | |
| } | |
| _t6; | |
| } else { | |
| sp_ActiveRecord_Base_before_update(self); | |
| sp_ActiveRecord_Base_fill_timestamps(self, FALSE); | |
| mrb_int _t7 = SP_INT_NIL; | |
| switch (self->cls_id) { | |
| case 65LL: _t7 = sp_Comment__adapter_update((sp_Comment *)self); break; | |
| case 67LL: _t7 = sp_Article__adapter_update((sp_Article *)self); break; | |
| case 76LL: _t7 = sp_Article__implicit_6872__adapter_update((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t7 = sp_Article__implicit_6906__adapter_update((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t7 = sp_Article__implicit_7484__adapter_update((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t7 = sp_Article__implicit_7995__adapter_update((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t7 = sp_Article__implicit_9355__adapter_update((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t7 = sp_Article__implicit_9372__adapter_update((sp_Article__implicit_9372 *)self); break; | |
| default: _t7 = sp_ActiveRecord_Base__adapter_update(self); break; | |
| } | |
| _t7; | |
| sp_ActiveRecord_Base_after_update(self); | |
| mrb_int _t8 = 0; | |
| switch (self->cls_id) { | |
| case 65LL: _t8 = sp_Comment_after_update_commit((sp_Comment *)self); break; | |
| case 67LL: _t8 = sp_Article_after_update_commit((sp_Article *)self); break; | |
| case 76LL: _t8 = sp_Article__implicit_6872_after_update_commit((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t8 = sp_Article__implicit_6906_after_update_commit((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t8 = sp_Article__implicit_7484_after_update_commit((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t8 = sp_Article__implicit_7995_after_update_commit((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t8 = sp_Article__implicit_9355_after_update_commit((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t8 = sp_Article__implicit_9372_after_update_commit((sp_Article__implicit_9372 *)self); break; | |
| default: _t8 = sp_ActiveRecord_Base_after_update_commit(self); break; | |
| } | |
| _t8; | |
| } | |
| sp_ActiveRecord_Base_after_save(self); | |
| sp_ActiveRecord_Base_after_save_commit(self); | |
| sp_ActiveRecord_Base_after_commit(self); | |
| return TRUE; | |
| return FALSE; | |
| } | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_save_bang(sp_ActiveRecord_Base *self) { | |
| return NULL; | |
| } | |
| static sp_ActiveRecord_Base * sp_ActiveRecord_Base_destroy(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| if (!(sp_ActiveRecord_Base_persisted_p(self))) { | |
| sp_ActiveRecord_Base * _t9 = self; | |
| SP_GC_RESTORE(); | |
| return _t9; | |
| } | |
| sp_RbVal _t10 = sp_box_nil(); | |
| switch (self->cls_id) { | |
| case 67LL: _t10 = sp_Article_before_destroy((sp_Article *)self); break; | |
| case 76LL: _t10 = sp_Article__implicit_6872_before_destroy((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t10 = sp_Article__implicit_6906_before_destroy((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t10 = sp_Article__implicit_7484_before_destroy((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t10 = sp_Article__implicit_7995_before_destroy((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t10 = sp_Article__implicit_9355_before_destroy((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t10 = sp_Article__implicit_9372_before_destroy((sp_Article__implicit_9372 *)self); break; | |
| default: _t10 = sp_ActiveRecord_Base_before_destroy(self); break; | |
| } | |
| _t10; | |
| mrb_int _t11 = SP_INT_NIL; | |
| switch (self->cls_id) { | |
| case 65LL: _t11 = sp_Comment__adapter_delete((sp_Comment *)self); break; | |
| case 67LL: _t11 = sp_Article__adapter_delete((sp_Article *)self); break; | |
| case 76LL: _t11 = sp_Article__implicit_6872__adapter_delete((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t11 = sp_Article__implicit_6906__adapter_delete((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t11 = sp_Article__implicit_7484__adapter_delete((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t11 = sp_Article__implicit_7995__adapter_delete((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t11 = sp_Article__implicit_9355__adapter_delete((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t11 = sp_Article__implicit_9372__adapter_delete((sp_Article__implicit_9372 *)self); break; | |
| default: _t11 = sp_ActiveRecord_Base__adapter_delete(self); break; | |
| } | |
| _t11; | |
| self->iv_persisted = FALSE; | |
| self->iv_destroyed = TRUE; | |
| sp_ActiveRecord_Base_after_destroy(self); | |
| mrb_int _t12 = 0; | |
| switch (self->cls_id) { | |
| case 65LL: _t12 = sp_Comment_after_destroy_commit((sp_Comment *)self); break; | |
| case 67LL: _t12 = sp_Article_after_destroy_commit((sp_Article *)self); break; | |
| case 76LL: _t12 = sp_Article__implicit_6872_after_destroy_commit((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t12 = sp_Article__implicit_6906_after_destroy_commit((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t12 = sp_Article__implicit_7484_after_destroy_commit((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t12 = sp_Article__implicit_7995_after_destroy_commit((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t12 = sp_Article__implicit_9355_after_destroy_commit((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t12 = sp_Article__implicit_9372_after_destroy_commit((sp_Article__implicit_9372 *)self); break; | |
| default: _t12 = sp_ActiveRecord_Base_after_destroy_commit(self); break; | |
| } | |
| _t12; | |
| sp_ActiveRecord_Base_after_commit(self); | |
| return self; | |
| return NULL; | |
| } | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_reload(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t13 = sp_box_nil(); | |
| switch (self->cls_id) { | |
| case 65LL: _t13 = sp_Comment__adapter_reload((sp_Comment *)self); break; | |
| case 67LL: _t13 = sp_Article__adapter_reload((sp_Article *)self); break; | |
| case 76LL: _t13 = sp_Article__implicit_6872__adapter_reload((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t13 = sp_Article__implicit_6906__adapter_reload((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t13 = sp_Article__implicit_7484__adapter_reload((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t13 = sp_Article__implicit_7995__adapter_reload((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t13 = sp_Article__implicit_9355__adapter_reload((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t13 = sp_Article__implicit_9372__adapter_reload((sp_Article__implicit_9372 *)self); break; | |
| default: _t13 = sp_ActiveRecord_Base__adapter_reload(self); break; | |
| } | |
| _t13; | |
| return self; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_validation(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_validation(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_save(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_save(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_create(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_create(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_update(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_update(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Base_before_destroy(sp_ActiveRecord_Base *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_create_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_update_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_save_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_touch(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline sp_StrArray * sp_ActiveRecord_Base_validate(sp_ActiveRecord_Base *self) { | |
| return NULL; | |
| } | |
| static mrb_int sp_ActiveRecord_Base_fill_timestamps(sp_ActiveRecord_Base *self, mrb_bool lv_creating) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_cols = sp_box_nil(); | |
| const char * lv_now = (&("\xff")[1]); | |
| SP_GC_ROOT_RBVAL(lv_cols); | |
| SP_GC_ROOT(lv_now); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t14 = sp_box_nil(); | |
| switch (self->cls_id) { | |
| case 63LL: _t14 = sp_box_int(sp_ApplicationRecord_cls_schema_columns()); break; | |
| case 65LL: _t14 = sp_box_sym_array(sp_Comment_cls_schema_columns()); break; | |
| case 67LL: _t14 = sp_box_sym_array(sp_Article_cls_schema_columns()); break; | |
| case 76LL: _t14 = sp_box_sym_array(sp_Article__implicit_6872_cls_schema_columns()); break; | |
| case 77LL: _t14 = sp_box_sym_array(sp_Article__implicit_6906_cls_schema_columns()); break; | |
| case 78LL: _t14 = sp_box_sym_array(sp_Article__implicit_7484_cls_schema_columns()); break; | |
| case 79LL: _t14 = sp_box_sym_array(sp_Article__implicit_7995_cls_schema_columns()); break; | |
| case 80LL: _t14 = sp_box_sym_array(sp_Article__implicit_9355_cls_schema_columns()); break; | |
| case 81LL: _t14 = sp_box_sym_array(sp_Article__implicit_9372_cls_schema_columns()); break; | |
| default: _t14 = sp_box_int(sp_ActiveRecord_Base_cls_schema_columns()); break; | |
| } | |
| lv_cols = _t14; | |
| lv_now = sp_time_iso8601(sp_time_utc(sp_time_now())); | |
| sp_RbVal _t15 = lv_cols; | |
| mrb_bool _t16 = FALSE; | |
| if (_t15.tag == SP_TAG_OBJ) { | |
| if (_t15.cls_id == 53) _t16 = sp_ActionDispatch_Flash_include_p((sp_ActionDispatch_Flash *)_t15.v.p, SPS_updated_at); | |
| if (_t15.cls_id == 54) _t16 = sp_ActionDispatch_Session_include_p((sp_ActionDispatch_Session *)_t15.v.p, SPS_updated_at); | |
| if (_t15.cls_id == SP_BUILTIN_SYM_ARRAY) _t16 = sp_IntArray_include((sp_IntArray *)_t15.v.p, (mrb_int)(SPS_updated_at)); | |
| if (_t15.cls_id == SP_BUILTIN_SYM_INT_HASH) _t16 = sp_SymIntHash_has_key((sp_SymIntHash *)_t15.v.p, SPS_updated_at); | |
| if (_t15.cls_id == SP_BUILTIN_SYM_STR_HASH) _t16 = sp_SymStrHash_has_key((sp_SymStrHash *)_t15.v.p, SPS_updated_at); | |
| if (_t15.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t16 = sp_SymPolyHash_has_key((sp_SymPolyHash *)_t15.v.p, SPS_updated_at); | |
| } | |
| if (_t16) { | |
| switch (self->cls_id) { | |
| case 65LL: sp_Comment__aset((sp_Comment *)self, SPS_updated_at, lv_now); break; | |
| case 67LL: sp_Article__aset((sp_Article *)self, SPS_updated_at, lv_now); break; | |
| case 76LL: sp_Article__implicit_6872__aset((sp_Article__implicit_6872 *)self, SPS_updated_at, lv_now); break; | |
| case 77LL: sp_Article__implicit_6906__aset((sp_Article__implicit_6906 *)self, SPS_updated_at, lv_now); break; | |
| case 78LL: sp_Article__implicit_7484__aset((sp_Article__implicit_7484 *)self, SPS_updated_at, lv_now); break; | |
| case 79LL: sp_Article__implicit_7995__aset((sp_Article__implicit_7995 *)self, SPS_updated_at, lv_now); break; | |
| case 80LL: sp_Article__implicit_9355__aset((sp_Article__implicit_9355 *)self, SPS_updated_at, lv_now); break; | |
| case 81LL: sp_Article__implicit_9372__aset((sp_Article__implicit_9372 *)self, SPS_updated_at, lv_now); break; | |
| default: sp_ActiveRecord_Base__aset(self, SPS_updated_at, lv_now); break; | |
| } | |
| } | |
| mrb_bool _t18 = lv_creating; | |
| mrb_bool _t19 = FALSE; | |
| if (_t18) { | |
| sp_RbVal _t20 = lv_cols; | |
| mrb_bool _t21 = FALSE; | |
| if (_t20.tag == SP_TAG_OBJ) { | |
| if (_t20.cls_id == 53) _t21 = sp_ActionDispatch_Flash_include_p((sp_ActionDispatch_Flash *)_t20.v.p, SPS_created_at); | |
| if (_t20.cls_id == 54) _t21 = sp_ActionDispatch_Session_include_p((sp_ActionDispatch_Session *)_t20.v.p, SPS_created_at); | |
| if (_t20.cls_id == SP_BUILTIN_SYM_ARRAY) _t21 = sp_IntArray_include((sp_IntArray *)_t20.v.p, (mrb_int)(SPS_created_at)); | |
| if (_t20.cls_id == SP_BUILTIN_SYM_INT_HASH) _t21 = sp_SymIntHash_has_key((sp_SymIntHash *)_t20.v.p, SPS_created_at); | |
| if (_t20.cls_id == SP_BUILTIN_SYM_STR_HASH) _t21 = sp_SymStrHash_has_key((sp_SymStrHash *)_t20.v.p, SPS_created_at); | |
| if (_t20.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t21 = sp_SymPolyHash_has_key((sp_SymPolyHash *)_t20.v.p, SPS_created_at); | |
| } | |
| _t19 = _t21; | |
| } else { | |
| _t19 = _t18; | |
| } | |
| mrb_bool _t17 = _t19; | |
| mrb_bool _t22 = FALSE; | |
| if (_t17) { | |
| sp_RbVal _t23 = sp_box_nil(); | |
| switch (self->cls_id) { | |
| case 65LL: _t23 = sp_Comment__aref((sp_Comment *)self, sp_box_sym(SPS_created_at)); break; | |
| case 67LL: _t23 = sp_Article__aref((sp_Article *)self, sp_box_sym(SPS_created_at)); break; | |
| case 76LL: _t23 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)self, sp_box_sym(SPS_created_at)); break; | |
| case 77LL: _t23 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)self, sp_box_sym(SPS_created_at)); break; | |
| case 78LL: _t23 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)self, sp_box_sym(SPS_created_at)); break; | |
| case 79LL: _t23 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)self, sp_box_sym(SPS_created_at)); break; | |
| case 80LL: _t23 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)self, sp_box_sym(SPS_created_at)); break; | |
| case 81LL: _t23 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)self, sp_box_sym(SPS_created_at)); break; | |
| default: _t23 = sp_ActiveRecord_Base__aref(self, sp_box_sym(SPS_created_at)); break; | |
| } | |
| _t22 = sp_poly_nil_p(_t23); | |
| } else { | |
| _t22 = _t17; | |
| } | |
| if (_t22) { | |
| switch (self->cls_id) { | |
| case 65LL: sp_Comment__aset((sp_Comment *)self, SPS_created_at, lv_now); break; | |
| case 67LL: sp_Article__aset((sp_Article *)self, SPS_created_at, lv_now); break; | |
| case 76LL: sp_Article__implicit_6872__aset((sp_Article__implicit_6872 *)self, SPS_created_at, lv_now); break; | |
| case 77LL: sp_Article__implicit_6906__aset((sp_Article__implicit_6906 *)self, SPS_created_at, lv_now); break; | |
| case 78LL: sp_Article__implicit_7484__aset((sp_Article__implicit_7484 *)self, SPS_created_at, lv_now); break; | |
| case 79LL: sp_Article__implicit_7995__aset((sp_Article__implicit_7995 *)self, SPS_created_at, lv_now); break; | |
| case 80LL: sp_Article__implicit_9355__aset((sp_Article__implicit_9355 *)self, SPS_created_at, lv_now); break; | |
| case 81LL: sp_Article__implicit_9372__aset((sp_Article__implicit_9372 *)self, SPS_created_at, lv_now); break; | |
| default: sp_ActiveRecord_Base__aset(self, SPS_created_at, lv_now); break; | |
| } | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_valid_p(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_errors = sp_StrArray_new(); | |
| sp_StrArray * _t24 = NULL; | |
| switch (self->cls_id) { | |
| case 65LL: _t24 = sp_Comment_validate((sp_Comment *)self); break; | |
| case 67LL: _t24 = sp_Article_validate((sp_Article *)self); break; | |
| case 76LL: _t24 = sp_Article__implicit_6872_validate((sp_Article__implicit_6872 *)self); break; | |
| case 77LL: _t24 = sp_Article__implicit_6906_validate((sp_Article__implicit_6906 *)self); break; | |
| case 78LL: _t24 = sp_Article__implicit_7484_validate((sp_Article__implicit_7484 *)self); break; | |
| case 79LL: _t24 = sp_Article__implicit_7995_validate((sp_Article__implicit_7995 *)self); break; | |
| case 80LL: _t24 = sp_Article__implicit_9355_validate((sp_Article__implicit_9355 *)self); break; | |
| case 81LL: _t24 = sp_Article__implicit_9372_validate((sp_Article__implicit_9372 *)self); break; | |
| default: _t24 = sp_ActiveRecord_Base_validate(self); break; | |
| } | |
| _t24; | |
| return sp_StrArray_empty(self->iv_errors); | |
| return FALSE; | |
| } | |
| static mrb_int sp_ActiveRecord_Base_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_raise_cls("NotImplementedError", sp_sprintf("%s.schema_columns must be overridden", sp_class_to_s(((sp_Class){50LL})))); | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Router_Route) | |
| static inline sp_ActionDispatch_Router_Route *sp_ActionDispatch_Router_Route_new(const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_verb); | |
| SP_GC_ROOT(lv_pattern); | |
| sp_ActionDispatch_Router_Route *self = SP_POOL_NEW(ActionDispatch_Router_Route, sp_ActionDispatch_Router_Route_gc_scan); | |
| self->cls_id = 51LL; | |
| SP_GC_ROOT(self); | |
| self->iv_verb = NULL; | |
| self->iv_pattern = NULL; | |
| SP_GC_ROOT(lv_verb); | |
| SP_GC_ROOT(lv_pattern); | |
| self->iv_verb = lv_verb; | |
| self->iv_pattern = lv_pattern; | |
| self->iv_controller = lv_controller; | |
| self->iv_action = lv_action; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Router_Route_initialize(sp_ActionDispatch_Router_Route *self, const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_verb); | |
| SP_GC_ROOT(lv_pattern); | |
| self->iv_verb = lv_verb; | |
| self->iv_pattern = lv_pattern; | |
| self->iv_controller = lv_controller; | |
| self->iv_action = lv_action; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Router_MatchResult) | |
| static inline sp_ActionDispatch_Router_MatchResult *sp_ActionDispatch_Router_MatchResult_new(sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path_params); | |
| sp_ActionDispatch_Router_MatchResult *self = SP_POOL_NEW(ActionDispatch_Router_MatchResult, sp_ActionDispatch_Router_MatchResult_gc_scan); | |
| self->cls_id = 52LL; | |
| SP_GC_ROOT(self); | |
| self->iv_path_params = NULL; | |
| SP_GC_ROOT(lv_path_params); | |
| self->iv_controller = lv_controller; | |
| self->iv_action = lv_action; | |
| self->iv_path_params = lv_path_params; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Router_MatchResult_initialize(sp_ActionDispatch_Router_MatchResult *self, sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path_params); | |
| self->iv_controller = lv_controller; | |
| self->iv_action = lv_action; | |
| self->iv_path_params = lv_path_params; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Flash) | |
| static inline sp_ActionDispatch_Flash *sp_ActionDispatch_Flash_new(sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| sp_ActionDispatch_Flash *self = SP_POOL_NEW(ActionDispatch_Flash, sp_ActionDispatch_Flash_gc_scan); | |
| self->cls_id = 53LL; | |
| SP_GC_ROOT(self); | |
| self->iv_notice = sp_box_nil(); | |
| self->iv_alert = sp_box_nil(); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| self->iv_notice = ((void)(0), sp_box_nil()); | |
| self->iv_alert = ((void)(0), sp_box_nil()); | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| sp_RbVal _t25 = lv_other; | |
| sp_RbVal _t26 = sp_box_nil(); | |
| if (_t25.tag == SP_TAG_OBJ) { | |
| if (_t25.cls_id == 50) _t26 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 53) _t26 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 54) _t26 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 63) _t26 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 65) _t26 = sp_Comment__aref((sp_Comment *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 76) _t26 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 77) _t26 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 78) _t26 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 79) _t26 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 80) _t26 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 81) _t26 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == SP_BUILTIN_STR_INT_HASH) _t26 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t25.v.p, (&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == SP_BUILTIN_STR_STR_HASH) _t26 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t25.v.p, (&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == SP_BUILTIN_STR_POLY_HASH) _t26 = sp_StrPolyHash_get((sp_StrPolyHash *)_t25.v.p, (&("\xff" "notice")[1])); | |
| } | |
| lv_v = _t26; | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_notice = lv_v; | |
| } | |
| sp_RbVal _t27 = lv_other; | |
| sp_RbVal _t28 = sp_box_nil(); | |
| if (_t27.tag == SP_TAG_OBJ) { | |
| if (_t27.cls_id == 50) _t28 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 53) _t28 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 54) _t28 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 63) _t28 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 65) _t28 = sp_Comment__aref((sp_Comment *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 76) _t28 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 77) _t28 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 78) _t28 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 79) _t28 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 80) _t28 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 81) _t28 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == SP_BUILTIN_STR_INT_HASH) _t28 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t27.v.p, (&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == SP_BUILTIN_STR_STR_HASH) _t28 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t27.v.p, (&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == SP_BUILTIN_STR_POLY_HASH) _t28 = sp_StrPolyHash_get((sp_StrPolyHash *)_t27.v.p, (&("\xff" "alert")[1])); | |
| } | |
| lv_v = _t28; | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_alert = lv_v; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Flash_initialize(sp_ActionDispatch_Flash *self, sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| self->iv_notice = ((void)(0), sp_box_nil()); | |
| self->iv_alert = ((void)(0), sp_box_nil()); | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return; | |
| } | |
| sp_RbVal _t29 = lv_other; | |
| sp_RbVal _t30 = sp_box_nil(); | |
| if (_t29.tag == SP_TAG_OBJ) { | |
| if (_t29.cls_id == 50) _t30 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 53) _t30 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 54) _t30 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 63) _t30 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 65) _t30 = sp_Comment__aref((sp_Comment *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 76) _t30 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 77) _t30 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 78) _t30 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 79) _t30 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 80) _t30 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == 81) _t30 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t29.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == SP_BUILTIN_STR_INT_HASH) _t30 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t29.v.p, (&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == SP_BUILTIN_STR_STR_HASH) _t30 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t29.v.p, (&("\xff" "notice")[1]))); | |
| if (_t29.cls_id == SP_BUILTIN_STR_POLY_HASH) _t30 = sp_StrPolyHash_get((sp_StrPolyHash *)_t29.v.p, (&("\xff" "notice")[1])); | |
| } | |
| lv_v = _t30; | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_notice = lv_v; | |
| } | |
| sp_RbVal _t31 = lv_other; | |
| sp_RbVal _t32 = sp_box_nil(); | |
| if (_t31.tag == SP_TAG_OBJ) { | |
| if (_t31.cls_id == 50) _t32 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 53) _t32 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 54) _t32 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 63) _t32 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 65) _t32 = sp_Comment__aref((sp_Comment *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 76) _t32 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 77) _t32 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 78) _t32 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 79) _t32 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 80) _t32 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == 81) _t32 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t31.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == SP_BUILTIN_STR_INT_HASH) _t32 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t31.v.p, (&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == SP_BUILTIN_STR_STR_HASH) _t32 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t31.v.p, (&("\xff" "alert")[1]))); | |
| if (_t31.cls_id == SP_BUILTIN_STR_POLY_HASH) _t32 = sp_StrPolyHash_get((sp_StrPolyHash *)_t31.v.p, (&("\xff" "alert")[1])); | |
| } | |
| lv_v = _t32; | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_alert = lv_v; | |
| } | |
| } | |
| static sp_RbVal sp_ActionDispatch_Flash__aref(sp_ActionDispatch_Flash *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| lv_k = sp_poly_to_s(lv_key); | |
| if (sp_str_eq(lv_k, (&("\xff" "notice")[1]))) { | |
| sp_RbVal _t33 = self->iv_notice; | |
| SP_GC_RESTORE(); | |
| return _t33; | |
| } | |
| if (sp_str_eq(lv_k, (&("\xff" "alert")[1]))) { | |
| sp_RbVal _t34 = self->iv_alert; | |
| SP_GC_RESTORE(); | |
| return _t34; | |
| } | |
| sp_RbVal _t35 = ((void)(0), sp_box_nil()); | |
| SP_GC_RESTORE(); | |
| return _t35; | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_ActionDispatch_Flash__aset(sp_ActionDispatch_Flash *self, sp_sym lv_key, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| lv_k = sp_sym_to_s(lv_key); | |
| if (sp_str_eq(lv_k, (&("\xff" "notice")[1]))) { | |
| self->iv_notice = sp_box_nullable_str(lv_value); | |
| } else { | |
| if (sp_str_eq(lv_k, (&("\xff" "alert")[1]))) { | |
| self->iv_alert = sp_box_nullable_str(lv_value); | |
| } | |
| } | |
| return (const char *)lv_value; | |
| return NULL; | |
| } | |
| static inline sp_RbVal sp_ActionDispatch_Flash_fetch(sp_ActionDispatch_Flash *self, const char * lv_key, sp_RbVal lv_default) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT(lv_key); | |
| SP_GC_ROOT_RBVAL(lv_default); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_key); | |
| lv_v = sp_ActionDispatch_Flash__aref(self, sp_box_str(lv_key)); | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| sp_RbVal _t36 = lv_v; | |
| SP_GC_RESTORE(); | |
| return _t36; | |
| } | |
| sp_RbVal _t37 = lv_default; | |
| SP_GC_RESTORE(); | |
| return _t37; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_key_p(sp_ActionDispatch_Flash *self, sp_sym lv_key) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT(self); | |
| lv_v = sp_ActionDispatch_Flash__aref(self, sp_box_sym(lv_key)); | |
| return (!sp_poly_nil_p(lv_v)); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_has_key_p(sp_ActionDispatch_Flash *self, mrb_int lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_ActionDispatch_Flash_key_p(self, lv_key); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_include_p(sp_ActionDispatch_Flash *self, sp_sym lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_ActionDispatch_Flash_key_p(self, lv_key); | |
| return FALSE; | |
| } | |
| static sp_RbVal sp_ActionDispatch_Flash_delete(sp_ActionDispatch_Flash *self, mrb_int lv_key) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT(self); | |
| lv_k = sp_int_to_s(lv_key); | |
| if (sp_str_eq(lv_k, (&("\xff" "notice")[1]))) { | |
| lv_v = self->iv_notice; | |
| self->iv_notice = ((void)(0), sp_box_nil()); | |
| sp_RbVal _t38 = lv_v; | |
| SP_GC_RESTORE(); | |
| return _t38; | |
| } | |
| if (sp_str_eq(lv_k, (&("\xff" "alert")[1]))) { | |
| lv_v = self->iv_alert; | |
| self->iv_alert = ((void)(0), sp_box_nil()); | |
| sp_RbVal _t39 = lv_v; | |
| SP_GC_RESTORE(); | |
| return _t39; | |
| } | |
| sp_RbVal _t40 = ((void)(0), sp_box_nil()); | |
| SP_GC_RESTORE(); | |
| return _t40; | |
| return sp_box_nil(); | |
| } | |
| static mrb_int sp_ActionDispatch_Flash_length(sp_ActionDispatch_Flash *self) { | |
| mrb_int lv_n = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| lv_n = 0LL; | |
| if ((!sp_poly_nil_p(self->iv_notice))) { | |
| lv_n += 1LL; | |
| } | |
| if ((!sp_poly_nil_p(self->iv_alert))) { | |
| lv_n += 1LL; | |
| } | |
| return lv_n; | |
| return 0; | |
| } | |
| static mrb_int sp_ActionDispatch_Flash_size(sp_ActionDispatch_Flash *self) { | |
| mrb_int lv_n = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| lv_n = 0LL; | |
| if ((!sp_poly_nil_p(self->iv_notice))) { | |
| lv_n += 1LL; | |
| } | |
| if ((!sp_poly_nil_p(self->iv_alert))) { | |
| lv_n += 1LL; | |
| } | |
| return lv_n; | |
| return 0; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_empty_p(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| mrb_bool _t41 = sp_poly_nil_p(self->iv_notice); | |
| mrb_bool _t42 = FALSE; | |
| if (_t41) { | |
| _t42 = sp_poly_nil_p(self->iv_alert); | |
| } else { | |
| _t42 = _t41; | |
| } | |
| return _t42; | |
| return FALSE; | |
| } | |
| static sp_StrArray * sp_ActionDispatch_Flash_keys(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| lv_result = sp_StrArray_new(); | |
| if ((!sp_poly_nil_p(self->iv_notice))) { | |
| sp_StrArray_push(lv_result, (&("\xff" "notice")[1])); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_alert))) { | |
| sp_StrArray_push(lv_result, (&("\xff" "alert")[1])); | |
| } | |
| return (sp_StrArray *)lv_result; | |
| return NULL; | |
| } | |
| static sp_PolyArray * sp_ActionDispatch_Flash_values(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| sp_PolyArray * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| lv_result = sp_PolyArray_new(); | |
| if ((!sp_poly_nil_p(self->iv_notice))) { | |
| (sp_PolyArray_push(lv_result, self->iv_notice), lv_result); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_alert))) { | |
| (sp_PolyArray_push(lv_result, self->iv_alert), lv_result); | |
| } | |
| return (sp_PolyArray *)lv_result; | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_each(sp_ActionDispatch_Flash *self, void (*_block)(const char *, sp_RbVal, void*), void *_benv) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| if ((!sp_poly_nil_p(self->iv_notice))) { | |
| if (_block) _block((&("\xff" "notice")[1]), self->iv_notice, _benv); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_alert))) { | |
| if (_block) _block((&("\xff" "alert")[1]), self->iv_alert, _benv); | |
| } | |
| return self; | |
| return NULL; | |
| } | |
| static sp_StrPolyHash * sp_ActionDispatch_Flash_to_h(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| sp_StrPolyHash * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| lv_result = sp_StrPolyHash_new(); | |
| if ((!sp_poly_nil_p(self->iv_notice))) { | |
| if (sp_gc_is_frozen(lv_result)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_result, (&("\xff" "notice")[1]), self->iv_notice); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_alert))) { | |
| if (sp_gc_is_frozen(lv_result)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_result, (&("\xff" "alert")[1]), self->iv_alert); | |
| } | |
| return (sp_StrPolyHash *)lv_result; | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_merge(sp_ActionDispatch_Flash *self, mrb_int lv_other) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_Flash * lv_result = NULL; | |
| mrb_int lv_k = 0; | |
| mrb_int lv_v = 0; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| lv_result = sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())); | |
| lv_result->iv_notice = self->iv_notice; | |
| lv_result->iv_alert = self->iv_alert; | |
| return (sp_ActionDispatch_Flash *)lv_result; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Session) | |
| static inline sp_ActionDispatch_Session *sp_ActionDispatch_Session_new(sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| sp_ActionDispatch_Session *self = SP_POOL_NEW(ActionDispatch_Session, sp_ActionDispatch_Session_gc_scan); | |
| self->cls_id = 54LL; | |
| SP_GC_ROOT(self); | |
| self->iv_data = NULL; | |
| sp_StrArray * lv_keys = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_keys); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| self->iv_data = sp_StrPolyHash_new(); | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| sp_RbVal _t43 = lv_other; | |
| sp_StrArray * _t44 = NULL; | |
| if (_t43.tag == SP_TAG_OBJ) { | |
| if (_t43.cls_id == 53) _t44 = sp_ActionDispatch_Flash_keys((sp_ActionDispatch_Flash *)_t43.v.p); | |
| if (_t43.cls_id == 54) _t44 = sp_ActionDispatch_Session_keys((sp_ActionDispatch_Session *)_t43.v.p); | |
| } | |
| lv_keys = _t44; | |
| lv_i = 0LL; | |
| mrb_int _t45 = sp_StrArray_length(lv_keys); | |
| while ((lv_i < sp_StrArray_length(lv_keys))) { | |
| sp_redo_3: ; | |
| lv_k = sp_StrArray_get(lv_keys, lv_i); | |
| sp_RbVal _t46 = lv_other; | |
| sp_RbVal _t47 = sp_box_nil(); | |
| if (_t46.tag == SP_TAG_OBJ) { | |
| if (_t46.cls_id == 50) _t47 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 53) _t47 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 54) _t47 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 63) _t47 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 65) _t47 = sp_Comment__aref((sp_Comment *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 76) _t47 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 77) _t47 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 78) _t47 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 79) _t47 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 80) _t47 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 81) _t47 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == SP_BUILTIN_STR_INT_HASH) _t47 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t46.v.p, lv_k)); | |
| if (_t46.cls_id == SP_BUILTIN_STR_STR_HASH) _t47 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t46.v.p, lv_k)); | |
| if (_t46.cls_id == SP_BUILTIN_STR_POLY_HASH) _t47 = sp_StrPolyHash_get((sp_StrPolyHash *)_t46.v.p, lv_k); | |
| } | |
| lv_v = _t47; | |
| if (sp_gc_is_frozen(self->iv_data)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(self->iv_data, lv_k, lv_v); | |
| lv_i += 1LL; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Session_initialize(sp_ActionDispatch_Session *self, sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_keys = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_keys); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| self->iv_data = sp_StrPolyHash_new(); | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return; | |
| } | |
| sp_RbVal _t48 = lv_other; | |
| sp_StrArray * _t49 = NULL; | |
| if (_t48.tag == SP_TAG_OBJ) { | |
| if (_t48.cls_id == 53) _t49 = sp_ActionDispatch_Flash_keys((sp_ActionDispatch_Flash *)_t48.v.p); | |
| if (_t48.cls_id == 54) _t49 = sp_ActionDispatch_Session_keys((sp_ActionDispatch_Session *)_t48.v.p); | |
| } | |
| lv_keys = _t49; | |
| lv_i = 0LL; | |
| mrb_int _t50 = sp_StrArray_length(lv_keys); | |
| while ((lv_i < sp_StrArray_length(lv_keys))) { | |
| sp_redo_4: ; | |
| lv_k = sp_StrArray_get(lv_keys, lv_i); | |
| sp_RbVal _t51 = lv_other; | |
| sp_RbVal _t52 = sp_box_nil(); | |
| if (_t51.tag == SP_TAG_OBJ) { | |
| if (_t51.cls_id == 50) _t52 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 53) _t52 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 54) _t52 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 63) _t52 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 65) _t52 = sp_Comment__aref((sp_Comment *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 76) _t52 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 77) _t52 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 78) _t52 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 79) _t52 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 80) _t52 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == 81) _t52 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t51.v.p, sp_box_str(lv_k)); | |
| if (_t51.cls_id == SP_BUILTIN_STR_INT_HASH) _t52 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t51.v.p, lv_k)); | |
| if (_t51.cls_id == SP_BUILTIN_STR_STR_HASH) _t52 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t51.v.p, lv_k)); | |
| if (_t51.cls_id == SP_BUILTIN_STR_POLY_HASH) _t52 = sp_StrPolyHash_get((sp_StrPolyHash *)_t51.v.p, lv_k); | |
| } | |
| lv_v = _t52; | |
| if (sp_gc_is_frozen(self->iv_data)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(self->iv_data, lv_k, lv_v); | |
| lv_i += 1LL; | |
| } | |
| } | |
| static sp_RbVal sp_ActionDispatch_Session__aref(sp_ActionDispatch_Session *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| lv_k = sp_poly_to_s(lv_key); | |
| if (sp_StrPolyHash_has_key(self->iv_data, lv_k)) { | |
| sp_RbVal _t53 = sp_StrPolyHash_get(self->iv_data, lv_k); | |
| SP_GC_RESTORE(); | |
| return _t53; | |
| } | |
| sp_RbVal _t54 = ((void)(0), sp_box_nil()); | |
| SP_GC_RESTORE(); | |
| return _t54; | |
| return sp_box_nil(); | |
| } | |
| static sp_RbVal sp_ActionDispatch_Session__aset(sp_ActionDispatch_Session *self, mrb_int lv_key, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| if (sp_gc_is_frozen(self->iv_data)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(self->iv_data, sp_int_to_s(lv_key), lv_value); | |
| sp_RbVal _t55 = lv_value; | |
| SP_GC_RESTORE(); | |
| return _t55; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActionDispatch_Session_fetch(sp_ActionDispatch_Session *self, const char * lv_key, sp_RbVal lv_default) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT(lv_key); | |
| SP_GC_ROOT_RBVAL(lv_default); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_key); | |
| lv_k = lv_key; | |
| if (sp_StrPolyHash_has_key(self->iv_data, lv_k)) { | |
| sp_RbVal _t56 = sp_StrPolyHash_get(self->iv_data, lv_k); | |
| SP_GC_RESTORE(); | |
| return _t56; | |
| } | |
| sp_RbVal _t57 = lv_default; | |
| SP_GC_RESTORE(); | |
| return _t57; | |
| return sp_box_nil(); | |
| } | |
| static mrb_bool sp_ActionDispatch_Session_key_p(sp_ActionDispatch_Session *self, mrb_int lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_StrPolyHash_has_key(self->iv_data, sp_int_to_s(lv_key)); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Session_has_key_p(sp_ActionDispatch_Session *self, mrb_int lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_StrPolyHash_has_key(self->iv_data, sp_int_to_s(lv_key)); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Session_include_p(sp_ActionDispatch_Session *self, sp_sym lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_StrPolyHash_has_key(self->iv_data, sp_sym_to_s(lv_key)); | |
| return FALSE; | |
| } | |
| static sp_RbVal sp_ActionDispatch_Session_delete(sp_ActionDispatch_Session *self, mrb_int lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| ({ sp_raise_cls("NoMethodError", "undefined method 'delete' for str_poly_hash"); (mrb_int)0; }); | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static mrb_int sp_ActionDispatch_Session_length(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_StrPolyHash_length(self->iv_data); | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionDispatch_Session_size(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_StrPolyHash_length(self->iv_data); | |
| return 0; | |
| } | |
| static mrb_bool sp_ActionDispatch_Session_empty_p(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (sp_StrPolyHash_length(self->iv_data) == 0); | |
| return FALSE; | |
| } | |
| static sp_StrArray * sp_ActionDispatch_Session_keys(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_StrPolyHash_keys(self->iv_data); | |
| return NULL; | |
| } | |
| static sp_PolyArray * sp_ActionDispatch_Session_values(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_StrPolyHash_values(self->iv_data); | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Session * sp_ActionDispatch_Session_each(sp_ActionDispatch_Session *self, void (*_block)(const char *, sp_RbVal, void*), void *_benv) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_keys = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_keys); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT(self); | |
| lv_keys = sp_StrPolyHash_keys(self->iv_data); | |
| lv_i = 0LL; | |
| mrb_int _t58 = sp_StrArray_length(lv_keys); | |
| while ((lv_i < sp_StrArray_length(lv_keys))) { | |
| sp_redo_5: ; | |
| lv_k = sp_StrArray_get(lv_keys, lv_i); | |
| lv_v = sp_StrPolyHash_get(self->iv_data, lv_k); | |
| if (_block) _block(lv_k, lv_v, _benv); | |
| lv_i += 1LL; | |
| } | |
| return self; | |
| return NULL; | |
| } | |
| static inline sp_StrPolyHash * sp_ActionDispatch_Session_to_h(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_data; | |
| return NULL; | |
| } | |
| static inline sp_ActionDispatch_Session * sp_ActionDispatch_Session_merge(sp_ActionDispatch_Session *self, mrb_int lv_other) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_Session * lv_result = NULL; | |
| mrb_int lv_k = 0; | |
| mrb_int lv_v = 0; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| lv_result = sp_ActionDispatch_Session_new(sp_box_obj((void *)(sp_ActionDispatch_Session_to_h(self)), SP_BUILTIN_STR_POLY_HASH)); | |
| return (sp_ActionDispatch_Session *)lv_result; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ActionView_Slots) | |
| static inline sp_ActionView_Slots *sp_ActionView_Slots_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ActionView_Slots *self = SP_POOL_NEW(ActionView_Slots, sp_ActionView_Slots_gc_scan); | |
| self->cls_id = 55LL; | |
| SP_GC_ROOT(self); | |
| self->iv_slots = NULL; | |
| self->iv_slots = sp_SymIntHash_new(); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionView_Slots_initialize(sp_ActionView_Slots *self) { | |
| self->iv_slots = sp_SymIntHash_new(); | |
| } | |
| static inline mrb_int sp_ActionView_Slots_reset_bang(sp_ActionView_Slots *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_slots = sp_SymIntHash_new(); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionView_Slots_set(sp_ActionView_Slots *self, sp_sym lv_slot, mrb_int lv_value) { | |
| (void)lv_slot; | |
| (void)lv_value; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionView_Slots_get(sp_ActionView_Slots *self, mrb_int lv_slot) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (sp_SymIntHash_has_key(self->iv_slots, lv_slot) ? sp_SymIntHash_get(self->iv_slots, lv_slot) : SP_INT_NIL); | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_ActionView_Slots_bracket_get(sp_ActionView_Slots *self, mrb_int lv_slot) { | |
| (void)lv_slot; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActionView_Slots_get_yield(sp_ActionView_Slots *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ActionView_Slots_set_yield(sp_ActionView_Slots *self, mrb_int lv_content) { | |
| (void)lv_content; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ActionController_Base) | |
| static inline sp_ActionController_Base *sp_ActionController_Base_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ActionController_Base *self = SP_POOL_NEW(ActionController_Base, sp_ActionController_Base_gc_scan); | |
| self->cls_id = 56LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = sp_box_nil(); | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| self->iv_params = sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| self->iv_session = sp_ActionDispatch_Session_new(((void)(0), sp_box_nil())); | |
| self->iv_flash = sp_box_obj(sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())), 53); | |
| self->iv_status = 200LL; | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| self->iv_location = ((void)(0), sp_box_nil()); | |
| self->iv_request_format = SPS_html; | |
| self->iv_content_type = (&("\xff" "text/html; charset=utf-8")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionController_Base_initialize(sp_ActionController_Base *self) { | |
| self->iv_params = sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| self->iv_session = sp_ActionDispatch_Session_new(((void)(0), sp_box_nil())); | |
| self->iv_flash = sp_box_obj(sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())), 53); | |
| self->iv_status = 200LL; | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| self->iv_location = ((void)(0), sp_box_nil()); | |
| self->iv_request_format = SPS_html; | |
| self->iv_content_type = (&("\xff" "text/html; charset=utf-8")[1]); | |
| } | |
| static inline mrb_int sp_ActionController_Base_process_action(sp_ActionController_Base *self, sp_sym lv__action_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_raise_cls("NotImplementedError", (&("\xff" "process_action must be overridden by subclass")[1])); | |
| return SP_INT_NIL; | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ActionController_Base_render(sp_ActionController_Base *self, sp_String * lv_body, sp_sym lv_status, const char * lv_content_type, sp_RbVal lv_location) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT(lv_content_type); | |
| SP_GC_ROOT_RBVAL(lv_location); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT(lv_content_type); | |
| self->iv_body = ({ sp_String *_t59 = lv_body; _t59 ? sp_box_str(sp_str_dup_external((_t59)->data)) : sp_box_nil(); }); | |
| self->iv_status = sp_ActionController_Base_resolve_status(self, lv_status); | |
| if (!((lv_content_type == NULL))) { | |
| self->iv_content_type = lv_content_type; | |
| } | |
| if (!(sp_poly_nil_p(lv_location))) { | |
| self->iv_location = lv_location; | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_ActionController_Base_redirect_to(sp_ActionController_Base *self, const char * lv_path, const char * lv_notice, const char * lv_alert, sp_sym lv_status) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| self->iv_location = sp_box_str(lv_path); | |
| self->iv_status = sp_ActionController_Base_resolve_status(self, lv_status); | |
| if (!((lv_notice == NULL))) { | |
| sp_RbVal _t60 = sp_box_nullable_str(lv_notice); | |
| sp_RbVal _t61 = self->iv_flash; | |
| if (_t61.cls_id == SP_BUILTIN_SYM_INT_HASH) sp_SymIntHash_set((sp_SymIntHash *)_t61.v.p, (sp_sym)(SPS_notice), _t60.v.i); | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_POLY_HASH) sp_SymPolyHash_set((sp_SymPolyHash *)_t61.v.p, (sp_sym)(SPS_notice), _t60); | |
| } | |
| if (!((lv_alert == NULL))) { | |
| sp_RbVal _t62 = sp_box_nullable_str(lv_alert); | |
| sp_RbVal _t63 = self->iv_flash; | |
| if (_t63.cls_id == SP_BUILTIN_SYM_INT_HASH) sp_SymIntHash_set((sp_SymIntHash *)_t63.v.p, (sp_sym)(SPS_alert), _t62.v.i); | |
| else if (_t63.cls_id == SP_BUILTIN_SYM_POLY_HASH) sp_SymPolyHash_set((sp_SymPolyHash *)_t63.v.p, (sp_sym)(SPS_alert), _t62); | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_ActionController_Base_head(sp_ActionController_Base *self, sp_sym lv_status, const char * lv_content_type) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_content_type); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_content_type); | |
| self->iv_status = sp_ActionController_Base_resolve_status(self, lv_status); | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| if (!((lv_content_type == NULL))) { | |
| self->iv_content_type = lv_content_type; | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionController_Base_resolve_status(sp_ActionController_Base *self, sp_sym lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (sp_SymIntHash_has_key(cst_ActionController_STATUS_CODES, lv_s) ? sp_SymIntHash_get(cst_ActionController_STATUS_CODES, lv_s) : 200LL); | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(Broadcasts_SeedTransport) | |
| static inline sp_Broadcasts_SeedTransport *sp_Broadcasts_SeedTransport_new(void) { | |
| SP_GC_SAVE(); | |
| sp_Broadcasts_SeedTransport *self = SP_POOL_NEW(Broadcasts_SeedTransport, NULL); | |
| self->cls_id = 57LL; | |
| SP_GC_ROOT(self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline mrb_int sp_Broadcasts_SeedTransport_broadcast(sp_Broadcasts_SeedTransport *self, const char * lv_stream, const char * lv_fragment) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_fragment); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_fragment); | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_IntegrationTest) | |
| static inline sp_ActionDispatch_IntegrationTest *sp_ActionDispatch_IntegrationTest_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_IntegrationTest *self = SP_POOL_NEW(ActionDispatch_IntegrationTest, sp_ActionDispatch_IntegrationTest_gc_scan); | |
| self->cls_id = 58LL; | |
| SP_GC_ROOT(self); | |
| self->iv___session = NULL; | |
| self->iv___flash = sp_box_nil(); | |
| self->iv___response = NULL; | |
| sp_TestBase_initialize((sp_TestBase *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_get(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_StrIntHash * lv_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "GET")[1]), lv_path, lv_params); | |
| return NULL; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_post(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_SymPolyHash * lv_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "POST")[1]), lv_path, lv_params); | |
| return NULL; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_patch(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_SymPolyHash * lv_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "PATCH")[1]), lv_path, lv_params); | |
| return NULL; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_delete(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_StrIntHash * lv_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "DELETE")[1]), lv_path, lv_params); | |
| return NULL; | |
| } | |
| static sp_ActionResponse * sp_ActionDispatch_IntegrationTest_dispatch_request(sp_ActionDispatch_IntegrationTest *self, const char * lv_method, const char * lv_path, sp_SymPolyHash * lv_params) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_Router_MatchResult * lv_matched = NULL; | |
| volatile sp_RbVal lv_controller = sp_box_nil(); | |
| sp_StrPolyHash * lv_merged = NULL; | |
| volatile sp_sym lv_k = ((sp_sym)-1); | |
| volatile sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_matched); | |
| SP_GC_ROOT_RBVAL(lv_controller); | |
| SP_GC_ROOT(lv_merged); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_params); | |
| sp_ActionView_ViewHelpers_cls_reset_slots_bang(); | |
| lv_matched = sp_ActionDispatch_Router_cls_match((const char *)lv_method, (const char *)lv_path, sp_Routes_cls_table()); | |
| if ((lv_matched == NULL)) { | |
| sp_raise(sp_sprintf("No route matches %s %s", lv_method, lv_path)); | |
| } | |
| sp_RbVal _t64 = sp_box_nil(); | |
| sp_sym _t65 = lv_matched->iv_controller; | |
| if (_t65 == SPS_articles) { | |
| _t64 = sp_box_obj(sp_ArticlesController_new(), 69); | |
| } else if (_t65 == SPS_comments) { | |
| _t64 = sp_box_obj(sp_CommentsController_new(), 71); | |
| } | |
| lv_controller = _t64; | |
| lv_merged = sp_ActionDispatch_IntegrationTest_stringify_keys(self, lv_matched->iv_path_params); | |
| for (mrb_int _t66 = 0; _t66 < lv_params->len; _t66++) { | |
| lv_k = lv_params->order[_t66]; | |
| lv_v = sp_SymPolyHash_get(lv_params, lv_params->order[_t66]); | |
| sp_redo_6: ; | |
| sp_RbVal _t67 = lv_v; | |
| if ((_t67.tag == SP_TAG_OBJ && (_t67.cls_id == SP_BUILTIN_STR_INT_HASH || _t67.cls_id == SP_BUILTIN_STR_STR_HASH || _t67.cls_id == SP_BUILTIN_INT_STR_HASH || _t67.cls_id == SP_BUILTIN_SYM_INT_HASH || _t67.cls_id == SP_BUILTIN_SYM_STR_HASH || _t67.cls_id == SP_BUILTIN_STR_POLY_HASH || _t67.cls_id == SP_BUILTIN_SYM_POLY_HASH))) { | |
| if (sp_gc_is_frozen(lv_merged)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_merged, sp_sym_to_s(lv_k), sp_box_obj((void *)(sp_ActionDispatch_IntegrationTest_stringify_keys(self, ((sp_StrStrHash *)(lv_v).v.p))), SP_BUILTIN_STR_POLY_HASH)); | |
| } else { | |
| if (sp_gc_is_frozen(lv_merged)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_merged, sp_sym_to_s(lv_k), lv_v); | |
| } | |
| } | |
| sp_RbVal _t68 = lv_controller; | |
| sp_RbVal _t69 = sp_box_nil(); | |
| if (_t68.tag == SP_TAG_OBJ) { | |
| if (_t68.cls_id == 56) { ((sp_ActionController_Base *)_t68.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t69 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| if (_t68.cls_id == 62) { ((sp_ApplicationController *)_t68.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t69 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| if (_t68.cls_id == 69) { ((sp_ArticlesController *)_t68.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t69 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| if (_t68.cls_id == 71) { ((sp_CommentsController *)_t68.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t69 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| } | |
| _t69; | |
| sp_RbVal _t70 = lv_controller; | |
| if (!(self->iv___session)) { | |
| self->iv___session = sp_ActionDispatch_Session_new(((void)(0), sp_box_nil())); | |
| } | |
| sp_ActionDispatch_Session * _t71 = NULL; | |
| if (_t70.tag == SP_TAG_OBJ) { | |
| if (_t70.cls_id == 56) { ((sp_ActionController_Base *)_t70.v.p)->iv_session = self->iv___session; _t71 = self->iv___session; } | |
| if (_t70.cls_id == 62) { ((sp_ApplicationController *)_t70.v.p)->iv_session = self->iv___session; _t71 = self->iv___session; } | |
| if (_t70.cls_id == 69) { ((sp_ArticlesController *)_t70.v.p)->iv_session = self->iv___session; _t71 = self->iv___session; } | |
| if (_t70.cls_id == 71) { ((sp_CommentsController *)_t70.v.p)->iv_session = self->iv___session; _t71 = self->iv___session; } | |
| } | |
| _t71; | |
| sp_RbVal _t72 = lv_controller; | |
| if ((self->iv___flash).tag == SP_TAG_NIL || ((self->iv___flash).tag == SP_TAG_BOOL && (self->iv___flash).v.i == 0)) { | |
| self->iv___flash = sp_box_obj(sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())), 53); | |
| } | |
| sp_RbVal _t73 = sp_box_nil(); | |
| if (_t72.tag == SP_TAG_OBJ) { | |
| if (_t72.cls_id == 56) { ((sp_ActionController_Base *)_t72.v.p)->iv_flash = self->iv___flash; _t73 = self->iv___flash; } | |
| if (_t72.cls_id == 62) { ((sp_ApplicationController *)_t72.v.p)->iv_flash = self->iv___flash; _t73 = self->iv___flash; } | |
| if (_t72.cls_id == 69) { ((sp_ArticlesController *)_t72.v.p)->iv_flash = self->iv___flash; _t73 = self->iv___flash; } | |
| if (_t72.cls_id == 71) { ((sp_CommentsController *)_t72.v.p)->iv_flash = self->iv___flash; _t73 = self->iv___flash; } | |
| } | |
| _t73; | |
| sp_RbVal _t74 = lv_controller; | |
| const char * _t75 = (&("\xff")[1]); | |
| if (_t74.tag == SP_TAG_OBJ) { | |
| if (_t74.cls_id == 56) { ((sp_ActionController_Base *)_t74.v.p)->iv_request_method = lv_method; _t75 = lv_method; } | |
| if (_t74.cls_id == 62) { ((sp_ApplicationController *)_t74.v.p)->iv_request_method = lv_method; _t75 = lv_method; } | |
| if (_t74.cls_id == 69) { ((sp_ArticlesController *)_t74.v.p)->iv_request_method = lv_method; _t75 = lv_method; } | |
| if (_t74.cls_id == 71) { ((sp_CommentsController *)_t74.v.p)->iv_request_method = lv_method; _t75 = lv_method; } | |
| } | |
| _t75; | |
| sp_RbVal _t76 = lv_controller; | |
| const char * _t77 = (&("\xff")[1]); | |
| if (_t76.tag == SP_TAG_OBJ) { | |
| if (_t76.cls_id == 56) { ((sp_ActionController_Base *)_t76.v.p)->iv_request_path = lv_path; _t77 = lv_path; } | |
| if (_t76.cls_id == 62) { ((sp_ApplicationController *)_t76.v.p)->iv_request_path = lv_path; _t77 = lv_path; } | |
| if (_t76.cls_id == 69) { ((sp_ArticlesController *)_t76.v.p)->iv_request_path = lv_path; _t77 = lv_path; } | |
| if (_t76.cls_id == 71) { ((sp_CommentsController *)_t76.v.p)->iv_request_path = lv_path; _t77 = lv_path; } | |
| } | |
| _t77; | |
| sp_RbVal _t78 = lv_controller; | |
| mrb_int _t79 = SP_INT_NIL; | |
| if (_t78.tag == SP_TAG_OBJ) { | |
| if (_t78.cls_id == 56) _t79 = sp_ActionController_Base_process_action((sp_ActionController_Base *)_t78.v.p, lv_matched->iv_action); | |
| if (_t78.cls_id == 62) _t79 = sp_ActionController_Base_process_action((sp_ActionController_Base *)_t78.v.p, lv_matched->iv_action); | |
| if (_t78.cls_id == 69) _t79 = sp_ArticlesController_process_action((sp_ArticlesController *)_t78.v.p, lv_matched->iv_action); | |
| if (_t78.cls_id == 71) _t79 = sp_CommentsController_process_action((sp_CommentsController *)_t78.v.p, lv_matched->iv_action); | |
| } | |
| _t79; | |
| sp_RbVal _t80 = lv_controller; | |
| sp_RbVal _t81 = sp_box_nil(); | |
| if (_t80.tag == SP_TAG_OBJ) { | |
| if (_t80.cls_id == 56) _t81 = ((sp_ActionController_Base *)_t80.v.p)->iv_flash; | |
| if (_t80.cls_id == 62) _t81 = ((sp_ApplicationController *)_t80.v.p)->iv_flash; | |
| if (_t80.cls_id == 69) _t81 = ((sp_ArticlesController *)_t80.v.p)->iv_flash; | |
| if (_t80.cls_id == 71) _t81 = ((sp_CommentsController *)_t80.v.p)->iv_flash; | |
| if (_t80.cls_id == 72) _t81 = ((sp_ActionResponse *)_t80.v.p)->iv_flash; | |
| } | |
| self->iv___flash = _t81; | |
| sp_RbVal _t82 = lv_controller; | |
| mrb_int _t83 = 0; | |
| if (_t82.tag == SP_TAG_OBJ) { | |
| if (_t82.cls_id == 56) _t83 = ((sp_ActionController_Base *)_t82.v.p)->iv_status; | |
| if (_t82.cls_id == 62) _t83 = ((sp_ApplicationController *)_t82.v.p)->iv_status; | |
| if (_t82.cls_id == 69) _t83 = ((sp_ArticlesController *)_t82.v.p)->iv_status; | |
| if (_t82.cls_id == 71) _t83 = ((sp_CommentsController *)_t82.v.p)->iv_status; | |
| if (_t82.cls_id == 72) _t83 = ((sp_ActionResponse *)_t82.v.p)->iv_status; | |
| } | |
| sp_RbVal _t84 = lv_controller; | |
| sp_RbVal _t85 = sp_box_nil(); | |
| if (_t84.tag == SP_TAG_OBJ) { | |
| if (_t84.cls_id == 56) _t85 = ((sp_ActionController_Base *)_t84.v.p)->iv_body; | |
| if (_t84.cls_id == 62) _t85 = ((sp_ApplicationController *)_t84.v.p)->iv_body; | |
| if (_t84.cls_id == 64) _t85 = sp_box_str(sp_CommentRow_body((sp_CommentRow *)_t84.v.p)); | |
| if (_t84.cls_id == 65) _t85 = sp_Comment_body((sp_Comment *)_t84.v.p); | |
| if (_t84.cls_id == 66) _t85 = sp_box_str(sp_ArticleRow_body((sp_ArticleRow *)_t84.v.p)); | |
| if (_t84.cls_id == 68) _t85 = sp_ArticleParams_body((sp_ArticleParams *)_t84.v.p); | |
| if (_t84.cls_id == 69) _t85 = ((sp_ArticlesController *)_t84.v.p)->iv_body; | |
| if (_t84.cls_id == 70) _t85 = sp_CommentParams_body((sp_CommentParams *)_t84.v.p); | |
| if (_t84.cls_id == 71) _t85 = ((sp_CommentsController *)_t84.v.p)->iv_body; | |
| if (_t84.cls_id == 72) _t85 = ((sp_ActionResponse *)_t84.v.p)->iv_body; | |
| if (_t84.cls_id == 76) _t85 = sp_Article__implicit_6872_body((sp_Article__implicit_6872 *)_t84.v.p); | |
| if (_t84.cls_id == 77) _t85 = sp_Article__implicit_6906_body((sp_Article__implicit_6906 *)_t84.v.p); | |
| if (_t84.cls_id == 78) _t85 = sp_Article__implicit_7484_body((sp_Article__implicit_7484 *)_t84.v.p); | |
| if (_t84.cls_id == 79) _t85 = sp_Article__implicit_7995_body((sp_Article__implicit_7995 *)_t84.v.p); | |
| if (_t84.cls_id == 80) _t85 = sp_Article__implicit_9355_body((sp_Article__implicit_9355 *)_t84.v.p); | |
| if (_t84.cls_id == 81) _t85 = sp_Article__implicit_9372_body((sp_Article__implicit_9372 *)_t84.v.p); | |
| } | |
| sp_RbVal _t86 = lv_controller; | |
| sp_RbVal _t87 = sp_box_nil(); | |
| if (_t86.tag == SP_TAG_OBJ) { | |
| if (_t86.cls_id == 56) _t87 = ((sp_ActionController_Base *)_t86.v.p)->iv_location; | |
| if (_t86.cls_id == 62) _t87 = ((sp_ApplicationController *)_t86.v.p)->iv_location; | |
| if (_t86.cls_id == 69) _t87 = ((sp_ArticlesController *)_t86.v.p)->iv_location; | |
| if (_t86.cls_id == 71) _t87 = ((sp_CommentsController *)_t86.v.p)->iv_location; | |
| if (_t86.cls_id == 72) _t87 = ((sp_ActionResponse *)_t86.v.p)->iv_location; | |
| } | |
| sp_RbVal _t88 = lv_controller; | |
| sp_RbVal _t89 = sp_box_nil(); | |
| if (_t88.tag == SP_TAG_OBJ) { | |
| if (_t88.cls_id == 56) _t89 = ((sp_ActionController_Base *)_t88.v.p)->iv_flash; | |
| if (_t88.cls_id == 62) _t89 = ((sp_ApplicationController *)_t88.v.p)->iv_flash; | |
| if (_t88.cls_id == 69) _t89 = ((sp_ArticlesController *)_t88.v.p)->iv_flash; | |
| if (_t88.cls_id == 71) _t89 = ((sp_CommentsController *)_t88.v.p)->iv_flash; | |
| if (_t88.cls_id == 72) _t89 = ((sp_ActionResponse *)_t88.v.p)->iv_flash; | |
| } | |
| self->iv___response = sp_ActionResponse_new(_t83, _t85, _t87, _t89); | |
| return self->iv___response; | |
| return NULL; | |
| } | |
| static inline sp_StrPolyHash * sp_ActionDispatch_IntegrationTest_stringify_keys(sp_ActionDispatch_IntegrationTest *self, sp_StrStrHash * lv_hash) { | |
| SP_GC_SAVE(); | |
| sp_StrPolyHash * lv_out = NULL; | |
| mrb_int lv_k = 0; | |
| mrb_int lv_v = 0; | |
| SP_GC_ROOT(lv_out); | |
| SP_GC_ROOT(lv_hash); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_hash); | |
| lv_out = sp_StrPolyHash_new(); | |
| return (sp_StrPolyHash *)lv_out; | |
| return NULL; | |
| } | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_response(sp_ActionDispatch_IntegrationTest *self, sp_sym lv_expected, sp_ActionResponse * lv_response) { | |
| SP_GC_SAVE(); | |
| volatile mrb_int lv_actual = 0; | |
| volatile sp_RbVal lv_expected_match = sp_box_nil(); | |
| volatile mrb_bool lv_matches = FALSE; | |
| SP_GC_ROOT_RBVAL(lv_expected_match); | |
| SP_GC_ROOT(lv_response); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_response); | |
| lv_actual = lv_response->iv_status; | |
| lv_expected_match = sp_SymPolyHash_get((sp_SymPolyHash *)(cst_RequestDispatch_STATUS_SYMBOLS), lv_expected); | |
| mrb_bool _t90 = FALSE; | |
| sp_RbVal _t91 = lv_expected_match; | |
| if (sp_class_le(sp_class_for_poly(_t91), (sp_Class){15LL})) { | |
| sp_RbVal _t92 = lv_expected_match; | |
| mrb_bool _t93 = FALSE; | |
| if (_t92.tag == SP_TAG_OBJ) { | |
| if (_t92.cls_id == 53) _t93 = sp_ActionDispatch_Flash_include_p((sp_ActionDispatch_Flash *)_t92.v.p, lv_actual); | |
| if (_t92.cls_id == 54) _t93 = sp_ActionDispatch_Session_include_p((sp_ActionDispatch_Session *)_t92.v.p, lv_actual); | |
| if (_t92.cls_id == SP_BUILTIN_INT_ARRAY) _t93 = sp_IntArray_include((sp_IntArray *)_t92.v.p, lv_actual); | |
| if (_t92.cls_id == SP_BUILTIN_INT_STR_HASH) _t93 = sp_IntStrHash_has_key((sp_IntStrHash *)_t92.v.p, lv_actual); | |
| if (_t92.cls_id == SP_BUILTIN_RANGE) _t93 = sp_range_include((sp_Range *)_t92.v.p, lv_actual); | |
| } | |
| _t90 = _t93; | |
| } else if (sp_class_le(sp_class_for_poly(_t91), (sp_Class){9LL})) { | |
| _t90 = sp_poly_eq(lv_expected_match, sp_box_int(lv_actual)); | |
| } else { | |
| _t90 = FALSE; | |
| } | |
| lv_matches = _t90; | |
| if (!(lv_matches)) { | |
| sp_RbVal _t94 = lv_response->iv_body; | |
| sp_RbVal _t95 = sp_box_nil(); | |
| if (_t94.tag == SP_TAG_INT) _t95 = sp_box_int(((_t94.v.i >> (0LL)) & 1)); | |
| if (_t94.tag == SP_TAG_STR) _t95 = sp_box_str(sp_str_sub_range(_t94.v.s, 0LL, 200LL)); | |
| if (_t94.tag == SP_TAG_OBJ) { | |
| if (_t94.cls_id == 50) _t95 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 53) _t95 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 54) _t95 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 63) _t95 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 65) _t95 = sp_Comment__aref((sp_Comment *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 76) _t95 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 77) _t95 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 78) _t95 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 79) _t95 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 80) _t95 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == 81) _t95 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t94.v.p, sp_box_int(0LL)); | |
| if (_t94.cls_id == SP_BUILTIN_INT_ARRAY) _t95 = sp_box_int_array(sp_IntArray_slice((sp_IntArray *)_t94.v.p, 0LL, 200LL)); | |
| if (_t94.cls_id == SP_BUILTIN_FLT_ARRAY) _t95 = sp_box_float_array(sp_FloatArray_slice((sp_FloatArray *)_t94.v.p, 0LL, 200LL)); | |
| if (_t94.cls_id == SP_BUILTIN_STR_ARRAY) _t95 = sp_box_str_array(sp_StrArray_slice((sp_StrArray *)_t94.v.p, 0LL, 200LL)); | |
| if (_t94.cls_id == SP_BUILTIN_SYM_ARRAY) _t95 = sp_box_obj((void *)sp_IntArray_slice((sp_IntArray *)_t94.v.p, 0LL, 200LL), SP_BUILTIN_SYM_ARRAY); | |
| if (_t94.cls_id == SP_BUILTIN_PTR_ARRAY) _t95 = sp_box_obj((void *)sp_PtrArray_slice((sp_PtrArray *)_t94.v.p, 0LL, 200LL), SP_BUILTIN_PTR_ARRAY); | |
| } | |
| const char *_t96 = sp_str_concat(SPL(":"), sp_sym_to_s(lv_expected)); | |
| SP_GC_ROOT(_t96); | |
| const char *_t97 = sp_poly_inspect(_t95); | |
| SP_GC_ROOT(_t97); | |
| sp_raise(sp_sprintf("expected response %s, got status=%lld body=%s", _t96, (long long)lv_actual, _t97)); | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_ActionDispatch_IntegrationTest_assert_redirected_to(sp_ActionDispatch_IntegrationTest *self, const char * lv_expected_path, sp_ActionResponse * lv_response) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_expected_path); | |
| SP_GC_ROOT(lv_response); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_expected_path); | |
| SP_GC_ROOT(lv_response); | |
| if (!(sp_ActionResponse_redirect_p(lv_response))) { | |
| sp_raise(sp_sprintf("expected a redirect, got status=%lld location=%s", (long long)lv_response->iv_status, sp_poly_inspect(lv_response->iv_location))); | |
| } | |
| if (!(sp_poly_eq(sp_box_str(lv_expected_path), lv_response->iv_location))) { | |
| const char *_t98 = sp_str_inspect(lv_expected_path); | |
| SP_GC_ROOT(_t98); | |
| const char *_t99 = sp_poly_inspect(lv_response->iv_location); | |
| SP_GC_ROOT(_t99); | |
| sp_raise(sp_sprintf("expected redirect to %s, got %s", _t98, _t99)); | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_select(sp_ActionDispatch_IntegrationTest *self, const char * lv_selector, sp_RbVal lv_content_or_opts, sp_RbVal lv_opts, sp_Proc * lv_block, void (*_block)(mrb_int, void*), void *_benv) { | |
| SP_GC_SAVE(); | |
| const char * lv_body = (&("\xff")[1]); | |
| volatile sp_RbVal lv_content = sp_box_nil(); | |
| const char * lv_tag = (&("\xff")[1]); | |
| volatile mrb_regexp_pattern * lv_pattern = NULL; | |
| const char * lv_id = (&("\xff")[1]); | |
| const char * lv__tag = (&("\xff")[1]); | |
| const char * lv_cls = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT_RBVAL(lv_content); | |
| SP_GC_ROOT(lv_tag); | |
| SP_GC_ROOT(lv_id); | |
| SP_GC_ROOT(lv__tag); | |
| SP_GC_ROOT(lv_cls); | |
| SP_GC_ROOT(lv_selector); | |
| SP_GC_ROOT_RBVAL(lv_content_or_opts); | |
| SP_GC_ROOT_RBVAL(lv_opts); | |
| SP_GC_ROOT(lv_block); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_selector); | |
| SP_GC_ROOT(lv_block); | |
| lv_body = sp_poly_to_s(self->iv___response->iv_body); | |
| sp_RbVal _t100 = lv_content_or_opts; | |
| if ((_t100.tag == SP_TAG_OBJ && (_t100.cls_id == SP_BUILTIN_STR_INT_HASH || _t100.cls_id == SP_BUILTIN_STR_STR_HASH || _t100.cls_id == SP_BUILTIN_INT_STR_HASH || _t100.cls_id == SP_BUILTIN_SYM_INT_HASH || _t100.cls_id == SP_BUILTIN_SYM_STR_HASH || _t100.cls_id == SP_BUILTIN_STR_POLY_HASH || _t100.cls_id == SP_BUILTIN_SYM_POLY_HASH))) { | |
| lv_opts = lv_content_or_opts; | |
| lv_content = ((void)(0), sp_box_nil()); | |
| } else { | |
| lv_content = lv_content_or_opts; | |
| } | |
| sp_RbVal _t101 = lv_content; | |
| if ((_t101.tag == SP_TAG_STR)) { | |
| lv_tag = sp_str_char_at_or_nil(lv_selector, 0); | |
| lv_pattern = ((lv_tag != NULL) ? sp_re_dyn_0(sp_sprintf("<%s[^>]*>\\s*%s\\s*<", lv_tag, sp_re_escape((lv_content).v.s))) : sp_re_dyn_1(sp_re_escape((lv_content).v.s))); | |
| if (!(sp_re_match_p(lv_pattern, lv_body))) { | |
| const char *_t102 = sp_str_inspect(lv_selector); | |
| SP_GC_ROOT(_t102); | |
| const char *_t103 = sp_str_inspect((lv_content).v.s); | |
| SP_GC_ROOT(_t103); | |
| sp_raise(sp_sprintf("expected %s containing %s in response body", _t102, _t103)); | |
| } | |
| } else { | |
| if (sp_str_start_with(lv_selector, (&("\xff" "#")[1]))) { | |
| sp_StrArray * _t104 = sp_str_split_ws(lv_selector); | |
| SP_GC_ROOT(_t104); | |
| const char * _t105 = sp_StrArray_get(_t104, 0); | |
| SP_GC_ROOT(_t105); | |
| const char * _t106 = _t105; | |
| SP_GC_ROOT(_t106); | |
| lv_id = sp_str_sub_range_r(_t106, 1LL, -1, 0); | |
| if (!(sp_str_include(lv_body, sp_sprintf("id=\"%s\"", lv_id)))) { | |
| sp_raise(sp_sprintf("expected element with id %s in response body", sp_str_inspect(lv_id))); | |
| } | |
| } else { | |
| if (sp_str_include(lv_selector, (&("\xff" ".")[1]))) { | |
| sp_StrArray *_t107 = sp_str_split_limit(lv_selector, (&("\xff" ".")[1]), 2LL); | |
| SP_GC_ROOT(_t107); | |
| lv__tag = sp_StrArray_get(_t107, 0); | |
| lv_cls = sp_StrArray_get(_t107, 1); | |
| if (!((sp_str_include(lv_body, sp_sprintf("class=\"%s", lv_cls)) || sp_re_match_p(sp_re_dyn_2(sp_sprintf("class=\"[^\"]*\\b%s\\b", sp_re_escape(lv_cls))), lv_body)))) { | |
| sp_raise(sp_sprintf("expected element with class %s in response body", sp_str_inspect(lv_cls))); | |
| } | |
| } else { | |
| lv_tag = sp_str_char_at_or_nil(lv_selector, 0); | |
| const char * _t108 = lv_tag; | |
| sp_RbVal _t109 = sp_box_nil(); | |
| if ((_t108 != NULL)) { | |
| _t109 = sp_box_bool(sp_str_include(lv_body, sp_sprintf("<%s", lv_tag))); | |
| } else { | |
| _t109 = ((void)(0), sp_box_nil()); | |
| } | |
| if (!(sp_poly_truthy(_t109))) { | |
| sp_raise(sp_sprintf("expected %s in response body", sp_str_inspect(lv_selector))); | |
| } | |
| } | |
| } | |
| } | |
| if ((lv_block != NULL)) { | |
| if (_block) _block(0, _benv); | |
| else if (lv_block) sp_proc_call(lv_block, (mrb_int[]){0}); | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| SP_POOL_DEFINE(Stmt) | |
| static inline sp_Stmt *sp_Stmt_new(const char * lv_sql, void * lv_ptr) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| sp_Stmt *self = SP_POOL_NEW(Stmt, sp_Stmt_gc_scan); | |
| self->cls_id = 59LL; | |
| SP_GC_ROOT(self); | |
| self->iv_sql = NULL; | |
| SP_GC_ROOT(lv_sql); | |
| self->iv_sql = lv_sql; | |
| self->iv_ptr = lv_ptr; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Stmt_initialize(sp_Stmt *self, const char * lv_sql, void * lv_ptr) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| self->iv_sql = lv_sql; | |
| self->iv_ptr = lv_ptr; | |
| } | |
| static inline const char * sp_Stmt_sql(sp_Stmt *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_sql; | |
| return (&("\xff")[1]); | |
| } | |
| static inline void * sp_Stmt_ptr(sp_Stmt *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_ptr; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(DbConn) | |
| static inline sp_DbConn *sp_DbConn_new(void * lv_dbh) { | |
| SP_GC_SAVE(); | |
| sp_DbConn *self = SP_POOL_NEW(DbConn, sp_DbConn_gc_scan); | |
| self->cls_id = 60LL; | |
| SP_GC_ROOT(self); | |
| self->iv_entries = NULL; | |
| self->iv_dbh = lv_dbh; | |
| self->iv_entries = sp_PtrArray_new(); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_DbConn_initialize(sp_DbConn *self, void * lv_dbh) { | |
| self->iv_dbh = lv_dbh; | |
| self->iv_entries = sp_PtrArray_new(); | |
| } | |
| static inline void * sp_DbConn_dbh(sp_DbConn *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_dbh; | |
| return NULL; | |
| } | |
| static void * sp_DbConn_prepare_cached(sp_DbConn *self, const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| volatile mrb_int lv_i = 0; | |
| sp_Stmt * lv_e = NULL; | |
| volatile mrb_int lv_rc = 0; | |
| volatile void * lv_st = NULL; | |
| SP_GC_ROOT(lv_e); | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_sql); | |
| lv_i = 0LL; | |
| while ((lv_i < sp_PtrArray_length(self->iv_entries))) { | |
| sp_redo_7: ; | |
| lv_e = ((sp_Stmt *)sp_PtrArray_get(self->iv_entries, lv_i)); | |
| if (sp_str_eq(lv_e->iv_sql, lv_sql)) { | |
| void * _t110 = lv_e->iv_ptr; | |
| SP_GC_RESTORE(); | |
| return _t110; | |
| } | |
| lv_i += 1LL; | |
| } | |
| lv_rc = sqlite3_prepare_v2(((void *)(uintptr_t)self->iv_dbh), lv_sql, ((int)(-1LL)), ((void *)(uintptr_t)((void *)sp_ffi_buf_SQL_stmt_out)), ((void *)(uintptr_t)0)); | |
| if ((lv_rc != cst_SQL_OK)) { | |
| const char * _t111 = (&("\xff" "Db.prepare failed (")[1]); | |
| SP_GC_ROOT(_t111); | |
| const char * _t112 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t112); | |
| const char * _t113 = (&("\xff" "): ")[1]); | |
| SP_GC_ROOT(_t113); | |
| const char * _t114 = sp_str_dup_external(sqlite3_errmsg(((void *)(uintptr_t)self->iv_dbh))); | |
| SP_GC_ROOT(_t114); | |
| const char * _t115 = (&("\xff" " \xE2\x80\x94 sql: ")[1]); | |
| SP_GC_ROOT(_t115); | |
| const char * _t116 = lv_sql; | |
| SP_GC_ROOT(_t116); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t111, _t112, _t113, _t114, _t115, _t116}, 6)); | |
| } | |
| lv_st = ((void *)(*((void * *)((char *)((void *)sp_ffi_buf_SQL_stmt_out) + 0)))); | |
| if ((sp_PtrArray_length(self->iv_entries) < 128)) { | |
| sp_PtrArray_push(self->iv_entries, sp_Stmt_new(lv_sql, lv_st)); | |
| } | |
| return lv_st; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_DbConn_finalize_all(sp_DbConn *self) { | |
| mrb_int lv_i = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| lv_i = 0LL; | |
| while ((lv_i < sp_PtrArray_length(self->iv_entries))) { | |
| sp_redo_8: ; | |
| sp_Stmt * _t117 = ((sp_Stmt *)sp_PtrArray_get(self->iv_entries, lv_i)); | |
| SP_GC_ROOT(_t117); | |
| sqlite3_finalize(((void *)(uintptr_t)_t117->iv_ptr)); | |
| lv_i += 1LL; | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(DbPool) | |
| static inline sp_DbPool *sp_DbPool_new(const char * lv_path, mrb_int lv_n) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| sp_DbPool *self = SP_POOL_NEW(DbPool, sp_DbPool_gc_scan); | |
| self->cls_id = 61LL; | |
| SP_GC_ROOT(self); | |
| self->iv_conns = NULL; | |
| self->iv_free = NULL; | |
| volatile mrb_int lv_i = 0; | |
| volatile mrb_int lv_rc = 0; | |
| SP_GC_ROOT(lv_path); | |
| self->iv_conns = sp_PtrArray_new(); | |
| self->iv_free = sp_IntArray_new(); | |
| lv_i = 0LL; | |
| while ((lv_i < lv_n)) { | |
| sp_redo_9: ; | |
| lv_rc = sqlite3_open(lv_path, ((void *)(uintptr_t)((void *)sp_ffi_buf_SQL_db_out))); | |
| if ((lv_rc != cst_SQL_OK)) { | |
| const char * _t118 = (&("\xff" "Db.configure: sqlite3_open(")[1]); | |
| SP_GC_ROOT(_t118); | |
| const char * _t119 = lv_path; | |
| SP_GC_ROOT(_t119); | |
| const char * _t120 = (&("\xff" ") failed (")[1]); | |
| SP_GC_ROOT(_t120); | |
| const char * _t121 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t121); | |
| const char * _t122 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t122); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t118, _t119, _t120, _t121, _t122}, 5)); | |
| } | |
| sp_PtrArray_push(self->iv_conns, sp_DbConn_new(((void *)(*((void * *)((char *)((void *)sp_ffi_buf_SQL_db_out) + 0)))))); | |
| sp_IntArray_push(self->iv_free, lv_i); | |
| lv_i += 1LL; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_DbPool_initialize(sp_DbPool *self, const char * lv_path, mrb_int lv_n) { | |
| SP_GC_SAVE(); | |
| volatile mrb_int lv_i = 0; | |
| volatile mrb_int lv_rc = 0; | |
| SP_GC_ROOT(lv_path); | |
| self->iv_conns = sp_PtrArray_new(); | |
| self->iv_free = sp_IntArray_new(); | |
| lv_i = 0LL; | |
| while ((lv_i < lv_n)) { | |
| sp_redo_10: ; | |
| lv_rc = sqlite3_open(lv_path, ((void *)(uintptr_t)((void *)sp_ffi_buf_SQL_db_out))); | |
| if ((lv_rc != cst_SQL_OK)) { | |
| const char * _t123 = (&("\xff" "Db.configure: sqlite3_open(")[1]); | |
| SP_GC_ROOT(_t123); | |
| const char * _t124 = lv_path; | |
| SP_GC_ROOT(_t124); | |
| const char * _t125 = (&("\xff" ") failed (")[1]); | |
| SP_GC_ROOT(_t125); | |
| const char * _t126 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t126); | |
| const char * _t127 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t127); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t123, _t124, _t125, _t126, _t127}, 5)); | |
| } | |
| sp_PtrArray_push(self->iv_conns, sp_DbConn_new(((void *)(*((void * *)((char *)((void *)sp_ffi_buf_SQL_db_out) + 0)))))); | |
| sp_IntArray_push(self->iv_free, lv_i); | |
| lv_i += 1LL; | |
| } | |
| } | |
| static inline mrb_int sp_DbPool_available(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_IntArray_length(self->iv_free); | |
| return 0; | |
| } | |
| static inline mrb_int sp_DbPool_lease(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_IntArray_delete_at(self->iv_free, sp_int_sub(sp_IntArray_length(self->iv_free), 1LL)); | |
| return 0; | |
| } | |
| static inline sp_IntArray * sp_DbPool_release(sp_DbPool *self, mrb_int lv_idx) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_IntArray_push(self->iv_free, lv_idx); | |
| return NULL; | |
| return NULL; | |
| } | |
| static inline sp_DbConn * sp_DbPool_conn(sp_DbPool *self, mrb_int lv_idx) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return ((sp_DbConn *)sp_PtrArray_get(self->iv_conns, lv_idx)); | |
| return NULL; | |
| } | |
| static inline sp_DbConn * sp_DbPool_first(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return ((sp_DbConn *)sp_PtrArray_get(self->iv_conns, 0LL)); | |
| return NULL; | |
| } | |
| static inline mrb_int sp_DbPool_close_all(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_i = 0; | |
| sp_DbConn * lv_c = NULL; | |
| SP_GC_ROOT(lv_c); | |
| SP_GC_ROOT(self); | |
| lv_i = 0LL; | |
| while ((lv_i < sp_PtrArray_length(self->iv_conns))) { | |
| sp_redo_11: ; | |
| lv_c = ((sp_DbConn *)sp_PtrArray_get(self->iv_conns, lv_i)); | |
| sp_DbConn_finalize_all(lv_c); | |
| sqlite3_close(((void *)(uintptr_t)lv_c->iv_dbh)); | |
| lv_i += 1LL; | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ApplicationController) | |
| static inline sp_ApplicationController *sp_ApplicationController_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ApplicationController *self = SP_POOL_NEW(ApplicationController, sp_ApplicationController_gc_scan); | |
| self->cls_id = 62LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = sp_box_nil(); | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| sp_ActionController_Base_initialize((sp_ActionController_Base *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| SP_POOL_DEFINE(ApplicationRecord) | |
| static inline sp_ApplicationRecord *sp_ApplicationRecord_new(sp_StrIntHash * lv__attrs) { | |
| SP_GC_SAVE(); | |
| sp_ApplicationRecord *self = SP_POOL_NEW(ApplicationRecord, sp_ApplicationRecord_gc_scan); | |
| self->cls_id = 63LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, lv__attrs); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static mrb_int sp_ApplicationRecord_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_raise_cls("NotImplementedError", sp_sprintf("%s.schema_columns must be overridden", sp_class_to_s(((sp_Class){63LL})))); | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(CommentRow) | |
| static inline sp_CommentRow *sp_CommentRow_new(void) { | |
| SP_GC_SAVE(); | |
| sp_CommentRow *self = SP_POOL_NEW(CommentRow, sp_CommentRow_gc_scan); | |
| self->cls_id = 64LL; | |
| SP_GC_ROOT(self); | |
| self->iv_body = NULL; | |
| self->iv_commenter = NULL; | |
| self->iv_created_at = NULL; | |
| self->iv_updated_at = NULL; | |
| self->iv_id = 0LL; | |
| self->iv_article_id = 0LL; | |
| self->iv_body = (&("\xff" "")[1]); | |
| self->iv_commenter = (&("\xff" "")[1]); | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_CommentRow_initialize(sp_CommentRow *self) { | |
| self->iv_id = 0LL; | |
| self->iv_article_id = 0LL; | |
| self->iv_body = (&("\xff" "")[1]); | |
| self->iv_commenter = (&("\xff" "")[1]); | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_id(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_CommentRow_id_eq(sp_CommentRow *self, mrb_int lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_CommentRow_article_id(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_article_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_CommentRow_article_id_eq(sp_CommentRow *self, mrb_int lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_body(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_body; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_body_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_commenter(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_commenter; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_commenter_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_commenter = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_created_at(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_created_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_created_at_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_updated_at(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_updated_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_updated_at_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static sp_CommentRow * sp_CommentRow_cls_from_raw(mrb_int lv_row) { | |
| SP_GC_SAVE(); | |
| sp_CommentRow * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| lv_instance = sp_CommentRow_new(); | |
| mrb_int _t128 = 0; | |
| sp_CommentRow_id_eq(lv_instance, (((_t128), TRUE) ? _t128 : 0LL)); | |
| mrb_int _t129 = 0; | |
| sp_CommentRow_article_id_eq(lv_instance, (((_t129), TRUE) ? _t129 : 0LL)); | |
| sp_CommentRow_body_eq(lv_instance, sp_int_to_s(0)); | |
| sp_CommentRow_commenter_eq(lv_instance, sp_int_to_s(0)); | |
| sp_CommentRow_created_at_eq(lv_instance, sp_int_to_s(0)); | |
| sp_CommentRow_updated_at_eq(lv_instance, sp_int_to_s(0)); | |
| return (sp_CommentRow *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Comment) | |
| static inline sp_Comment *sp_Comment_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Comment *self = SP_POOL_NEW(Comment, sp_Comment_gc_scan); | |
| self->cls_id = 65LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_article_id = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_commenter = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| sp_Comment_article_id_eq(self, sp_box_int((sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_article_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_article_id)) : 0LL))); | |
| sp_Comment_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Comment_commenter_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_commenter)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_commenter))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Comment_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Comment_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Comment_initialize(sp_Comment *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| sp_Comment_article_id_eq(self, sp_box_int((sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_article_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_article_id)) : 0LL))); | |
| sp_Comment_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Comment_commenter_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_commenter)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_commenter))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Comment_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Comment_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| } | |
| static inline mrb_int sp_Comment_id(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Comment_id_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_article_id(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t130 = self->iv_article_id; | |
| SP_GC_RESTORE(); | |
| return _t130; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_article_id_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_article_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_body(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t131 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t131; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_body_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_commenter(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t132 = self->iv_commenter; | |
| SP_GC_RESTORE(); | |
| return _t132; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_commenter_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_commenter = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_created_at(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t133 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t133; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_created_at_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_updated_at(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t134 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t134; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_updated_at_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Comment_assign_from_row(sp_Comment *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Comment_attributes(sp_Comment *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Comment__aref(sp_Comment *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t135 = lv_name; | |
| if ((_t135.tag == SP_TAG_SYM && _t135.v.i == SPS_id)) { | |
| sp_RbVal _t136 = sp_box_int(self->iv_id); | |
| SP_GC_RESTORE(); | |
| return _t136; | |
| } else if ((_t135.tag == SP_TAG_SYM && _t135.v.i == SPS_article_id)) { | |
| sp_RbVal _t137 = self->iv_article_id; | |
| SP_GC_RESTORE(); | |
| return _t137; | |
| } else if ((_t135.tag == SP_TAG_SYM && _t135.v.i == SPS_body)) { | |
| sp_RbVal _t138 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t138; | |
| } else if ((_t135.tag == SP_TAG_SYM && _t135.v.i == SPS_commenter)) { | |
| sp_RbVal _t139 = self->iv_commenter; | |
| SP_GC_RESTORE(); | |
| return _t139; | |
| } else if ((_t135.tag == SP_TAG_SYM && _t135.v.i == SPS_created_at)) { | |
| sp_RbVal _t140 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t140; | |
| } else if ((_t135.tag == SP_TAG_SYM && _t135.v.i == SPS_updated_at)) { | |
| sp_RbVal _t141 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t141; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment__aset(sp_Comment *self, sp_sym lv_name, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| mrb_int _t142 = lv_name; | |
| if (_t142 == SPS_id) { | |
| self->iv_id = sp_str_to_i_cruby(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t142 == SPS_article_id) { | |
| self->iv_article_id = sp_box_int(sp_str_to_i_cruby(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t142 == SPS_body) { | |
| self->iv_body = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t142 == SPS_commenter) { | |
| self->iv_commenter = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t142 == SPS_created_at) { | |
| self->iv_created_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t142 == SPS_updated_at) { | |
| self->iv_updated_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Comment_update(sp_Comment *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t143 = ((sp_CommentRow *)lv_p)->iv_commenter; | |
| SP_GC_ROOT(_t143); | |
| if ((_t143 == NULL)) { | |
| } else { | |
| sp_Comment_commenter_eq(self, sp_box_str(((sp_CommentRow *)lv_p)->iv_commenter)); | |
| } | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| } else { | |
| sp_Comment_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); | |
| } | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Comment__adapter_insert(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t144 = (&("\xff" "INSERT INTO comments (article_id, body, commenter, created_at, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t144); | |
| const char * _t145 = sp_Db_cls_escape_int(self->iv_article_id); | |
| SP_GC_ROOT(_t145); | |
| const char * _t146 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t146); | |
| const char * _t147 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t147); | |
| const char * _t148 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t148); | |
| const char * _t149 = sp_Db_cls_escape_string(self->iv_commenter); | |
| SP_GC_ROOT(_t149); | |
| const char * _t150 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t150); | |
| const char * _t151 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t151); | |
| const char * _t152 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t152); | |
| const char * _t153 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t153); | |
| const char * _t154 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t154); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t144, _t145, _t146, _t147, _t148, _t149, _t150, _t151, _t152, _t153, _t154}, 11)); | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Comment__adapter_update(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t155 = (&("\xff" "UPDATE comments SET ")[1]); | |
| SP_GC_ROOT(_t155); | |
| const char * _t156 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t156); | |
| const char * _t157 = sp_Db_cls_escape_int(self->iv_article_id); | |
| SP_GC_ROOT(_t157); | |
| const char * _t158 = (&("\xff" ", body = ")[1]); | |
| SP_GC_ROOT(_t158); | |
| const char * _t159 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t159); | |
| const char * _t160 = (&("\xff" ", commenter = ")[1]); | |
| SP_GC_ROOT(_t160); | |
| const char * _t161 = sp_Db_cls_escape_string(self->iv_commenter); | |
| SP_GC_ROOT(_t161); | |
| const char * _t162 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t162); | |
| const char * _t163 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t163); | |
| const char * _t164 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t164); | |
| const char * _t165 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t165); | |
| const char * _t166 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t166); | |
| const char * _t167 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t167); | |
| const char * _t168 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t168); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t155, _t156, _t157, _t158, _t159, _t160, _t161, _t162, _t163, _t164, _t165, _t166, _t167, _t168}, 14)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Comment__adapter_delete(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t169 = (&("\xff" "DELETE FROM comments")[1]); | |
| SP_GC_ROOT(_t169); | |
| const char * _t170 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t170); | |
| const char * _t171 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t171); | |
| const char * _t172 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t172); | |
| return sp_Db_cls_exec(sp_str_concat4(_t169, _t170, _t171, _t172)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Comment__adapter_reload(sp_Comment *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t173 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments WHERE id = ")[1]); | |
| SP_GC_ROOT(_t173); | |
| const char * _t174 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t174); | |
| const char * _t175 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t175); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t173, _t174, _t175)); | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| self->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| self->iv_article_id = sp_box_int(sp_Db_cls_column_int(lv_stmt, 1LL)); | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL)); | |
| self->iv_commenter = sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL)); | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL)); | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 5LL)); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t176 = sp_box_obj(self, 65); | |
| SP_GC_RESTORE(); | |
| return _t176; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Comment_validate(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t177 = self->iv_commenter; | |
| mrb_bool _t178 = FALSE; | |
| if (_t177.tag == SP_TAG_STR) _t178 = (sp_str_length(_t177.v.s) == 0); | |
| if (_t177.tag == SP_TAG_OBJ) { | |
| if (_t177.cls_id == 53) _t178 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t177.v.p); | |
| if (_t177.cls_id == 54) _t178 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t177.v.p); | |
| if (_t177.cls_id == SP_BUILTIN_INT_ARRAY) _t178 = (sp_IntArray_length((sp_IntArray *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_FLT_ARRAY) _t178 = (sp_FloatArray_length((sp_FloatArray *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_STR_ARRAY) _t178 = (sp_StrArray_length((sp_StrArray *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_SYM_ARRAY) _t178 = (sp_IntArray_length((sp_IntArray *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_PTR_ARRAY) _t178 = (sp_PtrArray_length((sp_PtrArray *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_POLY_ARRAY) _t178 = (sp_PolyArray_length((sp_PolyArray *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_STR_INT_HASH) _t178 = (sp_StrIntHash_length((sp_StrIntHash *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_STR_STR_HASH) _t178 = (sp_StrStrHash_length((sp_StrStrHash *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_INT_STR_HASH) _t178 = (sp_IntStrHash_length((sp_IntStrHash *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_STR_POLY_HASH) _t178 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t178 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t177.v.p) == 0); | |
| if (_t177.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t178 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t177.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_commenter) || _t178)) { | |
| sp_StrArray * _t179 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t179); | |
| sp_StrArray_push(_t179, (&("\xff" "commenter can't be blank")[1])); | |
| } | |
| sp_RbVal _t180 = self->iv_body; | |
| mrb_bool _t181 = FALSE; | |
| if (_t180.tag == SP_TAG_STR) _t181 = (sp_str_length(_t180.v.s) == 0); | |
| if (_t180.tag == SP_TAG_OBJ) { | |
| if (_t180.cls_id == 53) _t181 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t180.v.p); | |
| if (_t180.cls_id == 54) _t181 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t180.v.p); | |
| if (_t180.cls_id == SP_BUILTIN_INT_ARRAY) _t181 = (sp_IntArray_length((sp_IntArray *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_FLT_ARRAY) _t181 = (sp_FloatArray_length((sp_FloatArray *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_STR_ARRAY) _t181 = (sp_StrArray_length((sp_StrArray *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_SYM_ARRAY) _t181 = (sp_IntArray_length((sp_IntArray *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_PTR_ARRAY) _t181 = (sp_PtrArray_length((sp_PtrArray *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_POLY_ARRAY) _t181 = (sp_PolyArray_length((sp_PolyArray *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_STR_INT_HASH) _t181 = (sp_StrIntHash_length((sp_StrIntHash *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_STR_STR_HASH) _t181 = (sp_StrStrHash_length((sp_StrStrHash *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_INT_STR_HASH) _t181 = (sp_IntStrHash_length((sp_IntStrHash *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_STR_POLY_HASH) _t181 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t181 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t180.v.p) == 0); | |
| if (_t180.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t181 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t180.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t181)) { | |
| sp_StrArray * _t182 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t182); | |
| sp_StrArray_push(_t182, (&("\xff" "body can't be blank")[1])); | |
| } | |
| if (((sp_poly_nil_p(self->iv_article_id) || sp_poly_eq(self->iv_article_id, sp_box_int(0LL))) || (!sp_Article_cls_exists_p(self->iv_article_id)))) { | |
| sp_StrArray * _t183 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t183); | |
| sp_StrArray_push(_t183, (&("\xff" "article must exist")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static inline sp_Article__implicit_6906 * sp_Comment_article(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_Article__implicit_6906 * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| if (sp_poly_eq(self->iv_article_id, sp_box_int(0LL))) { | |
| return 0; | |
| } else { | |
| const char * _t184 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles")[1]); | |
| SP_GC_ROOT(_t184); | |
| const char * _t185 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t185); | |
| const char * _t186 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t186); | |
| const char * _t187 = sp_Db_cls_escape_int(self->iv_article_id); | |
| SP_GC_ROOT(_t187); | |
| const char * _t188 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t188); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t184, _t185, _t186, _t187, _t188}, 5)); | |
| lv_result = NULL; | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| lv_result = sp_Article_cls_from_stmt(lv_stmt); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| return (sp_Article__implicit_6906 *)lv_result; | |
| } | |
| return NULL; | |
| } | |
| static inline const char * sp_Comment_dom_prefix(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (&("\xff" "comment")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static mrb_int sp_Comment_after_create_commit(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_6906 * lv_parent = NULL; | |
| SP_GC_ROOT(lv_parent); | |
| SP_GC_ROOT(self); | |
| const char * _t189 = sp_sprintf("article_%s_comments", sp_poly_to_s(self->iv_article_id)); | |
| SP_GC_ROOT(_t189); | |
| sp_String * _t190 = sp_Views_Comments_cls_comment(self, 0, 0); | |
| SP_GC_ROOT(_t190); | |
| sp_Broadcasts_cls_append(_t189, (&("\xff" "comments")[1]), _t190); | |
| lv_parent = sp_Comment_article(self); | |
| if ((lv_parent == NULL)) { | |
| SP_GC_RESTORE(); | |
| return 0; | |
| } | |
| const char * _t191 = sp_sprintf("article_%lld", (long long)lv_parent->iv_id); | |
| SP_GC_ROOT(_t191); | |
| sp_String * _t192 = sp_Views_Articles_cls_article(sp_box_nullable_obj(lv_parent, 77), 0, 0); | |
| SP_GC_ROOT(_t192); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t191, _t192); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Comment_after_update_commit(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t193 = sp_sprintf("article_%s_comments", sp_poly_to_s(self->iv_article_id)); | |
| SP_GC_ROOT(_t193); | |
| const char * _t194 = sp_sprintf("comment_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t194); | |
| sp_String * _t195 = sp_Views_Comments_cls_comment(self, 0, 0); | |
| SP_GC_ROOT(_t195); | |
| return sp_Broadcasts_cls_replace(_t193, _t194, _t195); | |
| return 0; | |
| } | |
| static mrb_int sp_Comment_after_destroy_commit(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_6906 * lv_parent = NULL; | |
| SP_GC_ROOT(lv_parent); | |
| SP_GC_ROOT(self); | |
| const char * _t196 = sp_sprintf("article_%s_comments", sp_poly_to_s(self->iv_article_id)); | |
| SP_GC_ROOT(_t196); | |
| const char * _t197 = sp_sprintf("comment_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t197); | |
| sp_Broadcasts_cls_remove(_t196, _t197); | |
| lv_parent = sp_Comment_article(self); | |
| if ((lv_parent == NULL)) { | |
| SP_GC_RESTORE(); | |
| return 0; | |
| } | |
| const char * _t198 = sp_sprintf("article_%lld", (long long)lv_parent->iv_id); | |
| SP_GC_ROOT(_t198); | |
| sp_String * _t199 = sp_Views_Articles_cls_article(sp_box_nullable_obj(lv_parent, 77), 0, 0); | |
| SP_GC_ROOT(_t199); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t198, _t199); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Comment_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t200 = sp_IntArray_new(); | |
| sp_IntArray_push(_t200, SPS_id); | |
| sp_IntArray_push(_t200, SPS_article_id); | |
| sp_IntArray_push(_t200, SPS_body); | |
| sp_IntArray_push(_t200, SPS_commenter); | |
| sp_IntArray_push(_t200, SPS_created_at); | |
| sp_IntArray_push(_t200, SPS_updated_at); | |
| return _t200; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls_from_row(sp_CommentRow * lv_row) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_row); | |
| SP_GC_ROOT(lv_row); | |
| sp_StrIntHash * _t201 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t201); | |
| lv_instance = sp_Comment_new(_t201); | |
| lv_instance->iv_id = lv_row->iv_id; | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(lv_row->iv_article_id)); | |
| sp_Comment_body_eq(lv_instance, sp_box_str(lv_row->iv_body)); | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str(lv_row->iv_commenter)); | |
| sp_Comment_created_at_eq(lv_instance, sp_box_str(lv_row->iv_created_at)); | |
| sp_Comment_updated_at_eq(lv_instance, sp_box_str(lv_row->iv_updated_at)); | |
| return (sp_Comment *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls_from_stmt(void * lv_stmt) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| sp_StrIntHash * _t202 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t202); | |
| lv_instance = sp_Comment_new(_t202); | |
| lv_instance->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(sp_Db_cls_column_int(lv_stmt, 1LL))); | |
| sp_Comment_body_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL))); | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL))); | |
| sp_Comment_created_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL))); | |
| sp_Comment_updated_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 5LL))); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)lv_instance); | |
| return (sp_Comment *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls__adapter_find_by_id(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_Comment * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| const char * _t203 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t203); | |
| const char * _t204 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t204); | |
| const char * _t205 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t205); | |
| const char * _t206 = sp_Db_cls_escape_int(sp_box_int(lv_id)); | |
| SP_GC_ROOT(_t206); | |
| const char * _t207 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t207); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t203, _t204, _t205, _t206, _t207}, 5)); | |
| lv_result = NULL; | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| lv_result = sp_Comment_cls_from_stmt(lv_stmt); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| return (sp_Comment *)lv_result; | |
| return NULL; | |
| } | |
| static mrb_int sp_Comment_cls__adapter_truncate(void) { | |
| SP_GC_SAVE(); | |
| sp_Db_cls_exec((&("\xff" "DELETE FROM comments")[1])); | |
| return sp_Db_cls_exec((&("\xff" "DELETE FROM sqlite_sequence WHERE name = 'comments'")[1])); | |
| return SP_INT_NIL; | |
| } | |
| static sp_Comment * sp_Comment_cls_from_params(sp_CommentParams * lv_p) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(lv_p); | |
| sp_StrIntHash * _t208 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t208); | |
| lv_instance = sp_Comment_new(_t208); | |
| sp_Comment_commenter_eq(lv_instance, lv_p->iv_commenter); | |
| sp_Comment_body_eq(lv_instance, lv_p->iv_body); | |
| return (sp_Comment *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls_find(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| lv_result = sp_Comment_cls__adapter_find_by_id(lv_id); | |
| if ((lv_result == NULL)) { | |
| sp_raise_cls("RecordNotFound", sp_sprintf("Couldn't find %s with id=%lld", sp_class_to_s(((sp_Class){65LL})), (long long)lv_id)); | |
| } | |
| return (sp_Comment *)lv_result; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ArticleRow) | |
| static inline sp_ArticleRow *sp_ArticleRow_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticleRow *self = SP_POOL_NEW(ArticleRow, sp_ArticleRow_gc_scan); | |
| self->cls_id = 66LL; | |
| SP_GC_ROOT(self); | |
| self->iv_body = NULL; | |
| self->iv_created_at = NULL; | |
| self->iv_title = NULL; | |
| self->iv_updated_at = NULL; | |
| self->iv_id = 0LL; | |
| self->iv_body = (&("\xff" "")[1]); | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| self->iv_title = (&("\xff" "")[1]); | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ArticleRow_initialize(sp_ArticleRow *self) { | |
| self->iv_id = 0LL; | |
| self->iv_body = (&("\xff" "")[1]); | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| self->iv_title = (&("\xff" "")[1]); | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_id(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticleRow_id_eq(sp_ArticleRow *self, mrb_int lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_body(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_body; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_body_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_created_at(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_created_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_created_at_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_title(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_title; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_title_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_updated_at(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_updated_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_updated_at_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static sp_ArticleRow * sp_ArticleRow_cls_from_raw(mrb_int lv_row) { | |
| SP_GC_SAVE(); | |
| sp_ArticleRow * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| lv_instance = sp_ArticleRow_new(); | |
| mrb_int _t209 = 0; | |
| sp_ArticleRow_id_eq(lv_instance, (((_t209), TRUE) ? _t209 : 0LL)); | |
| sp_ArticleRow_body_eq(lv_instance, sp_int_to_s(0)); | |
| sp_ArticleRow_created_at_eq(lv_instance, sp_int_to_s(0)); | |
| sp_ArticleRow_title_eq(lv_instance, sp_int_to_s(0)); | |
| sp_ArticleRow_updated_at_eq(lv_instance, sp_int_to_s(0)); | |
| return (sp_ArticleRow *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article) | |
| static inline sp_Article *sp_Article_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article *self = SP_POOL_NEW(Article, sp_Article_gc_scan); | |
| self->cls_id = 67LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t210 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t210 = sp_Article_body_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t210 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t210; | |
| mrb_int _t211 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t211 = sp_Article_created_at_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t211 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t211; | |
| mrb_int _t212 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t212 = sp_Article_title_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t212 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t212; | |
| mrb_int _t213 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t213 = sp_Article_updated_at_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t213 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t213; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article_initialize(sp_Article *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t214 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t214 = sp_Article_body_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t214 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t214; | |
| mrb_int _t215 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t215 = sp_Article_created_at_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t215 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t215; | |
| mrb_int _t216 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t216 = sp_Article_title_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t216 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t216; | |
| mrb_int _t217 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t217 = sp_Article_updated_at_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t217 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t217; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static sp_IntArray * sp_Article_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t218 = sp_IntArray_new(); | |
| sp_IntArray_push(_t218, SPS_id); | |
| sp_IntArray_push(_t218, SPS_body); | |
| sp_IntArray_push(_t218, SPS_created_at); | |
| sp_IntArray_push(_t218, SPS_title); | |
| sp_IntArray_push(_t218, SPS_updated_at); | |
| return _t218; | |
| return NULL; | |
| } | |
| static sp_Article__implicit_6872 * sp_Article_cls_from_row(sp_ArticleRow * lv_row) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_6872 * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_row); | |
| SP_GC_ROOT(lv_row); | |
| sp_StrIntHash * _t219 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t219); | |
| lv_instance = sp_Article__implicit_6872_new(_t219); | |
| lv_instance->iv_id = lv_row->iv_id; | |
| sp_Article__implicit_6872_body_eq(lv_instance, sp_box_str(lv_row->iv_body)); | |
| sp_Article__implicit_6872_created_at_eq(lv_instance, sp_box_str(lv_row->iv_created_at)); | |
| sp_Article__implicit_6872_title_eq(lv_instance, sp_box_str(lv_row->iv_title)); | |
| sp_Article__implicit_6872_updated_at_eq(lv_instance, sp_box_str(lv_row->iv_updated_at)); | |
| return (sp_Article__implicit_6872 *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Article__implicit_6906 * sp_Article_cls_from_stmt(void * lv_stmt) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_6906 * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| sp_StrIntHash * _t220 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t220); | |
| lv_instance = sp_Article__implicit_6906_new(_t220); | |
| lv_instance->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| sp_Article__implicit_6906_body_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL))); | |
| sp_Article__implicit_6906_created_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL))); | |
| sp_Article__implicit_6906_title_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL))); | |
| sp_Article__implicit_6906_updated_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL))); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)lv_instance); | |
| return (sp_Article__implicit_6906 *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Article__implicit_6906 * sp_Article_cls__adapter_find_by_id(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_Article__implicit_6906 * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| const char * _t221 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles")[1]); | |
| SP_GC_ROOT(_t221); | |
| const char * _t222 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t222); | |
| const char * _t223 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t223); | |
| const char * _t224 = sp_Db_cls_escape_int(sp_box_int(lv_id)); | |
| SP_GC_ROOT(_t224); | |
| const char * _t225 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t225); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t221, _t222, _t223, _t224, _t225}, 5)); | |
| lv_result = NULL; | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| lv_result = sp_Article_cls_from_stmt(lv_stmt); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| return (sp_Article__implicit_6906 *)lv_result; | |
| return NULL; | |
| } | |
| static sp_PtrArray * sp_Article_cls__adapter_all(void) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_PtrArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| lv_stmt = sp_Db_cls_prepare((&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles")[1])); | |
| lv_results = sp_PtrArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_12: ; | |
| sp_PtrArray_push(lv_results, sp_Article_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| return (sp_PtrArray *)lv_results; | |
| return NULL; | |
| } | |
| static mrb_int sp_Article_cls__adapter_count(void) { | |
| void * lv_stmt = NULL; | |
| mrb_int lv_result = 0; | |
| SP_GC_SAVE(); | |
| lv_stmt = sp_Db_cls_prepare((&("\xff" "SELECT COUNT(*) FROM articles")[1])); | |
| sp_Db_cls_step_p(lv_stmt); | |
| lv_result = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| sp_Db_cls_finalize(lv_stmt); | |
| return lv_result; | |
| return 0; | |
| } | |
| static mrb_bool sp_Article_cls__adapter_exists_by_id_p(sp_RbVal lv_id) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| mrb_bool lv_result = FALSE; | |
| SP_GC_ROOT_RBVAL(lv_id); | |
| const char * _t226 = (&("\xff" "SELECT 1 FROM articles")[1]); | |
| SP_GC_ROOT(_t226); | |
| const char * _t227 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t227); | |
| const char * _t228 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t228); | |
| const char * _t229 = sp_Db_cls_escape_int(lv_id); | |
| SP_GC_ROOT(_t229); | |
| const char * _t230 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t230); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t226, _t227, _t228, _t229, _t230}, 5)); | |
| lv_result = sp_Db_cls_step_p(lv_stmt); | |
| sp_Db_cls_finalize(lv_stmt); | |
| return lv_result; | |
| return FALSE; | |
| } | |
| static mrb_int sp_Article_cls__adapter_truncate(void) { | |
| SP_GC_SAVE(); | |
| sp_Db_cls_exec((&("\xff" "DELETE FROM articles")[1])); | |
| return sp_Db_cls_exec((&("\xff" "DELETE FROM sqlite_sequence WHERE name = 'articles'")[1])); | |
| return SP_INT_NIL; | |
| } | |
| static sp_Article__implicit_7484 * sp_Article_cls_from_params(sp_ArticleParams * lv_p) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_7484 * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(lv_p); | |
| sp_StrIntHash * _t231 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t231); | |
| lv_instance = sp_Article__implicit_7484_new(_t231); | |
| sp_Article__implicit_7484_title_eq(lv_instance, lv_p->iv_title); | |
| sp_Article__implicit_7484_body_eq(lv_instance, lv_p->iv_body); | |
| return (sp_Article__implicit_7484 *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_PtrArray * sp_Article_cls_all(void) { | |
| SP_GC_SAVE(); | |
| return sp_Article_cls__adapter_all(); | |
| return NULL; | |
| } | |
| static sp_Article__implicit_6906 * sp_Article_cls_find(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_6906 * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| lv_result = sp_Article_cls__adapter_find_by_id(lv_id); | |
| if ((lv_result == NULL)) { | |
| sp_raise_cls("RecordNotFound", sp_sprintf("Couldn't find %s with id=%lld", sp_class_to_s(((sp_Class){67LL})), (long long)lv_id)); | |
| } | |
| return (sp_Article__implicit_6906 *)lv_result; | |
| return NULL; | |
| } | |
| static mrb_int sp_Article_cls_count(void) { | |
| SP_GC_SAVE(); | |
| return sp_Article_cls__adapter_count(); | |
| return 0; | |
| } | |
| static mrb_bool sp_Article_cls_exists_p(sp_RbVal lv_id) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_id); | |
| return sp_Article_cls__adapter_exists_by_id_p(lv_id); | |
| return FALSE; | |
| } | |
| static sp_Article__implicit_6906 * sp_Article_cls_last(void) { | |
| SP_GC_SAVE(); | |
| sp_PtrArray * lv_records = NULL; | |
| SP_GC_ROOT(lv_records); | |
| lv_records = sp_Article_cls_all(); | |
| if (sp_PtrArray_empty(lv_records)) { | |
| return 0; | |
| } else { | |
| return ((sp_Article__implicit_6906 *)sp_PtrArray_get(lv_records, -1LL)); | |
| } | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ArticleParams) | |
| static inline sp_ArticleParams *sp_ArticleParams_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticleParams *self = SP_POOL_NEW(ArticleParams, sp_ArticleParams_gc_scan); | |
| self->cls_id = 68LL; | |
| SP_GC_ROOT(self); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_title = sp_box_str((&("\xff" "")[1])); | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ArticleParams_initialize(sp_ArticleParams *self) { | |
| self->iv_title = sp_box_str((&("\xff" "")[1])); | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| } | |
| static inline sp_RbVal sp_ArticleParams_title(sp_ArticleParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t232 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t232; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ArticleParams_title_eq(sp_ArticleParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_ArticleParams_body(sp_ArticleParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t233 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t233; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ArticleParams_body_eq(sp_ArticleParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_StrPolyHash * sp_ArticleParams_to_h(sp_ArticleParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_StrPolyHash *_t234 = sp_StrPolyHash_new(); | |
| SP_GC_ROOT(_t234); | |
| sp_StrPolyHash_set(_t234, (&("\xff" "title")[1]), self->iv_title); | |
| sp_StrPolyHash_set(_t234, (&("\xff" "body")[1]), self->iv_body); | |
| return _t234; | |
| return NULL; | |
| } | |
| static sp_ArticleParams * sp_ArticleParams_cls_from_raw(sp_RbVal lv_params) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_raw_sub = sp_box_nil(); | |
| sp_RbVal lv_sub = sp_box_nil(); | |
| sp_ArticleParams * lv_instance = NULL; | |
| sp_RbVal lv_raw_title = sp_box_nil(); | |
| sp_RbVal lv_raw_body = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_raw_sub); | |
| SP_GC_ROOT_RBVAL(lv_sub); | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT_RBVAL(lv_raw_title); | |
| SP_GC_ROOT_RBVAL(lv_raw_body); | |
| SP_GC_ROOT_RBVAL(lv_params); | |
| sp_RbVal _t235 = lv_params; | |
| sp_RbVal _t236 = sp_box_nil(); | |
| if (_t235.tag == SP_TAG_OBJ) { | |
| if (_t235.cls_id == 53) _t236 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t235.v.p, (&("\xff" "article")[1]), sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| if (_t235.cls_id == 54) _t236 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t235.v.p, (&("\xff" "article")[1]), sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| if (_t235.cls_id == SP_BUILTIN_STR_INT_HASH) _t236 = sp_StrIntHash_has_key((sp_StrIntHash *)_t235.v.p, (&("\xff" "article")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t235.v.p, (&("\xff" "article")[1]))) : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| if (_t235.cls_id == SP_BUILTIN_STR_STR_HASH) _t236 = sp_StrStrHash_has_key((sp_StrStrHash *)_t235.v.p, (&("\xff" "article")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t235.v.p, (&("\xff" "article")[1]))) : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| if (_t235.cls_id == SP_BUILTIN_STR_POLY_HASH) _t236 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t235.v.p, (&("\xff" "article")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t235.v.p, (&("\xff" "article")[1])) : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| } | |
| lv_raw_sub = _t236; | |
| sp_RbVal _t237 = lv_raw_sub; | |
| lv_sub = ((_t237.tag == SP_TAG_OBJ && (_t237.cls_id == SP_BUILTIN_STR_INT_HASH || _t237.cls_id == SP_BUILTIN_STR_STR_HASH || _t237.cls_id == SP_BUILTIN_INT_STR_HASH || _t237.cls_id == SP_BUILTIN_SYM_INT_HASH || _t237.cls_id == SP_BUILTIN_SYM_STR_HASH || _t237.cls_id == SP_BUILTIN_STR_POLY_HASH || _t237.cls_id == SP_BUILTIN_SYM_POLY_HASH)) ? lv_raw_sub : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| lv_instance = sp_ArticleParams_new(); | |
| sp_RbVal _t238 = lv_sub; | |
| sp_RbVal _t239 = sp_box_nil(); | |
| if (_t238.tag == SP_TAG_OBJ) { | |
| if (_t238.cls_id == 53) _t239 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t238.v.p, (&("\xff" "title")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t238.cls_id == 54) _t239 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t238.v.p, (&("\xff" "title")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t238.cls_id == SP_BUILTIN_STR_INT_HASH) _t239 = sp_StrIntHash_has_key((sp_StrIntHash *)_t238.v.p, (&("\xff" "title")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t238.v.p, (&("\xff" "title")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t238.cls_id == SP_BUILTIN_STR_STR_HASH) _t239 = sp_StrStrHash_has_key((sp_StrStrHash *)_t238.v.p, (&("\xff" "title")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t238.v.p, (&("\xff" "title")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t238.cls_id == SP_BUILTIN_STR_POLY_HASH) _t239 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t238.v.p, (&("\xff" "title")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t238.v.p, (&("\xff" "title")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_title = _t239; | |
| sp_RbVal _t240 = lv_raw_title; | |
| sp_ArticleParams_title_eq(lv_instance, ((_t240.tag == SP_TAG_STR) ? lv_raw_title : sp_box_str((&("\xff" "")[1])))); | |
| sp_RbVal _t241 = lv_sub; | |
| sp_RbVal _t242 = sp_box_nil(); | |
| if (_t241.tag == SP_TAG_OBJ) { | |
| if (_t241.cls_id == 53) _t242 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t241.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t241.cls_id == 54) _t242 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t241.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t241.cls_id == SP_BUILTIN_STR_INT_HASH) _t242 = sp_StrIntHash_has_key((sp_StrIntHash *)_t241.v.p, (&("\xff" "body")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t241.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t241.cls_id == SP_BUILTIN_STR_STR_HASH) _t242 = sp_StrStrHash_has_key((sp_StrStrHash *)_t241.v.p, (&("\xff" "body")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t241.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t241.cls_id == SP_BUILTIN_STR_POLY_HASH) _t242 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t241.v.p, (&("\xff" "body")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t241.v.p, (&("\xff" "body")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_body = _t242; | |
| sp_RbVal _t243 = lv_raw_body; | |
| sp_ArticleParams_body_eq(lv_instance, ((_t243.tag == SP_TAG_STR) ? lv_raw_body : sp_box_str((&("\xff" "")[1])))); | |
| return (sp_ArticleParams *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ArticlesController) | |
| static inline sp_ArticlesController *sp_ArticlesController_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticlesController *self = SP_POOL_NEW(ArticlesController, sp_ArticlesController_gc_scan); | |
| self->cls_id = 69LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = sp_box_nil(); | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| self->iv_articles = NULL; | |
| self->iv_article = sp_box_nil(); | |
| sp_ActionController_Base_initialize((sp_ActionController_Base *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline mrb_int sp_ArticlesController_process_action(sp_ArticlesController *self, sp_sym lv_action_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| mrb_int _t244 = lv_action_name; | |
| if (_t244 == SPS_index) { | |
| return sp_ArticlesController_index(self); | |
| } else if (_t244 == SPS_show) { | |
| return sp_ArticlesController_show(self); | |
| } else if (_t244 == SPS_new) { | |
| return sp_ArticlesController_new_action(self); | |
| } else if (_t244 == SPS_edit) { | |
| return sp_ArticlesController_edit(self); | |
| } else if (_t244 == SPS_create) { | |
| return sp_ArticlesController_create(self); | |
| } else if (_t244 == SPS_update) { | |
| return sp_ArticlesController_update(self); | |
| } else if (_t244 == SPS_destroy) { | |
| return sp_ArticlesController_destroy(self); | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesController_index(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_PtrArray * lv_results = NULL; | |
| sp_IntArray * lv___comments_ids = NULL; | |
| sp_Article__implicit_6906 * lv_a = NULL; | |
| void * lv___comments_stmt = NULL; | |
| sp_PtrArray * lv___comments_loaded = NULL; | |
| sp_PtrArray * lv___comments_group = NULL; | |
| sp_Comment * lv_r = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(lv___comments_ids); | |
| SP_GC_ROOT(lv_a); | |
| SP_GC_ROOT(lv___comments_loaded); | |
| SP_GC_ROOT(lv___comments_group); | |
| SP_GC_ROOT(lv_r); | |
| SP_GC_ROOT(self); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat((&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles")[1]), (&("\xff" " ORDER BY created_at DESC")[1]))); | |
| lv_results = sp_PtrArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_13: ; | |
| sp_PtrArray_push(lv_results, sp_Article_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| SP_GC_ROOT(lv_results); | |
| sp_IntArray *_t245 = sp_IntArray_new(); | |
| SP_GC_ROOT(_t245); | |
| for (mrb_int _t246 = 0; _t246 < sp_PtrArray_length(lv_results); _t246++) { | |
| sp_Article__implicit_6906 * lv_a = (sp_Article__implicit_6906 *)sp_PtrArray_get(lv_results, _t246); | |
| sp_IntArray_push(_t245, lv_a->iv_id); | |
| } | |
| lv___comments_ids = _t245; | |
| const char * _t247 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments WHERE article_id IN (")[1]); | |
| SP_GC_ROOT(_t247); | |
| const char * _t248 = sp_Db_cls_escape_int_list((sp_IntArray *)lv___comments_ids); | |
| SP_GC_ROOT(_t248); | |
| const char * _t249 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t249); | |
| lv___comments_stmt = sp_Db_cls_prepare(sp_str_concat3(_t247, _t248, _t249)); | |
| lv___comments_loaded = sp_PtrArray_new(); | |
| while (sp_Db_cls_step_p(lv___comments_stmt)) { | |
| sp_redo_14: ; | |
| sp_PtrArray_push(lv___comments_loaded, sp_Comment_cls_from_stmt(lv___comments_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv___comments_stmt); | |
| for (mrb_int _t250 = 0; _t250 < sp_PtrArray_length(lv_results); _t250++) { | |
| sp_Article__implicit_6906 * _t251 = (sp_Article__implicit_6906 *)sp_PtrArray_get(lv_results, _t250); | |
| lv_a = _t251; | |
| sp_redo_15: ; | |
| lv___comments_group = sp_PtrArray_new(); | |
| for (mrb_int _t252 = 0; _t252 < sp_PtrArray_length(lv___comments_loaded); _t252++) { | |
| sp_Comment * _t253 = (sp_Comment *)sp_PtrArray_get(lv___comments_loaded, _t252); | |
| lv_r = _t253; | |
| sp_redo_16: ; | |
| if (sp_poly_eq(lv_r->iv_article_id, sp_box_int(lv_a->iv_id))) { | |
| sp_PtrArray_push(lv___comments_group, lv_r); | |
| } | |
| } | |
| sp_Article__implicit_6906__preload_comments(lv_a, lv___comments_group); | |
| } | |
| self->iv_articles = lv_results; | |
| if ((self->iv_request_format == SPS_json)) { | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_index_json(self->iv_articles), SPS_ok, (&("\xff" "application/json")[1]), ((void)(0), sp_box_nil())); | |
| } else { | |
| sp_RbVal _t254 = self->iv_flash; | |
| sp_RbVal _t255 = sp_box_nil(); | |
| if (_t254.tag == SP_TAG_OBJ) { | |
| if (_t254.cls_id == 50) _t255 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 53) _t255 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 54) _t255 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 63) _t255 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 65) _t255 = sp_Comment__aref((sp_Comment *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 76) _t255 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 77) _t255 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 78) _t255 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 79) _t255 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 80) _t255 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 81) _t255 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t255 = sp_SymPolyHash_get((sp_SymPolyHash *)_t254.v.p, SPS_notice); | |
| if (_t254.cls_id == SP_BUILTIN_SYM_INT_HASH) _t255 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t254.v.p, SPS_notice)); | |
| if (_t254.cls_id == SP_BUILTIN_SYM_STR_HASH) _t255 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t254.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t256 = self->iv_flash; | |
| sp_RbVal _t257 = sp_box_nil(); | |
| if (_t256.tag == SP_TAG_OBJ) { | |
| if (_t256.cls_id == 50) _t257 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 53) _t257 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 54) _t257 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 63) _t257 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 65) _t257 = sp_Comment__aref((sp_Comment *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 76) _t257 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 77) _t257 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 78) _t257 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 79) _t257 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 80) _t257 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 81) _t257 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t257 = sp_SymPolyHash_get((sp_SymPolyHash *)_t256.v.p, SPS_alert); | |
| if (_t256.cls_id == SP_BUILTIN_SYM_INT_HASH) _t257 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t256.v.p, SPS_alert)); | |
| if (_t256.cls_id == SP_BUILTIN_SYM_STR_HASH) _t257 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t256.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_index(self->iv_articles, _t255, _t257), SPS_ok, NULL, ((void)(0), sp_box_nil())); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_ArticlesController_show(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t258 = self->iv_params; | |
| sp_RbVal _t259 = sp_box_nil(); | |
| if (_t258.tag == SP_TAG_OBJ) { | |
| if (_t258.cls_id == 53) _t259 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t258.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t258.cls_id == 54) _t259 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t258.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t258.cls_id == SP_BUILTIN_STR_INT_HASH) _t259 = sp_StrIntHash_has_key((sp_StrIntHash *)_t258.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t258.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t258.cls_id == SP_BUILTIN_STR_STR_HASH) _t259 = sp_StrStrHash_has_key((sp_StrStrHash *)_t258.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t258.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t258.cls_id == SP_BUILTIN_STR_POLY_HASH) _t259 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t258.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t258.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t260 = sp_poly_to_s(_t259); | |
| SP_GC_ROOT(_t260); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t260)), 77); | |
| if ((self->iv_request_format == SPS_json)) { | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_show_json(self->iv_article), SPS_ok, (&("\xff" "application/json")[1]), ((void)(0), sp_box_nil())); | |
| } else { | |
| sp_RbVal _t261 = self->iv_flash; | |
| sp_RbVal _t262 = sp_box_nil(); | |
| if (_t261.tag == SP_TAG_OBJ) { | |
| if (_t261.cls_id == 50) _t262 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 53) _t262 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 54) _t262 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 63) _t262 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 65) _t262 = sp_Comment__aref((sp_Comment *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 76) _t262 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 77) _t262 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 78) _t262 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 79) _t262 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 80) _t262 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 81) _t262 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t262 = sp_SymPolyHash_get((sp_SymPolyHash *)_t261.v.p, SPS_notice); | |
| if (_t261.cls_id == SP_BUILTIN_SYM_INT_HASH) _t262 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t261.v.p, SPS_notice)); | |
| if (_t261.cls_id == SP_BUILTIN_SYM_STR_HASH) _t262 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t261.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t263 = self->iv_flash; | |
| sp_RbVal _t264 = sp_box_nil(); | |
| if (_t263.tag == SP_TAG_OBJ) { | |
| if (_t263.cls_id == 50) _t264 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 53) _t264 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 54) _t264 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 63) _t264 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 65) _t264 = sp_Comment__aref((sp_Comment *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 76) _t264 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 77) _t264 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 78) _t264 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 79) _t264 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 80) _t264 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 81) _t264 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t264 = sp_SymPolyHash_get((sp_SymPolyHash *)_t263.v.p, SPS_alert); | |
| if (_t263.cls_id == SP_BUILTIN_SYM_INT_HASH) _t264 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t263.v.p, SPS_alert)); | |
| if (_t263.cls_id == SP_BUILTIN_SYM_STR_HASH) _t264 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t263.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_show(self->iv_article, _t262, _t264), SPS_ok, NULL, ((void)(0), sp_box_nil())); | |
| } | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticlesController_new_action(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_StrIntHash * _t265 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t265); | |
| self->iv_article = sp_box_obj(sp_Article__implicit_7995_new(_t265), 79); | |
| sp_RbVal _t266 = self->iv_flash; | |
| sp_RbVal _t267 = sp_box_nil(); | |
| if (_t266.tag == SP_TAG_OBJ) { | |
| if (_t266.cls_id == 50) _t267 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 53) _t267 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 54) _t267 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 63) _t267 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 65) _t267 = sp_Comment__aref((sp_Comment *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 76) _t267 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 77) _t267 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 78) _t267 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 79) _t267 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 80) _t267 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == 81) _t267 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t266.v.p, sp_box_sym(SPS_notice)); | |
| if (_t266.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t267 = sp_SymPolyHash_get((sp_SymPolyHash *)_t266.v.p, SPS_notice); | |
| if (_t266.cls_id == SP_BUILTIN_SYM_INT_HASH) _t267 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t266.v.p, SPS_notice)); | |
| if (_t266.cls_id == SP_BUILTIN_SYM_STR_HASH) _t267 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t266.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t268 = self->iv_flash; | |
| sp_RbVal _t269 = sp_box_nil(); | |
| if (_t268.tag == SP_TAG_OBJ) { | |
| if (_t268.cls_id == 50) _t269 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 53) _t269 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 54) _t269 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 63) _t269 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 65) _t269 = sp_Comment__aref((sp_Comment *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 76) _t269 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 77) _t269 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 78) _t269 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 79) _t269 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 80) _t269 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == 81) _t269 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t268.v.p, sp_box_sym(SPS_alert)); | |
| if (_t268.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t269 = sp_SymPolyHash_get((sp_SymPolyHash *)_t268.v.p, SPS_alert); | |
| if (_t268.cls_id == SP_BUILTIN_SYM_INT_HASH) _t269 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t268.v.p, SPS_alert)); | |
| if (_t268.cls_id == SP_BUILTIN_SYM_STR_HASH) _t269 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t268.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_new(self->iv_article, _t267, _t269), SPS_ok, NULL, ((void)(0), sp_box_nil())); | |
| return 0; | |
| } | |
| static mrb_int sp_ArticlesController_edit(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t270 = self->iv_params; | |
| sp_RbVal _t271 = sp_box_nil(); | |
| if (_t270.tag == SP_TAG_OBJ) { | |
| if (_t270.cls_id == 53) _t271 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t270.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t270.cls_id == 54) _t271 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t270.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t270.cls_id == SP_BUILTIN_STR_INT_HASH) _t271 = sp_StrIntHash_has_key((sp_StrIntHash *)_t270.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t270.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t270.cls_id == SP_BUILTIN_STR_STR_HASH) _t271 = sp_StrStrHash_has_key((sp_StrStrHash *)_t270.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t270.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t270.cls_id == SP_BUILTIN_STR_POLY_HASH) _t271 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t270.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t270.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t272 = sp_poly_to_s(_t271); | |
| SP_GC_ROOT(_t272); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t272)), 77); | |
| sp_RbVal _t273 = self->iv_flash; | |
| sp_RbVal _t274 = sp_box_nil(); | |
| if (_t273.tag == SP_TAG_OBJ) { | |
| if (_t273.cls_id == 50) _t274 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 53) _t274 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 54) _t274 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 63) _t274 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 65) _t274 = sp_Comment__aref((sp_Comment *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 76) _t274 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 77) _t274 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 78) _t274 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 79) _t274 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 80) _t274 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == 81) _t274 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t273.v.p, sp_box_sym(SPS_notice)); | |
| if (_t273.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t274 = sp_SymPolyHash_get((sp_SymPolyHash *)_t273.v.p, SPS_notice); | |
| if (_t273.cls_id == SP_BUILTIN_SYM_INT_HASH) _t274 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t273.v.p, SPS_notice)); | |
| if (_t273.cls_id == SP_BUILTIN_SYM_STR_HASH) _t274 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t273.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t275 = self->iv_flash; | |
| sp_RbVal _t276 = sp_box_nil(); | |
| if (_t275.tag == SP_TAG_OBJ) { | |
| if (_t275.cls_id == 50) _t276 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 53) _t276 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 54) _t276 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 63) _t276 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 65) _t276 = sp_Comment__aref((sp_Comment *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 76) _t276 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 77) _t276 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 78) _t276 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 79) _t276 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 80) _t276 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == 81) _t276 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t275.v.p, sp_box_sym(SPS_alert)); | |
| if (_t275.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t276 = sp_SymPolyHash_get((sp_SymPolyHash *)_t275.v.p, SPS_alert); | |
| if (_t275.cls_id == SP_BUILTIN_SYM_INT_HASH) _t276 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t275.v.p, SPS_alert)); | |
| if (_t275.cls_id == SP_BUILTIN_SYM_STR_HASH) _t276 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t275.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_edit(self->iv_article, _t274, _t276), SPS_ok, NULL, ((void)(0), sp_box_nil())); | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticlesController_create(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_box_obj(sp_Article_cls_from_params(sp_ArticlesController_article_params(self)), 78); | |
| sp_RbVal _t277 = self->iv_article; | |
| mrb_bool _t278 = FALSE; | |
| if (_t277.tag == SP_TAG_OBJ) { | |
| if (_t277.cls_id == 78) _t278 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t277.v.p); | |
| if (_t277.cls_id == 79) _t278 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t277.v.p); | |
| } | |
| if (_t278) { | |
| if ((self->iv_request_format == SPS_json)) { | |
| sp_String * _t279 = sp_Views_Articles_cls_show_json(self->iv_article); | |
| SP_GC_ROOT(_t279); | |
| const char * _t280 = (&("\xff" "application/json")[1]); | |
| SP_GC_ROOT(_t280); | |
| sp_RbVal _t281 = self->iv_article; | |
| mrb_int _t282 = 0; | |
| if (_t281.tag == SP_TAG_OBJ) { | |
| if (_t281.cls_id == 78) _t282 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t281.v.p); | |
| if (_t281.cls_id == 79) _t282 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t281.v.p); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, _t279, SPS_created, _t280, sp_box_str(sp_RouteHelpers_cls_article_path(_t282))); | |
| } else { | |
| sp_RbVal _t283 = self->iv_article; | |
| mrb_int _t284 = 0; | |
| if (_t283.tag == SP_TAG_OBJ) { | |
| if (_t283.cls_id == 78) _t284 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t283.v.p); | |
| if (_t283.cls_id == 79) _t284 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t283.v.p); | |
| } | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path(_t284), (&("\xff" "Article was successfully created.")[1]), NULL, SPS_found); | |
| } | |
| } else { | |
| sp_RbVal _t285 = self->iv_flash; | |
| sp_RbVal _t286 = sp_box_nil(); | |
| if (_t285.tag == SP_TAG_OBJ) { | |
| if (_t285.cls_id == 50) _t286 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 53) _t286 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 54) _t286 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 63) _t286 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 65) _t286 = sp_Comment__aref((sp_Comment *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 76) _t286 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 77) _t286 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 78) _t286 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 79) _t286 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 80) _t286 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == 81) _t286 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t285.v.p, sp_box_sym(SPS_notice)); | |
| if (_t285.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t286 = sp_SymPolyHash_get((sp_SymPolyHash *)_t285.v.p, SPS_notice); | |
| if (_t285.cls_id == SP_BUILTIN_SYM_INT_HASH) _t286 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t285.v.p, SPS_notice)); | |
| if (_t285.cls_id == SP_BUILTIN_SYM_STR_HASH) _t286 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t285.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t287 = self->iv_flash; | |
| sp_RbVal _t288 = sp_box_nil(); | |
| if (_t287.tag == SP_TAG_OBJ) { | |
| if (_t287.cls_id == 50) _t288 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 53) _t288 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 54) _t288 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 63) _t288 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 65) _t288 = sp_Comment__aref((sp_Comment *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 76) _t288 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 77) _t288 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 78) _t288 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 79) _t288 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 80) _t288 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == 81) _t288 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t287.v.p, sp_box_sym(SPS_alert)); | |
| if (_t287.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t288 = sp_SymPolyHash_get((sp_SymPolyHash *)_t287.v.p, SPS_alert); | |
| if (_t287.cls_id == SP_BUILTIN_SYM_INT_HASH) _t288 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t287.v.p, SPS_alert)); | |
| if (_t287.cls_id == SP_BUILTIN_SYM_STR_HASH) _t288 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t287.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_new(self->iv_article, _t286, _t288), SPS_unprocessable_content, NULL, ((void)(0), sp_box_nil())); | |
| } | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticlesController_update(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t289 = self->iv_params; | |
| sp_RbVal _t290 = sp_box_nil(); | |
| if (_t289.tag == SP_TAG_OBJ) { | |
| if (_t289.cls_id == 53) _t290 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t289.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t289.cls_id == 54) _t290 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t289.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t289.cls_id == SP_BUILTIN_STR_INT_HASH) _t290 = sp_StrIntHash_has_key((sp_StrIntHash *)_t289.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t289.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t289.cls_id == SP_BUILTIN_STR_STR_HASH) _t290 = sp_StrStrHash_has_key((sp_StrStrHash *)_t289.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t289.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t289.cls_id == SP_BUILTIN_STR_POLY_HASH) _t290 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t289.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t289.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t291 = sp_poly_to_s(_t290); | |
| SP_GC_ROOT(_t291); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t291)), 77); | |
| sp_RbVal _t292 = self->iv_article; | |
| mrb_bool _t293 = FALSE; | |
| if (_t292.tag == SP_TAG_OBJ) { | |
| if (_t292.cls_id == 78) _t293 = sp_Article__implicit_7484_update((sp_Article__implicit_7484 *)_t292.v.p, sp_ArticlesController_article_params(self)); | |
| if (_t292.cls_id == 79) _t293 = sp_Article__implicit_7995_update((sp_Article__implicit_7995 *)_t292.v.p, sp_ArticlesController_article_params(self)); | |
| } | |
| if (_t293) { | |
| if ((self->iv_request_format == SPS_json)) { | |
| sp_String * _t294 = sp_Views_Articles_cls_show_json(self->iv_article); | |
| SP_GC_ROOT(_t294); | |
| const char * _t295 = (&("\xff" "application/json")[1]); | |
| SP_GC_ROOT(_t295); | |
| sp_RbVal _t296 = self->iv_article; | |
| mrb_int _t297 = 0; | |
| if (_t296.tag == SP_TAG_OBJ) { | |
| if (_t296.cls_id == 78) _t297 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t296.v.p); | |
| if (_t296.cls_id == 79) _t297 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t296.v.p); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, _t294, SPS_ok, _t295, sp_box_str(sp_RouteHelpers_cls_article_path(_t297))); | |
| } else { | |
| sp_RbVal _t298 = self->iv_article; | |
| mrb_int _t299 = 0; | |
| if (_t298.tag == SP_TAG_OBJ) { | |
| if (_t298.cls_id == 78) _t299 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t298.v.p); | |
| if (_t298.cls_id == 79) _t299 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t298.v.p); | |
| } | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path(_t299), (&("\xff" "Article was successfully updated.")[1]), NULL, SPS_see_other); | |
| } | |
| } else { | |
| sp_RbVal _t300 = self->iv_flash; | |
| sp_RbVal _t301 = sp_box_nil(); | |
| if (_t300.tag == SP_TAG_OBJ) { | |
| if (_t300.cls_id == 50) _t301 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 53) _t301 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 54) _t301 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 63) _t301 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 65) _t301 = sp_Comment__aref((sp_Comment *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 76) _t301 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 77) _t301 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 78) _t301 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 79) _t301 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 80) _t301 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == 81) _t301 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t300.v.p, sp_box_sym(SPS_notice)); | |
| if (_t300.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t301 = sp_SymPolyHash_get((sp_SymPolyHash *)_t300.v.p, SPS_notice); | |
| if (_t300.cls_id == SP_BUILTIN_SYM_INT_HASH) _t301 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t300.v.p, SPS_notice)); | |
| if (_t300.cls_id == SP_BUILTIN_SYM_STR_HASH) _t301 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t300.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t302 = self->iv_flash; | |
| sp_RbVal _t303 = sp_box_nil(); | |
| if (_t302.tag == SP_TAG_OBJ) { | |
| if (_t302.cls_id == 50) _t303 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 53) _t303 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 54) _t303 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 63) _t303 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 65) _t303 = sp_Comment__aref((sp_Comment *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 76) _t303 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 77) _t303 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 78) _t303 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 79) _t303 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 80) _t303 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == 81) _t303 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t302.v.p, sp_box_sym(SPS_alert)); | |
| if (_t302.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t303 = sp_SymPolyHash_get((sp_SymPolyHash *)_t302.v.p, SPS_alert); | |
| if (_t302.cls_id == SP_BUILTIN_SYM_INT_HASH) _t303 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t302.v.p, SPS_alert)); | |
| if (_t302.cls_id == SP_BUILTIN_SYM_STR_HASH) _t303 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t302.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_edit(self->iv_article, _t301, _t303), SPS_unprocessable_content, NULL, ((void)(0), sp_box_nil())); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_ArticlesController_destroy(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t304 = self->iv_params; | |
| sp_RbVal _t305 = sp_box_nil(); | |
| if (_t304.tag == SP_TAG_OBJ) { | |
| if (_t304.cls_id == 53) _t305 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t304.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t304.cls_id == 54) _t305 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t304.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t304.cls_id == SP_BUILTIN_STR_INT_HASH) _t305 = sp_StrIntHash_has_key((sp_StrIntHash *)_t304.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t304.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t304.cls_id == SP_BUILTIN_STR_STR_HASH) _t305 = sp_StrStrHash_has_key((sp_StrStrHash *)_t304.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t304.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t304.cls_id == SP_BUILTIN_STR_POLY_HASH) _t305 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t304.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t304.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t306 = sp_poly_to_s(_t305); | |
| SP_GC_ROOT(_t306); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t306)), 77); | |
| sp_RbVal _t307 = self->iv_article; | |
| sp_ActiveRecord_Base * _t308 = NULL; | |
| if (_t307.tag == SP_TAG_OBJ) { | |
| if (_t307.cls_id == 78) _t308 = sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t307.v.p); | |
| if (_t307.cls_id == 79) _t308 = sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t307.v.p); | |
| } | |
| _t308; | |
| if ((self->iv_request_format == SPS_json)) { | |
| return sp_ActionController_Base_head((sp_ActionController_Base *)self, SPS_no_content, (&("\xff" "application/json")[1])); | |
| } else { | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_articles_path(), (&("\xff" "Article was successfully destroyed.")[1]), NULL, SPS_see_other); | |
| } | |
| return 0; | |
| } | |
| static inline sp_ArticleParams * sp_ArticlesController_article_params(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_ArticleParams_cls_from_raw(self->iv_params); | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(CommentParams) | |
| static inline sp_CommentParams *sp_CommentParams_new(void) { | |
| SP_GC_SAVE(); | |
| sp_CommentParams *self = SP_POOL_NEW(CommentParams, sp_CommentParams_gc_scan); | |
| self->cls_id = 70LL; | |
| SP_GC_ROOT(self); | |
| self->iv_commenter = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_commenter = sp_box_str((&("\xff" "")[1])); | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_CommentParams_initialize(sp_CommentParams *self) { | |
| self->iv_commenter = sp_box_str((&("\xff" "")[1])); | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| } | |
| static inline sp_RbVal sp_CommentParams_commenter(sp_CommentParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t309 = self->iv_commenter; | |
| SP_GC_RESTORE(); | |
| return _t309; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_CommentParams_commenter_eq(sp_CommentParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_commenter = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_CommentParams_body(sp_CommentParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t310 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t310; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_CommentParams_body_eq(sp_CommentParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_StrPolyHash * sp_CommentParams_to_h(sp_CommentParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_StrPolyHash *_t311 = sp_StrPolyHash_new(); | |
| SP_GC_ROOT(_t311); | |
| sp_StrPolyHash_set(_t311, (&("\xff" "commenter")[1]), self->iv_commenter); | |
| sp_StrPolyHash_set(_t311, (&("\xff" "body")[1]), self->iv_body); | |
| return _t311; | |
| return NULL; | |
| } | |
| static sp_CommentParams * sp_CommentParams_cls_from_raw(sp_RbVal lv_params) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_raw_sub = sp_box_nil(); | |
| sp_RbVal lv_sub = sp_box_nil(); | |
| sp_CommentParams * lv_instance = NULL; | |
| sp_RbVal lv_raw_commenter = sp_box_nil(); | |
| sp_RbVal lv_raw_body = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_raw_sub); | |
| SP_GC_ROOT_RBVAL(lv_sub); | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT_RBVAL(lv_raw_commenter); | |
| SP_GC_ROOT_RBVAL(lv_raw_body); | |
| SP_GC_ROOT_RBVAL(lv_params); | |
| sp_RbVal _t312 = lv_params; | |
| sp_RbVal _t313 = sp_box_nil(); | |
| if (_t312.tag == SP_TAG_OBJ) { | |
| if (_t312.cls_id == 53) _t313 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t312.v.p, (&("\xff" "comment")[1]), sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| if (_t312.cls_id == 54) _t313 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t312.v.p, (&("\xff" "comment")[1]), sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| if (_t312.cls_id == SP_BUILTIN_STR_INT_HASH) _t313 = sp_StrIntHash_has_key((sp_StrIntHash *)_t312.v.p, (&("\xff" "comment")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t312.v.p, (&("\xff" "comment")[1]))) : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| if (_t312.cls_id == SP_BUILTIN_STR_STR_HASH) _t313 = sp_StrStrHash_has_key((sp_StrStrHash *)_t312.v.p, (&("\xff" "comment")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t312.v.p, (&("\xff" "comment")[1]))) : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| if (_t312.cls_id == SP_BUILTIN_STR_POLY_HASH) _t313 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t312.v.p, (&("\xff" "comment")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t312.v.p, (&("\xff" "comment")[1])) : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| } | |
| lv_raw_sub = _t313; | |
| sp_RbVal _t314 = lv_raw_sub; | |
| lv_sub = ((_t314.tag == SP_TAG_OBJ && (_t314.cls_id == SP_BUILTIN_STR_INT_HASH || _t314.cls_id == SP_BUILTIN_STR_STR_HASH || _t314.cls_id == SP_BUILTIN_INT_STR_HASH || _t314.cls_id == SP_BUILTIN_SYM_INT_HASH || _t314.cls_id == SP_BUILTIN_SYM_STR_HASH || _t314.cls_id == SP_BUILTIN_STR_POLY_HASH || _t314.cls_id == SP_BUILTIN_SYM_POLY_HASH)) ? lv_raw_sub : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| lv_instance = sp_CommentParams_new(); | |
| sp_RbVal _t315 = lv_sub; | |
| sp_RbVal _t316 = sp_box_nil(); | |
| if (_t315.tag == SP_TAG_OBJ) { | |
| if (_t315.cls_id == 53) _t316 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t315.v.p, (&("\xff" "commenter")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t315.cls_id == 54) _t316 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t315.v.p, (&("\xff" "commenter")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t315.cls_id == SP_BUILTIN_STR_INT_HASH) _t316 = sp_StrIntHash_has_key((sp_StrIntHash *)_t315.v.p, (&("\xff" "commenter")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t315.v.p, (&("\xff" "commenter")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t315.cls_id == SP_BUILTIN_STR_STR_HASH) _t316 = sp_StrStrHash_has_key((sp_StrStrHash *)_t315.v.p, (&("\xff" "commenter")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t315.v.p, (&("\xff" "commenter")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t315.cls_id == SP_BUILTIN_STR_POLY_HASH) _t316 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t315.v.p, (&("\xff" "commenter")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t315.v.p, (&("\xff" "commenter")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_commenter = _t316; | |
| sp_RbVal _t317 = lv_raw_commenter; | |
| sp_CommentParams_commenter_eq(lv_instance, ((_t317.tag == SP_TAG_STR) ? lv_raw_commenter : sp_box_str((&("\xff" "")[1])))); | |
| sp_RbVal _t318 = lv_sub; | |
| sp_RbVal _t319 = sp_box_nil(); | |
| if (_t318.tag == SP_TAG_OBJ) { | |
| if (_t318.cls_id == 53) _t319 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t318.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t318.cls_id == 54) _t319 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t318.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t318.cls_id == SP_BUILTIN_STR_INT_HASH) _t319 = sp_StrIntHash_has_key((sp_StrIntHash *)_t318.v.p, (&("\xff" "body")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t318.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t318.cls_id == SP_BUILTIN_STR_STR_HASH) _t319 = sp_StrStrHash_has_key((sp_StrStrHash *)_t318.v.p, (&("\xff" "body")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t318.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t318.cls_id == SP_BUILTIN_STR_POLY_HASH) _t319 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t318.v.p, (&("\xff" "body")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t318.v.p, (&("\xff" "body")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_body = _t319; | |
| sp_RbVal _t320 = lv_raw_body; | |
| sp_CommentParams_body_eq(lv_instance, ((_t320.tag == SP_TAG_STR) ? lv_raw_body : sp_box_str((&("\xff" "")[1])))); | |
| return (sp_CommentParams *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(CommentsController) | |
| static inline sp_CommentsController *sp_CommentsController_new(void) { | |
| SP_GC_SAVE(); | |
| sp_CommentsController *self = SP_POOL_NEW(CommentsController, sp_CommentsController_gc_scan); | |
| self->cls_id = 71LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = sp_box_nil(); | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| self->iv_article = NULL; | |
| self->iv_comment = NULL; | |
| sp_ActionController_Base_initialize((sp_ActionController_Base *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline mrb_int sp_CommentsController_process_action(sp_CommentsController *self, sp_sym lv_action_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| mrb_int _t321 = lv_action_name; | |
| if (_t321 == SPS_create) { | |
| return sp_CommentsController_create(self); | |
| } else if (_t321 == SPS_destroy) { | |
| return sp_CommentsController_destroy(self); | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_CommentsController_create(sp_CommentsController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t322 = self->iv_params; | |
| sp_RbVal _t323 = sp_box_nil(); | |
| if (_t322.tag == SP_TAG_OBJ) { | |
| if (_t322.cls_id == 53) _t323 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t322.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t322.cls_id == 54) _t323 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t322.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t322.cls_id == SP_BUILTIN_STR_INT_HASH) _t323 = sp_StrIntHash_has_key((sp_StrIntHash *)_t322.v.p, (&("\xff" "article_id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t322.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t322.cls_id == SP_BUILTIN_STR_STR_HASH) _t323 = sp_StrStrHash_has_key((sp_StrStrHash *)_t322.v.p, (&("\xff" "article_id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t322.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t322.cls_id == SP_BUILTIN_STR_POLY_HASH) _t323 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t322.v.p, (&("\xff" "article_id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t322.v.p, (&("\xff" "article_id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t324 = sp_poly_to_s(_t323); | |
| SP_GC_ROOT(_t324); | |
| self->iv_article = sp_Article_cls_find(sp_str_to_i_cruby(_t324)); | |
| self->iv_comment = sp_Comment_cls_from_params(sp_CommentsController_comment_params(self)); | |
| sp_Comment_article_id_eq(self->iv_comment, sp_box_int(self->iv_article->iv_id)); | |
| if (sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self->iv_comment)) { | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path(self->iv_article->iv_id), (&("\xff" "Comment was successfully created.")[1]), NULL, SPS_found); | |
| } else { | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path(self->iv_article->iv_id), NULL, (&("\xff" "Could not create comment.")[1]), SPS_found); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_CommentsController_destroy(sp_CommentsController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t325 = self->iv_params; | |
| sp_RbVal _t326 = sp_box_nil(); | |
| if (_t325.tag == SP_TAG_OBJ) { | |
| if (_t325.cls_id == 53) _t326 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t325.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t325.cls_id == 54) _t326 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t325.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t325.cls_id == SP_BUILTIN_STR_INT_HASH) _t326 = sp_StrIntHash_has_key((sp_StrIntHash *)_t325.v.p, (&("\xff" "article_id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t325.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t325.cls_id == SP_BUILTIN_STR_STR_HASH) _t326 = sp_StrStrHash_has_key((sp_StrStrHash *)_t325.v.p, (&("\xff" "article_id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t325.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t325.cls_id == SP_BUILTIN_STR_POLY_HASH) _t326 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t325.v.p, (&("\xff" "article_id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t325.v.p, (&("\xff" "article_id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t327 = sp_poly_to_s(_t326); | |
| SP_GC_ROOT(_t327); | |
| self->iv_article = sp_Article_cls_find(sp_str_to_i_cruby(_t327)); | |
| sp_RbVal _t328 = self->iv_params; | |
| sp_RbVal _t329 = sp_box_nil(); | |
| if (_t328.tag == SP_TAG_OBJ) { | |
| if (_t328.cls_id == 53) _t329 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t328.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t328.cls_id == 54) _t329 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t328.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t328.cls_id == SP_BUILTIN_STR_INT_HASH) _t329 = sp_StrIntHash_has_key((sp_StrIntHash *)_t328.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t328.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t328.cls_id == SP_BUILTIN_STR_STR_HASH) _t329 = sp_StrStrHash_has_key((sp_StrStrHash *)_t328.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t328.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t328.cls_id == SP_BUILTIN_STR_POLY_HASH) _t329 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t328.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t328.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t330 = sp_poly_to_s(_t329); | |
| SP_GC_ROOT(_t330); | |
| self->iv_comment = sp_Comment_cls_find(sp_str_to_i_cruby(_t330)); | |
| if ((!sp_poly_eq(self->iv_comment->iv_article_id, sp_box_int(self->iv_article->iv_id)))) { | |
| sp_ActionController_Base_head((sp_ActionController_Base *)self, SPS_not_found, NULL); | |
| SP_GC_RESTORE(); | |
| return 0; | |
| } | |
| sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)self->iv_comment); | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path(self->iv_article->iv_id), (&("\xff" "Comment was successfully deleted.")[1]), NULL, SPS_found); | |
| return 0; | |
| } | |
| static inline sp_CommentParams * sp_CommentsController_comment_params(sp_CommentsController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_CommentParams_cls_from_raw(self->iv_params); | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ActionResponse) | |
| static inline sp_ActionResponse *sp_ActionResponse_new(mrb_int lv_status, sp_RbVal lv_body, sp_RbVal lv_location, sp_RbVal lv_flash) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_body); | |
| SP_GC_ROOT_RBVAL(lv_location); | |
| SP_GC_ROOT_RBVAL(lv_flash); | |
| sp_ActionResponse *self = SP_POOL_NEW(ActionResponse, sp_ActionResponse_gc_scan); | |
| self->cls_id = 72LL; | |
| SP_GC_ROOT(self); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = sp_box_nil(); | |
| self->iv_flash = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_body); | |
| SP_GC_ROOT_RBVAL(lv_location); | |
| SP_GC_ROOT_RBVAL(lv_flash); | |
| self->iv_status = lv_status; | |
| self->iv_body = lv_body; | |
| self->iv_location = lv_location; | |
| self->iv_flash = lv_flash; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionResponse_initialize(sp_ActionResponse *self, mrb_int lv_status, sp_RbVal lv_body, sp_RbVal lv_location, sp_RbVal lv_flash) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_body); | |
| SP_GC_ROOT_RBVAL(lv_location); | |
| SP_GC_ROOT_RBVAL(lv_flash); | |
| self->iv_status = lv_status; | |
| self->iv_body = lv_body; | |
| self->iv_location = lv_location; | |
| self->iv_flash = lv_flash; | |
| } | |
| static inline mrb_bool sp_ActionResponse_redirect_p(sp_ActionResponse *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| mrb_bool _t332 = (!sp_poly_nil_p(self->iv_location)); | |
| mrb_bool _t333 = FALSE; | |
| if (_t332) { | |
| _t333 = (self->iv_status >= 300LL); | |
| } else { | |
| _t333 = _t332; | |
| } | |
| mrb_bool _t331 = _t333; | |
| mrb_bool _t334 = FALSE; | |
| if (_t331) { | |
| _t334 = (self->iv_status < 400LL); | |
| } else { | |
| _t334 = _t331; | |
| } | |
| return _t334; | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionResponse_success_p(sp_ActionResponse *self) { | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionResponse_unprocessable_p(sp_ActionResponse *self) { | |
| return FALSE; | |
| } | |
| SP_POOL_DEFINE(TestBase) | |
| static inline sp_TestBase *sp_TestBase_new(void) { | |
| SP_GC_SAVE(); | |
| sp_TestBase *self = SP_POOL_NEW(TestBase, NULL); | |
| self->cls_id = 73LL; | |
| SP_GC_ROOT(self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_TestBase_initialize(sp_TestBase *self) { | |
| } | |
| static inline mrb_bool sp_TestBase_setup(sp_TestBase *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| if ((((const char*)0) != NULL)) { | |
| return sp_SchemaSetup_cls_reset_bang(); | |
| } else { | |
| return FALSE; | |
| } | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_TestBase_teardown(sp_TestBase *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_TestBase_assert_match(sp_TestBase *self, mrb_int lv_pattern, mrb_int lv_value, mrb_int lv_msg) { | |
| (void)lv_pattern; | |
| (void)lv_value; | |
| (void)lv_msg; | |
| return SP_INT_NIL; | |
| } | |
| SP_POOL_DEFINE(ArticlesControllerTest) | |
| static inline sp_ArticlesControllerTest *sp_ArticlesControllerTest_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticlesControllerTest *self = SP_POOL_NEW(ArticlesControllerTest, sp_ArticlesControllerTest_gc_scan); | |
| self->cls_id = 74LL; | |
| SP_GC_ROOT(self); | |
| self->iv___session = NULL; | |
| self->iv___flash = sp_box_nil(); | |
| self->iv___response = NULL; | |
| self->iv_article = NULL; | |
| sp_TestBase_initialize((sp_TestBase *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_get_index(sp_ArticlesControllerTest *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| const char * _t335 = sp_RouteHelpers_cls_articles_path(); | |
| SP_GC_ROOT(_t335); | |
| sp_StrIntHash * _t336 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t336); | |
| sp_ActionDispatch_IntegrationTest_get((sp_ActionDispatch_IntegrationTest *)self, _t335, _t336); | |
| sp_ActionDispatch_IntegrationTest_assert_response((sp_ActionDispatch_IntegrationTest *)self, SPS_success, self->iv___response); | |
| sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "h1")[1]), sp_box_str((&("\xff" "Articles")[1])), ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "#articles")[1]), ((void)(0), sp_box_nil()), ((void)(0), sp_box_nil()), sp_proc_new_meta(_sp_proc_fn_1, NULL, NULL, 0, FALSE, 0, NULL, NULL), NULL, NULL); | |
| return SP_INT_NIL; | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_get_new(sp_ArticlesControllerTest *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| const char * _t337 = sp_RouteHelpers_cls_new_article_path(); | |
| SP_GC_ROOT(_t337); | |
| sp_StrIntHash * _t338 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t338); | |
| sp_ActionDispatch_IntegrationTest_get((sp_ActionDispatch_IntegrationTest *)self, _t337, _t338); | |
| sp_ActionDispatch_IntegrationTest_assert_response((sp_ActionDispatch_IntegrationTest *)self, SPS_success, self->iv___response); | |
| return sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "form")[1]), ((void)(0), sp_box_nil()), ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_create_article(sp_ArticlesControllerTest *self) { | |
| volatile mrb_int lv___diff_before = 0; | |
| volatile mrb_int lv___diff_after = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| lv___diff_before = sp_Article_cls_count(); | |
| const char * _t339 = sp_RouteHelpers_cls_articles_path(); | |
| SP_GC_ROOT(_t339); | |
| sp_SymPolyHash *_t340 = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(_t340); | |
| sp_SymStrHash *_t341 = sp_SymStrHash_new(); | |
| SP_GC_ROOT(_t341); | |
| sp_SymStrHash_set(_t341, SPS_body, (&("\xff" "A sufficiently long body for validation.")[1])); | |
| sp_SymStrHash_set(_t341, SPS_title, (&("\xff" "New Title")[1])); | |
| sp_SymPolyHash_set(_t340, SPS_article, sp_box_obj((void *)(_t341), SP_BUILTIN_SYM_STR_HASH)); | |
| sp_SymPolyHash * _t342 = _t340; | |
| SP_GC_ROOT(_t342); | |
| sp_ActionDispatch_IntegrationTest_post((sp_ActionDispatch_IntegrationTest *)self, _t339, _t342); | |
| lv___diff_after = sp_Article_cls_count(); | |
| if ((sp_int_sub(lv___diff_after, lv___diff_before) != 1LL)) { | |
| sp_raise((&("\xff" "Article.count didn't change by 1")[1])); | |
| } | |
| sp_Article__implicit_6906 * _t343 = sp_Article_cls_last(); | |
| SP_GC_ROOT(_t343); | |
| sp_ActionDispatch_IntegrationTest_assert_redirected_to((sp_ActionDispatch_IntegrationTest *)self, sp_RouteHelpers_cls_article_path(_t343->iv_id), self->iv___response); | |
| sp_Article__implicit_6906 * _t344 = sp_Article_cls_last(); | |
| SP_GC_ROOT(_t344); | |
| if ((!sp_poly_eq(sp_box_str((&("\xff" "New Title")[1])), _t344->iv_title))) { | |
| sp_raise((&("\xff" "assert_equal failed")[1])); | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_not_create_article_with_invalid_params(sp_ArticlesControllerTest *self) { | |
| volatile mrb_int lv___diff_before = 0; | |
| volatile mrb_int lv___diff_after = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| lv___diff_before = sp_Article_cls_count(); | |
| const char * _t345 = sp_RouteHelpers_cls_articles_path(); | |
| SP_GC_ROOT(_t345); | |
| sp_SymPolyHash *_t346 = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(_t346); | |
| sp_SymStrHash *_t347 = sp_SymStrHash_new(); | |
| SP_GC_ROOT(_t347); | |
| sp_SymStrHash_set(_t347, SPS_title, (&("\xff" "")[1])); | |
| sp_SymStrHash_set(_t347, SPS_body, (&("\xff" "")[1])); | |
| sp_SymPolyHash_set(_t346, SPS_article, sp_box_obj((void *)(_t347), SP_BUILTIN_SYM_STR_HASH)); | |
| sp_SymPolyHash * _t348 = _t346; | |
| SP_GC_ROOT(_t348); | |
| sp_ActionDispatch_IntegrationTest_post((sp_ActionDispatch_IntegrationTest *)self, _t345, _t348); | |
| lv___diff_after = sp_Article_cls_count(); | |
| if ((sp_int_sub(lv___diff_after, lv___diff_before) != 0LL)) { | |
| sp_raise((&("\xff" "Article.count didn't change by 0")[1])); | |
| } | |
| return sp_ActionDispatch_IntegrationTest_assert_response((sp_ActionDispatch_IntegrationTest *)self, SPS_unprocessable_entity, self->iv___response); | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_show_article(sp_ArticlesControllerTest *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| const char * _t349 = sp_RouteHelpers_cls_article_path(self->iv_article->iv_id); | |
| SP_GC_ROOT(_t349); | |
| sp_StrIntHash * _t350 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t350); | |
| sp_ActionDispatch_IntegrationTest_get((sp_ActionDispatch_IntegrationTest *)self, _t349, _t350); | |
| sp_ActionDispatch_IntegrationTest_assert_response((sp_ActionDispatch_IntegrationTest *)self, SPS_success, self->iv___response); | |
| sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "h1")[1]), self->iv_article->iv_title, ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "h2")[1]), sp_box_str((&("\xff" "Comments")[1])), ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| return sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "#comments .p-4")[1]), ((void)(0), sp_box_nil()), ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_get_edit(sp_ArticlesControllerTest *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| const char * _t351 = sp_RouteHelpers_cls_edit_article_path(self->iv_article->iv_id); | |
| SP_GC_ROOT(_t351); | |
| sp_StrIntHash * _t352 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t352); | |
| sp_ActionDispatch_IntegrationTest_get((sp_ActionDispatch_IntegrationTest *)self, _t351, _t352); | |
| sp_ActionDispatch_IntegrationTest_assert_response((sp_ActionDispatch_IntegrationTest *)self, SPS_success, self->iv___response); | |
| return sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "form")[1]), ((void)(0), sp_box_nil()), ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_update_article(sp_ArticlesControllerTest *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| const char * _t353 = sp_RouteHelpers_cls_article_path(self->iv_article->iv_id); | |
| SP_GC_ROOT(_t353); | |
| sp_SymPolyHash *_t354 = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(_t354); | |
| sp_SymPolyHash *_t355 = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(_t355); | |
| sp_SymPolyHash_set(_t355, SPS_body, self->iv_article->iv_body); | |
| sp_SymPolyHash_set(_t355, SPS_title, sp_box_str((&("\xff" "Updated Title")[1]))); | |
| sp_SymPolyHash_set(_t354, SPS_article, sp_box_obj((void *)(_t355), SP_BUILTIN_SYM_POLY_HASH)); | |
| sp_SymPolyHash * _t356 = _t354; | |
| SP_GC_ROOT(_t356); | |
| sp_ActionDispatch_IntegrationTest_patch((sp_ActionDispatch_IntegrationTest *)self, _t353, _t356); | |
| sp_ActionDispatch_IntegrationTest_assert_redirected_to((sp_ActionDispatch_IntegrationTest *)self, sp_RouteHelpers_cls_article_path(self->iv_article->iv_id), self->iv___response); | |
| sp_ActiveRecord_Base_reload((sp_ActiveRecord_Base *)self->iv_article); | |
| if ((!sp_poly_eq(sp_box_str((&("\xff" "Updated Title")[1])), self->iv_article->iv_title))) { | |
| sp_raise((&("\xff" "assert_equal failed")[1])); | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_ArticlesControllerTest_test_should_not_update_article_with_invalid_params(sp_ArticlesControllerTest *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| const char * _t357 = sp_RouteHelpers_cls_article_path(self->iv_article->iv_id); | |
| SP_GC_ROOT(_t357); | |
| sp_SymPolyHash *_t358 = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(_t358); | |
| sp_SymStrHash *_t359 = sp_SymStrHash_new(); | |
| SP_GC_ROOT(_t359); | |
| sp_SymStrHash_set(_t359, SPS_title, (&("\xff" "")[1])); | |
| sp_SymStrHash_set(_t359, SPS_body, (&("\xff" "")[1])); | |
| sp_SymPolyHash_set(_t358, SPS_article, sp_box_obj((void *)(_t359), SP_BUILTIN_SYM_STR_HASH)); | |
| sp_SymPolyHash * _t360 = _t358; | |
| SP_GC_ROOT(_t360); | |
| sp_ActionDispatch_IntegrationTest_patch((sp_ActionDispatch_IntegrationTest *)self, _t357, _t360); | |
| return sp_ActionDispatch_IntegrationTest_assert_response((sp_ActionDispatch_IntegrationTest *)self, SPS_unprocessable_entity, self->iv___response); | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ArticlesControllerTest_test_should_destroy_article(sp_ArticlesControllerTest *self) { | |
| volatile mrb_int lv___diff_before = 0; | |
| volatile mrb_int lv___diff_after = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_article = sp_ArticlesFixtures_cls_one(); | |
| lv___diff_before = sp_Article_cls_count(); | |
| const char * _t361 = sp_RouteHelpers_cls_article_path(self->iv_article->iv_id); | |
| SP_GC_ROOT(_t361); | |
| sp_StrIntHash * _t362 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t362); | |
| sp_ActionDispatch_IntegrationTest_delete((sp_ActionDispatch_IntegrationTest *)self, _t361, _t362); | |
| lv___diff_after = sp_Article_cls_count(); | |
| if ((sp_int_sub(lv___diff_after, lv___diff_before) != -1LL)) { | |
| sp_raise((&("\xff" "Article.count didn't change by -1")[1])); | |
| } | |
| return sp_ActionDispatch_IntegrationTest_assert_redirected_to((sp_ActionDispatch_IntegrationTest *)self, sp_RouteHelpers_cls_articles_path(), self->iv___response); | |
| return SP_INT_NIL; | |
| } | |
| SP_POOL_DEFINE(Method) | |
| static inline sp_Method *sp_Method_new(sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_self_obj); | |
| SP_GC_ROOT(lv_name); | |
| sp_Method *self = SP_POOL_NEW(Method, sp_Method_gc_scan); | |
| self->cls_id = 75LL; | |
| SP_GC_ROOT(self); | |
| self->iv_self_obj = NULL; | |
| self->iv_name = NULL; | |
| self->iv_self_obj = lv_self_obj; | |
| self->iv_fn_ptr = lv_fn_ptr; | |
| self->iv_name = lv_name; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Method_initialize(sp_Method *self, sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name) { | |
| } | |
| SP_POOL_DEFINE(Article__implicit_6872) | |
| static inline sp_Article__implicit_6872 *sp_Article__implicit_6872_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_6872 *self = SP_POOL_NEW(Article__implicit_6872, sp_Article__implicit_6872_gc_scan); | |
| self->cls_id = 76LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t363 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t363 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t363 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t363; | |
| mrb_int _t364 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t364 = sp_Article__implicit_6872_created_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t364 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t364; | |
| mrb_int _t365 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t365 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t365 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t365; | |
| mrb_int _t366 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t366 = sp_Article__implicit_6872_updated_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t366 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t366; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_6872_initialize(sp_Article__implicit_6872 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t367 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t367 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t367 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t367; | |
| mrb_int _t368 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t368 = sp_Article__implicit_6872_created_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t368 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t368; | |
| mrb_int _t369 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t369 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t369 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t369; | |
| mrb_int _t370 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t370 = sp_Article__implicit_6872_updated_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t370 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t370; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_id(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_id_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_body(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t371 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t371; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_body_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_created_at(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t372 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t372; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_created_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_title(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t373 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t373; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_title_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_updated_at(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t374 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t374; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_updated_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_6872_assign_from_row(sp_Article__implicit_6872 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_attributes(sp_Article__implicit_6872 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872__aref(sp_Article__implicit_6872 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t375 = lv_name; | |
| if ((_t375.tag == SP_TAG_SYM && _t375.v.i == SPS_id)) { | |
| sp_RbVal _t376 = sp_box_int(self->iv_id); | |
| SP_GC_RESTORE(); | |
| return _t376; | |
| } else if ((_t375.tag == SP_TAG_SYM && _t375.v.i == SPS_body)) { | |
| sp_RbVal _t377 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t377; | |
| } else if ((_t375.tag == SP_TAG_SYM && _t375.v.i == SPS_created_at)) { | |
| sp_RbVal _t378 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t378; | |
| } else if ((_t375.tag == SP_TAG_SYM && _t375.v.i == SPS_title)) { | |
| sp_RbVal _t379 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t379; | |
| } else if ((_t375.tag == SP_TAG_SYM && _t375.v.i == SPS_updated_at)) { | |
| sp_RbVal _t380 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t380; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__aset(sp_Article__implicit_6872 *self, sp_sym lv_name, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| mrb_int _t381 = lv_name; | |
| if (_t381 == SPS_id) { | |
| self->iv_id = sp_str_to_i_cruby(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t381 == SPS_body) { | |
| self->iv_body = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t381 == SPS_created_at) { | |
| self->iv_created_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t381 == SPS_title) { | |
| self->iv_title = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t381 == SPS_updated_at) { | |
| self->iv_updated_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_6872_update(sp_Article__implicit_6872 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t382 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t382); | |
| if ((_t382 == NULL)) { | |
| } else { | |
| mrb_int _t383 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t383 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| default: _t383 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| } | |
| _t383; | |
| } | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| } else { | |
| mrb_int _t384 = 0; | |
| switch (self->cls_id) { | |
| case 76LL: _t384 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| default: _t384 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| } | |
| _t384; | |
| } | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__adapter_insert(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t385 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t385); | |
| const char * _t386 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t386); | |
| const char * _t387 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t387); | |
| const char * _t388 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t388); | |
| const char * _t389 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t389); | |
| const char * _t390 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t390); | |
| const char * _t391 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t391); | |
| const char * _t392 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t392); | |
| const char * _t393 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t393); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t385, _t386, _t387, _t388, _t389, _t390, _t391, _t392, _t393}, 9)); | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__adapter_update(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t394 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t394); | |
| const char * _t395 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t395); | |
| const char * _t396 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t396); | |
| const char * _t397 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t397); | |
| const char * _t398 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t398); | |
| const char * _t399 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t399); | |
| const char * _t400 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t400); | |
| const char * _t401 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t401); | |
| const char * _t402 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t402); | |
| const char * _t403 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t403); | |
| const char * _t404 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t404); | |
| const char * _t405 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t405); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t394, _t395, _t396, _t397, _t398, _t399, _t400, _t401, _t402, _t403, _t404, _t405}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__adapter_delete(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t406 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t406); | |
| const char * _t407 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t407); | |
| const char * _t408 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t408); | |
| const char * _t409 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t409); | |
| return sp_Db_cls_exec(sp_str_concat4(_t406, _t407, _t408, _t409)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_6872__adapter_reload(sp_Article__implicit_6872 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t410 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t410); | |
| const char * _t411 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t411); | |
| const char * _t412 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t412); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t410, _t411, _t412)); | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| self->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL)); | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL)); | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL)); | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL)); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t413 = sp_box_obj(self, 81); | |
| SP_GC_RESTORE(); | |
| return _t413; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_6872_validate(sp_Article__implicit_6872 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t414 = self->iv_title; | |
| mrb_bool _t415 = FALSE; | |
| if (_t414.tag == SP_TAG_STR) _t415 = (sp_str_length(_t414.v.s) == 0); | |
| if (_t414.tag == SP_TAG_OBJ) { | |
| if (_t414.cls_id == 53) _t415 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t414.v.p); | |
| if (_t414.cls_id == 54) _t415 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t414.v.p); | |
| if (_t414.cls_id == SP_BUILTIN_INT_ARRAY) _t415 = (sp_IntArray_length((sp_IntArray *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_FLT_ARRAY) _t415 = (sp_FloatArray_length((sp_FloatArray *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_STR_ARRAY) _t415 = (sp_StrArray_length((sp_StrArray *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_SYM_ARRAY) _t415 = (sp_IntArray_length((sp_IntArray *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_PTR_ARRAY) _t415 = (sp_PtrArray_length((sp_PtrArray *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_POLY_ARRAY) _t415 = (sp_PolyArray_length((sp_PolyArray *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_STR_INT_HASH) _t415 = (sp_StrIntHash_length((sp_StrIntHash *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_STR_STR_HASH) _t415 = (sp_StrStrHash_length((sp_StrStrHash *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_INT_STR_HASH) _t415 = (sp_IntStrHash_length((sp_IntStrHash *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_STR_POLY_HASH) _t415 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t415 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t414.v.p) == 0); | |
| if (_t414.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t415 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t414.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t415)) { | |
| sp_StrArray * _t416 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t416); | |
| sp_StrArray_push(_t416, (&("\xff" "title can't be blank")[1])); | |
| } | |
| sp_RbVal _t417 = self->iv_body; | |
| mrb_bool _t418 = FALSE; | |
| if (_t417.tag == SP_TAG_STR) _t418 = (sp_str_length(_t417.v.s) == 0); | |
| if (_t417.tag == SP_TAG_OBJ) { | |
| if (_t417.cls_id == 53) _t418 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t417.v.p); | |
| if (_t417.cls_id == 54) _t418 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t417.v.p); | |
| if (_t417.cls_id == SP_BUILTIN_INT_ARRAY) _t418 = (sp_IntArray_length((sp_IntArray *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_FLT_ARRAY) _t418 = (sp_FloatArray_length((sp_FloatArray *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_STR_ARRAY) _t418 = (sp_StrArray_length((sp_StrArray *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_SYM_ARRAY) _t418 = (sp_IntArray_length((sp_IntArray *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_PTR_ARRAY) _t418 = (sp_PtrArray_length((sp_PtrArray *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_POLY_ARRAY) _t418 = (sp_PolyArray_length((sp_PolyArray *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_STR_INT_HASH) _t418 = (sp_StrIntHash_length((sp_StrIntHash *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_STR_STR_HASH) _t418 = (sp_StrStrHash_length((sp_StrStrHash *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_INT_STR_HASH) _t418 = (sp_IntStrHash_length((sp_IntStrHash *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_STR_POLY_HASH) _t418 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t418 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t417.v.p) == 0); | |
| if (_t417.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t418 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t417.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t418)) { | |
| sp_StrArray * _t419 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t419); | |
| sp_StrArray_push(_t419, (&("\xff" "body can't be blank")[1])); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| sp_RbVal _t420 = self->iv_body; | |
| mrb_int _t421 = 0; | |
| if (_t420.tag == SP_TAG_STR) _t421 = sp_str_length(_t420.v.s); | |
| if (_t420.tag == SP_TAG_OBJ) { | |
| if (_t420.cls_id == 53) _t421 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t420.v.p); | |
| if (_t420.cls_id == 54) _t421 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_INT_ARRAY) _t421 = sp_IntArray_length((sp_IntArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_FLT_ARRAY) _t421 = sp_FloatArray_length((sp_FloatArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_STR_ARRAY) _t421 = sp_StrArray_length((sp_StrArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_SYM_ARRAY) _t421 = sp_IntArray_length((sp_IntArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_PTR_ARRAY) _t421 = sp_PtrArray_length((sp_PtrArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_POLY_ARRAY) _t421 = sp_PolyArray_length((sp_PolyArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_STR_INT_HASH) _t421 = sp_StrIntHash_length((sp_StrIntHash *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_STR_STR_HASH) _t421 = sp_StrStrHash_length((sp_StrStrHash *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_INT_STR_HASH) _t421 = sp_IntStrHash_length((sp_IntStrHash *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_STR_POLY_HASH) _t421 = sp_StrPolyHash_length((sp_StrPolyHash *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t421 = sp_SymPolyHash_length((sp_SymPolyHash *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t421 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_INT_ARRAY) _t421 = sp_IntArray_length((sp_IntArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_FLT_ARRAY) _t421 = sp_FloatArray_length((sp_FloatArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_STR_ARRAY) _t421 = sp_StrArray_length((sp_StrArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_SYM_ARRAY) _t421 = sp_IntArray_length((sp_IntArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_PTR_ARRAY) _t421 = sp_PtrArray_length((sp_PtrArray *)_t420.v.p); | |
| if (_t420.cls_id == SP_BUILTIN_POLY_ARRAY) _t421 = sp_PolyArray_length((sp_PolyArray *)_t420.v.p); | |
| } | |
| lv_len = _t421; | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t422 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t422); | |
| sp_StrArray_push(_t422, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_6872_comments(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t423 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t423; | |
| } | |
| const char * _t424 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t424); | |
| const char * _t425 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t425); | |
| const char * _t426 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t426); | |
| const char * _t427 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t427); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t424, _t425, _t426, _t427)); | |
| lv_results = sp_IntArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_17: ; | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t428 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t428; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__preload_comments(sp_Article__implicit_6872 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_comments_cache = lv_list; | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_before_destroy(sp_Article__implicit_6872 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t429 = sp_Article__implicit_6872_comments(self); | |
| SP_GC_ROOT_RBVAL(_t429); | |
| if (_t429.tag == SP_TAG_OBJ) { | |
| mrb_int _t430_len = 0; | |
| if (_t429.cls_id == SP_BUILTIN_RANGE) _t430_len = ((sp_Range *)_t429.v.p)->last - ((sp_Range *)_t429.v.p)->first + 1; | |
| else if (_t429.cls_id == SP_BUILTIN_INT_ARRAY) _t430_len = sp_IntArray_length((sp_IntArray *)_t429.v.p); | |
| else if (_t429.cls_id == SP_BUILTIN_FLT_ARRAY) _t430_len = sp_FloatArray_length((sp_FloatArray *)_t429.v.p); | |
| else if (_t429.cls_id == SP_BUILTIN_STR_ARRAY) _t430_len = sp_StrArray_length((sp_StrArray *)_t429.v.p); | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_ARRAY) _t430_len = sp_IntArray_length((sp_IntArray *)_t429.v.p); | |
| else if (_t429.cls_id == SP_BUILTIN_PTR_ARRAY) _t430_len = sp_PtrArray_length((sp_PtrArray *)_t429.v.p); | |
| else if (_t429.cls_id == SP_BUILTIN_POLY_ARRAY) _t430_len = sp_PolyArray_length((sp_PolyArray *)_t429.v.p); | |
| else if (_t429.cls_id == SP_BUILTIN_STR_INT_HASH) _t430_len = ((sp_StrIntHash *)_t429.v.p)->len; | |
| else if (_t429.cls_id == SP_BUILTIN_STR_STR_HASH) _t430_len = ((sp_StrStrHash *)_t429.v.p)->len; | |
| else if (_t429.cls_id == SP_BUILTIN_INT_STR_HASH) _t430_len = ((sp_IntStrHash *)_t429.v.p)->len; | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_INT_HASH) _t430_len = ((sp_SymIntHash *)_t429.v.p)->len; | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_STR_HASH) _t430_len = ((sp_SymStrHash *)_t429.v.p)->len; | |
| else if (_t429.cls_id == SP_BUILTIN_STR_POLY_HASH) _t430_len = ((sp_StrPolyHash *)_t429.v.p)->len; | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t430_len = ((sp_SymPolyHash *)_t429.v.p)->len; | |
| else if (_t429.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t430_len = ((sp_PolyPolyHash *)_t429.v.p)->len; | |
| for (mrb_int _t430 = 0; _t430 < _t430_len; _t430++) { | |
| sp_RbVal _t431 = sp_box_nil(); | |
| if (_t429.cls_id == SP_BUILTIN_RANGE) _t431 = sp_box_int(((sp_Range *)_t429.v.p)->first + _t430); | |
| else if (_t429.cls_id == SP_BUILTIN_INT_ARRAY) _t431 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t429.v.p, _t430)); | |
| else if (_t429.cls_id == SP_BUILTIN_FLT_ARRAY) _t431 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t429.v.p, _t430)); | |
| else if (_t429.cls_id == SP_BUILTIN_STR_ARRAY) _t431 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t429.v.p, _t430)); | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_ARRAY) _t431 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t429.v.p, _t430)); | |
| else if (_t429.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t429.v.p, _t430); _t431 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t429.cls_id == SP_BUILTIN_POLY_ARRAY) _t431 = sp_PolyArray_get((sp_PolyArray *)_t429.v.p, _t430); | |
| else if (_t429.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t429.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t430])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t430]))); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t429.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t429.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t430])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t430]))); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t429.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t429.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t430])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t430]))); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t429.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t430])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t430]))); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t429.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t430])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t430]))); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t429.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t429.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t430])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t430])); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t429.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t429.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t430])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t430])); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t429.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t429.v.p; mrb_int _pk = _sh->order[_t430]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t431 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t431; | |
| sp_redo_18: ; | |
| sp_RbVal _t432 = lv_c; | |
| sp_RbVal _t433 = sp_box_nil(); | |
| if (_t432.tag == SP_TAG_OBJ) { | |
| if (_t432.cls_id == 50) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 63) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 65) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 69) _t433 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t432.v.p)), sp_box_nil()); | |
| if (_t432.cls_id == 71) _t433 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t432.v.p)), sp_box_nil()); | |
| if (_t432.cls_id == 76) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 77) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 78) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 79) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 80) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| if (_t432.cls_id == 81) _t433 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t432.v.p), 50); | |
| } | |
| _t433; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_6872_dom_prefix(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_after_create_commit(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_after_update_commit(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t434 = sp_sprintf("article_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t434); | |
| sp_String * _t435 = sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0); | |
| SP_GC_ROOT(_t435); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t434, _t435); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_after_destroy_commit(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%lld", (long long)self->iv_id)); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_6872_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t436 = sp_IntArray_new(); | |
| sp_IntArray_push(_t436, SPS_id); | |
| sp_IntArray_push(_t436, SPS_body); | |
| sp_IntArray_push(_t436, SPS_created_at); | |
| sp_IntArray_push(_t436, SPS_title); | |
| sp_IntArray_push(_t436, SPS_updated_at); | |
| return _t436; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_6906) | |
| static inline sp_Article__implicit_6906 *sp_Article__implicit_6906_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_6906 *self = SP_POOL_NEW(Article__implicit_6906, sp_Article__implicit_6906_gc_scan); | |
| self->cls_id = 77LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t437 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t437 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t437 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t437; | |
| mrb_int _t438 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t438 = sp_Article__implicit_6906_created_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t438 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t438; | |
| mrb_int _t439 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t439 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t439 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t439; | |
| mrb_int _t440 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t440 = sp_Article__implicit_6906_updated_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t440 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t440; | |
| self->iv_comments_cache = sp_PtrArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_6906_initialize(sp_Article__implicit_6906 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t441 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t441 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t441 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t441; | |
| mrb_int _t442 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t442 = sp_Article__implicit_6906_created_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t442 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t442; | |
| mrb_int _t443 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t443 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t443 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t443; | |
| mrb_int _t444 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t444 = sp_Article__implicit_6906_updated_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t444 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t444; | |
| self->iv_comments_cache = sp_PtrArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_id(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_id_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_body(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t445 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t445; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_body_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_created_at(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t446 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t446; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_created_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_title(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t447 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t447; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_title_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_updated_at(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t448 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t448; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_updated_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_6906_assign_from_row(sp_Article__implicit_6906 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_attributes(sp_Article__implicit_6906 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906__aref(sp_Article__implicit_6906 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t449 = lv_name; | |
| if ((_t449.tag == SP_TAG_SYM && _t449.v.i == SPS_id)) { | |
| sp_RbVal _t450 = sp_box_int(self->iv_id); | |
| SP_GC_RESTORE(); | |
| return _t450; | |
| } else if ((_t449.tag == SP_TAG_SYM && _t449.v.i == SPS_body)) { | |
| sp_RbVal _t451 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t451; | |
| } else if ((_t449.tag == SP_TAG_SYM && _t449.v.i == SPS_created_at)) { | |
| sp_RbVal _t452 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t452; | |
| } else if ((_t449.tag == SP_TAG_SYM && _t449.v.i == SPS_title)) { | |
| sp_RbVal _t453 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t453; | |
| } else if ((_t449.tag == SP_TAG_SYM && _t449.v.i == SPS_updated_at)) { | |
| sp_RbVal _t454 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t454; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__aset(sp_Article__implicit_6906 *self, sp_sym lv_name, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| mrb_int _t455 = lv_name; | |
| if (_t455 == SPS_id) { | |
| self->iv_id = sp_str_to_i_cruby(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t455 == SPS_body) { | |
| self->iv_body = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t455 == SPS_created_at) { | |
| self->iv_created_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t455 == SPS_title) { | |
| self->iv_title = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t455 == SPS_updated_at) { | |
| self->iv_updated_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_6906_update(sp_Article__implicit_6906 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t456 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t456); | |
| if ((_t456 == NULL)) { | |
| } else { | |
| mrb_int _t457 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t457 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| default: _t457 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| } | |
| _t457; | |
| } | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| } else { | |
| mrb_int _t458 = 0; | |
| switch (self->cls_id) { | |
| case 77LL: _t458 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| default: _t458 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| } | |
| _t458; | |
| } | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__adapter_insert(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t459 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t459); | |
| const char * _t460 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t460); | |
| const char * _t461 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t461); | |
| const char * _t462 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t462); | |
| const char * _t463 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t463); | |
| const char * _t464 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t464); | |
| const char * _t465 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t465); | |
| const char * _t466 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t466); | |
| const char * _t467 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t467); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t459, _t460, _t461, _t462, _t463, _t464, _t465, _t466, _t467}, 9)); | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__adapter_update(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t468 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t468); | |
| const char * _t469 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t469); | |
| const char * _t470 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t470); | |
| const char * _t471 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t471); | |
| const char * _t472 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t472); | |
| const char * _t473 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t473); | |
| const char * _t474 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t474); | |
| const char * _t475 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t475); | |
| const char * _t476 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t476); | |
| const char * _t477 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t477); | |
| const char * _t478 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t478); | |
| const char * _t479 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t479); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t468, _t469, _t470, _t471, _t472, _t473, _t474, _t475, _t476, _t477, _t478, _t479}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__adapter_delete(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t480 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t480); | |
| const char * _t481 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t481); | |
| const char * _t482 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t482); | |
| const char * _t483 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t483); | |
| return sp_Db_cls_exec(sp_str_concat4(_t480, _t481, _t482, _t483)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_6906__adapter_reload(sp_Article__implicit_6906 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t484 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t484); | |
| const char * _t485 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t485); | |
| const char * _t486 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t486); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t484, _t485, _t486)); | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| self->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL)); | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL)); | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL)); | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL)); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t487 = sp_box_obj(self, 81); | |
| SP_GC_RESTORE(); | |
| return _t487; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_6906_validate(sp_Article__implicit_6906 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t488 = self->iv_title; | |
| mrb_bool _t489 = FALSE; | |
| if (_t488.tag == SP_TAG_STR) _t489 = (sp_str_length(_t488.v.s) == 0); | |
| if (_t488.tag == SP_TAG_OBJ) { | |
| if (_t488.cls_id == 53) _t489 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t488.v.p); | |
| if (_t488.cls_id == 54) _t489 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t488.v.p); | |
| if (_t488.cls_id == SP_BUILTIN_INT_ARRAY) _t489 = (sp_IntArray_length((sp_IntArray *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_FLT_ARRAY) _t489 = (sp_FloatArray_length((sp_FloatArray *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_STR_ARRAY) _t489 = (sp_StrArray_length((sp_StrArray *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_SYM_ARRAY) _t489 = (sp_IntArray_length((sp_IntArray *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_PTR_ARRAY) _t489 = (sp_PtrArray_length((sp_PtrArray *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_POLY_ARRAY) _t489 = (sp_PolyArray_length((sp_PolyArray *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_STR_INT_HASH) _t489 = (sp_StrIntHash_length((sp_StrIntHash *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_STR_STR_HASH) _t489 = (sp_StrStrHash_length((sp_StrStrHash *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_INT_STR_HASH) _t489 = (sp_IntStrHash_length((sp_IntStrHash *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_STR_POLY_HASH) _t489 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t489 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t488.v.p) == 0); | |
| if (_t488.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t489 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t488.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t489)) { | |
| sp_StrArray * _t490 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t490); | |
| sp_StrArray_push(_t490, (&("\xff" "title can't be blank")[1])); | |
| } | |
| sp_RbVal _t491 = self->iv_body; | |
| mrb_bool _t492 = FALSE; | |
| if (_t491.tag == SP_TAG_STR) _t492 = (sp_str_length(_t491.v.s) == 0); | |
| if (_t491.tag == SP_TAG_OBJ) { | |
| if (_t491.cls_id == 53) _t492 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t491.v.p); | |
| if (_t491.cls_id == 54) _t492 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t491.v.p); | |
| if (_t491.cls_id == SP_BUILTIN_INT_ARRAY) _t492 = (sp_IntArray_length((sp_IntArray *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_FLT_ARRAY) _t492 = (sp_FloatArray_length((sp_FloatArray *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_STR_ARRAY) _t492 = (sp_StrArray_length((sp_StrArray *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_SYM_ARRAY) _t492 = (sp_IntArray_length((sp_IntArray *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_PTR_ARRAY) _t492 = (sp_PtrArray_length((sp_PtrArray *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_POLY_ARRAY) _t492 = (sp_PolyArray_length((sp_PolyArray *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_STR_INT_HASH) _t492 = (sp_StrIntHash_length((sp_StrIntHash *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_STR_STR_HASH) _t492 = (sp_StrStrHash_length((sp_StrStrHash *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_INT_STR_HASH) _t492 = (sp_IntStrHash_length((sp_IntStrHash *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_STR_POLY_HASH) _t492 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t492 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t491.v.p) == 0); | |
| if (_t491.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t492 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t491.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t492)) { | |
| sp_StrArray * _t493 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t493); | |
| sp_StrArray_push(_t493, (&("\xff" "body can't be blank")[1])); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| sp_RbVal _t494 = self->iv_body; | |
| mrb_int _t495 = 0; | |
| if (_t494.tag == SP_TAG_STR) _t495 = sp_str_length(_t494.v.s); | |
| if (_t494.tag == SP_TAG_OBJ) { | |
| if (_t494.cls_id == 53) _t495 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t494.v.p); | |
| if (_t494.cls_id == 54) _t495 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_INT_ARRAY) _t495 = sp_IntArray_length((sp_IntArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_FLT_ARRAY) _t495 = sp_FloatArray_length((sp_FloatArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_STR_ARRAY) _t495 = sp_StrArray_length((sp_StrArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_SYM_ARRAY) _t495 = sp_IntArray_length((sp_IntArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_PTR_ARRAY) _t495 = sp_PtrArray_length((sp_PtrArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_POLY_ARRAY) _t495 = sp_PolyArray_length((sp_PolyArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_STR_INT_HASH) _t495 = sp_StrIntHash_length((sp_StrIntHash *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_STR_STR_HASH) _t495 = sp_StrStrHash_length((sp_StrStrHash *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_INT_STR_HASH) _t495 = sp_IntStrHash_length((sp_IntStrHash *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_STR_POLY_HASH) _t495 = sp_StrPolyHash_length((sp_StrPolyHash *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t495 = sp_SymPolyHash_length((sp_SymPolyHash *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t495 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_INT_ARRAY) _t495 = sp_IntArray_length((sp_IntArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_FLT_ARRAY) _t495 = sp_FloatArray_length((sp_FloatArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_STR_ARRAY) _t495 = sp_StrArray_length((sp_StrArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_SYM_ARRAY) _t495 = sp_IntArray_length((sp_IntArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_PTR_ARRAY) _t495 = sp_PtrArray_length((sp_PtrArray *)_t494.v.p); | |
| if (_t494.cls_id == SP_BUILTIN_POLY_ARRAY) _t495 = sp_PolyArray_length((sp_PolyArray *)_t494.v.p); | |
| } | |
| lv_len = _t495; | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t496 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t496); | |
| sp_StrArray_push(_t496, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_PtrArray * sp_Article__implicit_6906_comments(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| if (self->iv_comments_loaded) { | |
| sp_PtrArray * _t497 = self->iv_comments_cache; | |
| SP_GC_RESTORE(); | |
| return _t497; | |
| } | |
| const char * _t498 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t498); | |
| const char * _t499 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t499); | |
| const char * _t500 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t500); | |
| const char * _t501 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t501); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t498, _t499, _t500, _t501)); | |
| lv_results = sp_IntArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_19: ; | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| return (sp_IntArray *)lv_results; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__preload_comments(sp_Article__implicit_6906 *self, sp_PtrArray * lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_list); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_list); | |
| self->iv_comments_cache = lv_list; | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_before_destroy(sp_Article__implicit_6906 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_PtrArray * _t502 = sp_Article__implicit_6906_comments(self); | |
| SP_GC_ROOT(_t502); | |
| for (mrb_int _t503 = 0; _t503 < sp_PtrArray_length(_t502); _t503++) { | |
| sp_Comment * _t504 = (sp_Comment *)sp_PtrArray_get(_t502, _t503); | |
| lv_c = _t504; | |
| sp_redo_20: ; | |
| sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)lv_c); | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_6906_dom_prefix(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_after_create_commit(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_after_update_commit(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t505 = sp_sprintf("article_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t505); | |
| sp_String * _t506 = sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0); | |
| SP_GC_ROOT(_t506); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t505, _t506); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_after_destroy_commit(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%lld", (long long)self->iv_id)); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_6906_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t507 = sp_IntArray_new(); | |
| sp_IntArray_push(_t507, SPS_id); | |
| sp_IntArray_push(_t507, SPS_body); | |
| sp_IntArray_push(_t507, SPS_created_at); | |
| sp_IntArray_push(_t507, SPS_title); | |
| sp_IntArray_push(_t507, SPS_updated_at); | |
| return _t507; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_7484) | |
| static inline sp_Article__implicit_7484 *sp_Article__implicit_7484_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_7484 *self = SP_POOL_NEW(Article__implicit_7484, sp_Article__implicit_7484_gc_scan); | |
| self->cls_id = 78LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t508 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t508 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t508 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t508; | |
| mrb_int _t509 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t509 = sp_Article__implicit_7484_created_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t509 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t509; | |
| mrb_int _t510 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t510 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t510 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t510; | |
| mrb_int _t511 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t511 = sp_Article__implicit_7484_updated_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t511 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t511; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_7484_initialize(sp_Article__implicit_7484 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t512 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t512 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t512 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t512; | |
| mrb_int _t513 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t513 = sp_Article__implicit_7484_created_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t513 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t513; | |
| mrb_int _t514 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t514 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t514 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t514; | |
| mrb_int _t515 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t515 = sp_Article__implicit_7484_updated_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t515 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t515; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_id(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_id_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_body(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t516 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t516; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_body_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_created_at(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t517 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t517; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_created_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_title(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t518 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t518; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_title_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_updated_at(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t519 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t519; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_updated_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_7484_assign_from_row(sp_Article__implicit_7484 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_attributes(sp_Article__implicit_7484 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484__aref(sp_Article__implicit_7484 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t520 = lv_name; | |
| if ((_t520.tag == SP_TAG_SYM && _t520.v.i == SPS_id)) { | |
| sp_RbVal _t521 = sp_box_int(self->iv_id); | |
| SP_GC_RESTORE(); | |
| return _t521; | |
| } else if ((_t520.tag == SP_TAG_SYM && _t520.v.i == SPS_body)) { | |
| sp_RbVal _t522 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t522; | |
| } else if ((_t520.tag == SP_TAG_SYM && _t520.v.i == SPS_created_at)) { | |
| sp_RbVal _t523 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t523; | |
| } else if ((_t520.tag == SP_TAG_SYM && _t520.v.i == SPS_title)) { | |
| sp_RbVal _t524 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t524; | |
| } else if ((_t520.tag == SP_TAG_SYM && _t520.v.i == SPS_updated_at)) { | |
| sp_RbVal _t525 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t525; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__aset(sp_Article__implicit_7484 *self, sp_sym lv_name, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| mrb_int _t526 = lv_name; | |
| if (_t526 == SPS_id) { | |
| self->iv_id = sp_str_to_i_cruby(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t526 == SPS_body) { | |
| self->iv_body = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t526 == SPS_created_at) { | |
| self->iv_created_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t526 == SPS_title) { | |
| self->iv_title = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t526 == SPS_updated_at) { | |
| self->iv_updated_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_7484_update(sp_Article__implicit_7484 *self, sp_ArticleParams * lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_p); | |
| if (sp_poly_nil_p(lv_p->iv_title)) { | |
| } else { | |
| mrb_int _t527 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t527 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)self, lv_p->iv_title); break; | |
| default: _t527 = sp_Article__implicit_9372_title_eq(self, lv_p->iv_title); break; | |
| } | |
| _t527; | |
| } | |
| if (sp_poly_nil_p(lv_p->iv_body)) { | |
| } else { | |
| mrb_int _t528 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t528 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)self, lv_p->iv_body); break; | |
| default: _t528 = sp_Article__implicit_9372_body_eq(self, lv_p->iv_body); break; | |
| } | |
| _t528; | |
| } | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__adapter_insert(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t529 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t529); | |
| const char * _t530 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t530); | |
| const char * _t531 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t531); | |
| const char * _t532 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t532); | |
| const char * _t533 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t533); | |
| const char * _t534 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t534); | |
| const char * _t535 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t535); | |
| const char * _t536 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t536); | |
| const char * _t537 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t537); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t529, _t530, _t531, _t532, _t533, _t534, _t535, _t536, _t537}, 9)); | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__adapter_update(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t538 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t538); | |
| const char * _t539 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t539); | |
| const char * _t540 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t540); | |
| const char * _t541 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t541); | |
| const char * _t542 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t542); | |
| const char * _t543 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t543); | |
| const char * _t544 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t544); | |
| const char * _t545 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t545); | |
| const char * _t546 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t546); | |
| const char * _t547 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t547); | |
| const char * _t548 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t548); | |
| const char * _t549 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t549); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t538, _t539, _t540, _t541, _t542, _t543, _t544, _t545, _t546, _t547, _t548, _t549}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__adapter_delete(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t550 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t550); | |
| const char * _t551 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t551); | |
| const char * _t552 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t552); | |
| const char * _t553 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t553); | |
| return sp_Db_cls_exec(sp_str_concat4(_t550, _t551, _t552, _t553)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7484__adapter_reload(sp_Article__implicit_7484 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t554 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t554); | |
| const char * _t555 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t555); | |
| const char * _t556 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t556); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t554, _t555, _t556)); | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| self->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL)); | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL)); | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL)); | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL)); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t557 = sp_box_obj(self, 81); | |
| SP_GC_RESTORE(); | |
| return _t557; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_7484_validate(sp_Article__implicit_7484 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t558 = self->iv_title; | |
| mrb_bool _t559 = FALSE; | |
| if (_t558.tag == SP_TAG_STR) _t559 = (sp_str_length(_t558.v.s) == 0); | |
| if (_t558.tag == SP_TAG_OBJ) { | |
| if (_t558.cls_id == 53) _t559 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t558.v.p); | |
| if (_t558.cls_id == 54) _t559 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t558.v.p); | |
| if (_t558.cls_id == SP_BUILTIN_INT_ARRAY) _t559 = (sp_IntArray_length((sp_IntArray *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_FLT_ARRAY) _t559 = (sp_FloatArray_length((sp_FloatArray *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_STR_ARRAY) _t559 = (sp_StrArray_length((sp_StrArray *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_SYM_ARRAY) _t559 = (sp_IntArray_length((sp_IntArray *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_PTR_ARRAY) _t559 = (sp_PtrArray_length((sp_PtrArray *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_POLY_ARRAY) _t559 = (sp_PolyArray_length((sp_PolyArray *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_STR_INT_HASH) _t559 = (sp_StrIntHash_length((sp_StrIntHash *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_STR_STR_HASH) _t559 = (sp_StrStrHash_length((sp_StrStrHash *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_INT_STR_HASH) _t559 = (sp_IntStrHash_length((sp_IntStrHash *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_STR_POLY_HASH) _t559 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t559 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t558.v.p) == 0); | |
| if (_t558.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t559 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t558.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t559)) { | |
| sp_StrArray * _t560 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t560); | |
| sp_StrArray_push(_t560, (&("\xff" "title can't be blank")[1])); | |
| } | |
| sp_RbVal _t561 = self->iv_body; | |
| mrb_bool _t562 = FALSE; | |
| if (_t561.tag == SP_TAG_STR) _t562 = (sp_str_length(_t561.v.s) == 0); | |
| if (_t561.tag == SP_TAG_OBJ) { | |
| if (_t561.cls_id == 53) _t562 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t561.v.p); | |
| if (_t561.cls_id == 54) _t562 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t561.v.p); | |
| if (_t561.cls_id == SP_BUILTIN_INT_ARRAY) _t562 = (sp_IntArray_length((sp_IntArray *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_FLT_ARRAY) _t562 = (sp_FloatArray_length((sp_FloatArray *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_STR_ARRAY) _t562 = (sp_StrArray_length((sp_StrArray *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_SYM_ARRAY) _t562 = (sp_IntArray_length((sp_IntArray *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_PTR_ARRAY) _t562 = (sp_PtrArray_length((sp_PtrArray *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_POLY_ARRAY) _t562 = (sp_PolyArray_length((sp_PolyArray *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_STR_INT_HASH) _t562 = (sp_StrIntHash_length((sp_StrIntHash *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_STR_STR_HASH) _t562 = (sp_StrStrHash_length((sp_StrStrHash *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_INT_STR_HASH) _t562 = (sp_IntStrHash_length((sp_IntStrHash *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_STR_POLY_HASH) _t562 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t562 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t561.v.p) == 0); | |
| if (_t561.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t562 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t561.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t562)) { | |
| sp_StrArray * _t563 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t563); | |
| sp_StrArray_push(_t563, (&("\xff" "body can't be blank")[1])); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| sp_RbVal _t564 = self->iv_body; | |
| mrb_int _t565 = 0; | |
| if (_t564.tag == SP_TAG_STR) _t565 = sp_str_length(_t564.v.s); | |
| if (_t564.tag == SP_TAG_OBJ) { | |
| if (_t564.cls_id == 53) _t565 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t564.v.p); | |
| if (_t564.cls_id == 54) _t565 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_INT_ARRAY) _t565 = sp_IntArray_length((sp_IntArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_FLT_ARRAY) _t565 = sp_FloatArray_length((sp_FloatArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_STR_ARRAY) _t565 = sp_StrArray_length((sp_StrArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_SYM_ARRAY) _t565 = sp_IntArray_length((sp_IntArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_PTR_ARRAY) _t565 = sp_PtrArray_length((sp_PtrArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_POLY_ARRAY) _t565 = sp_PolyArray_length((sp_PolyArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_STR_INT_HASH) _t565 = sp_StrIntHash_length((sp_StrIntHash *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_STR_STR_HASH) _t565 = sp_StrStrHash_length((sp_StrStrHash *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_INT_STR_HASH) _t565 = sp_IntStrHash_length((sp_IntStrHash *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_STR_POLY_HASH) _t565 = sp_StrPolyHash_length((sp_StrPolyHash *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t565 = sp_SymPolyHash_length((sp_SymPolyHash *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t565 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_INT_ARRAY) _t565 = sp_IntArray_length((sp_IntArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_FLT_ARRAY) _t565 = sp_FloatArray_length((sp_FloatArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_STR_ARRAY) _t565 = sp_StrArray_length((sp_StrArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_SYM_ARRAY) _t565 = sp_IntArray_length((sp_IntArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_PTR_ARRAY) _t565 = sp_PtrArray_length((sp_PtrArray *)_t564.v.p); | |
| if (_t564.cls_id == SP_BUILTIN_POLY_ARRAY) _t565 = sp_PolyArray_length((sp_PolyArray *)_t564.v.p); | |
| } | |
| lv_len = _t565; | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t566 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t566); | |
| sp_StrArray_push(_t566, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7484_comments(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t567 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t567; | |
| } | |
| const char * _t568 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t568); | |
| const char * _t569 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t569); | |
| const char * _t570 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t570); | |
| const char * _t571 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t571); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t568, _t569, _t570, _t571)); | |
| lv_results = sp_IntArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_21: ; | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t572 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t572; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__preload_comments(sp_Article__implicit_7484 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_comments_cache = lv_list; | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_before_destroy(sp_Article__implicit_7484 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t573 = sp_Article__implicit_7484_comments(self); | |
| SP_GC_ROOT_RBVAL(_t573); | |
| if (_t573.tag == SP_TAG_OBJ) { | |
| mrb_int _t574_len = 0; | |
| if (_t573.cls_id == SP_BUILTIN_RANGE) _t574_len = ((sp_Range *)_t573.v.p)->last - ((sp_Range *)_t573.v.p)->first + 1; | |
| else if (_t573.cls_id == SP_BUILTIN_INT_ARRAY) _t574_len = sp_IntArray_length((sp_IntArray *)_t573.v.p); | |
| else if (_t573.cls_id == SP_BUILTIN_FLT_ARRAY) _t574_len = sp_FloatArray_length((sp_FloatArray *)_t573.v.p); | |
| else if (_t573.cls_id == SP_BUILTIN_STR_ARRAY) _t574_len = sp_StrArray_length((sp_StrArray *)_t573.v.p); | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_ARRAY) _t574_len = sp_IntArray_length((sp_IntArray *)_t573.v.p); | |
| else if (_t573.cls_id == SP_BUILTIN_PTR_ARRAY) _t574_len = sp_PtrArray_length((sp_PtrArray *)_t573.v.p); | |
| else if (_t573.cls_id == SP_BUILTIN_POLY_ARRAY) _t574_len = sp_PolyArray_length((sp_PolyArray *)_t573.v.p); | |
| else if (_t573.cls_id == SP_BUILTIN_STR_INT_HASH) _t574_len = ((sp_StrIntHash *)_t573.v.p)->len; | |
| else if (_t573.cls_id == SP_BUILTIN_STR_STR_HASH) _t574_len = ((sp_StrStrHash *)_t573.v.p)->len; | |
| else if (_t573.cls_id == SP_BUILTIN_INT_STR_HASH) _t574_len = ((sp_IntStrHash *)_t573.v.p)->len; | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_INT_HASH) _t574_len = ((sp_SymIntHash *)_t573.v.p)->len; | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_STR_HASH) _t574_len = ((sp_SymStrHash *)_t573.v.p)->len; | |
| else if (_t573.cls_id == SP_BUILTIN_STR_POLY_HASH) _t574_len = ((sp_StrPolyHash *)_t573.v.p)->len; | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t574_len = ((sp_SymPolyHash *)_t573.v.p)->len; | |
| else if (_t573.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t574_len = ((sp_PolyPolyHash *)_t573.v.p)->len; | |
| for (mrb_int _t574 = 0; _t574 < _t574_len; _t574++) { | |
| sp_RbVal _t575 = sp_box_nil(); | |
| if (_t573.cls_id == SP_BUILTIN_RANGE) _t575 = sp_box_int(((sp_Range *)_t573.v.p)->first + _t574); | |
| else if (_t573.cls_id == SP_BUILTIN_INT_ARRAY) _t575 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t573.v.p, _t574)); | |
| else if (_t573.cls_id == SP_BUILTIN_FLT_ARRAY) _t575 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t573.v.p, _t574)); | |
| else if (_t573.cls_id == SP_BUILTIN_STR_ARRAY) _t575 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t573.v.p, _t574)); | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_ARRAY) _t575 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t573.v.p, _t574)); | |
| else if (_t573.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t573.v.p, _t574); _t575 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t573.cls_id == SP_BUILTIN_POLY_ARRAY) _t575 = sp_PolyArray_get((sp_PolyArray *)_t573.v.p, _t574); | |
| else if (_t573.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t573.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t574])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t574]))); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t573.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t573.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t574])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t574]))); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t573.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t573.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t574])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t574]))); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t573.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t574])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t574]))); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t573.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t574])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t574]))); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t573.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t573.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t574])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t574])); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t573.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t573.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t574])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t574])); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t573.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t573.v.p; mrb_int _pk = _sh->order[_t574]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t575 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t575; | |
| sp_redo_22: ; | |
| sp_RbVal _t576 = lv_c; | |
| sp_RbVal _t577 = sp_box_nil(); | |
| if (_t576.tag == SP_TAG_OBJ) { | |
| if (_t576.cls_id == 50) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 63) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 65) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 69) _t577 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t576.v.p)), sp_box_nil()); | |
| if (_t576.cls_id == 71) _t577 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t576.v.p)), sp_box_nil()); | |
| if (_t576.cls_id == 76) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 77) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 78) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 79) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 80) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| if (_t576.cls_id == 81) _t577 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t576.v.p), 50); | |
| } | |
| _t577; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_7484_dom_prefix(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_after_create_commit(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_after_update_commit(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t578 = sp_sprintf("article_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t578); | |
| sp_String * _t579 = sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0); | |
| SP_GC_ROOT(_t579); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t578, _t579); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_after_destroy_commit(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%lld", (long long)self->iv_id)); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_7484_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t580 = sp_IntArray_new(); | |
| sp_IntArray_push(_t580, SPS_id); | |
| sp_IntArray_push(_t580, SPS_body); | |
| sp_IntArray_push(_t580, SPS_created_at); | |
| sp_IntArray_push(_t580, SPS_title); | |
| sp_IntArray_push(_t580, SPS_updated_at); | |
| return _t580; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_7995) | |
| static inline sp_Article__implicit_7995 *sp_Article__implicit_7995_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_7995 *self = SP_POOL_NEW(Article__implicit_7995, sp_Article__implicit_7995_gc_scan); | |
| self->cls_id = 79LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t581 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t581 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t581 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t581; | |
| mrb_int _t582 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t582 = sp_Article__implicit_7995_created_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t582 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t582; | |
| mrb_int _t583 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t583 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t583 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t583; | |
| mrb_int _t584 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t584 = sp_Article__implicit_7995_updated_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t584 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t584; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_7995_initialize(sp_Article__implicit_7995 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t585 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t585 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t585 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t585; | |
| mrb_int _t586 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t586 = sp_Article__implicit_7995_created_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t586 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t586; | |
| mrb_int _t587 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t587 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t587 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t587; | |
| mrb_int _t588 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t588 = sp_Article__implicit_7995_updated_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t588 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t588; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_id(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_id_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_body(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t589 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t589; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_body_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_created_at(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t590 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t590; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_created_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_title(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t591 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t591; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_title_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_updated_at(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t592 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t592; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_updated_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_7995_assign_from_row(sp_Article__implicit_7995 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_attributes(sp_Article__implicit_7995 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995__aref(sp_Article__implicit_7995 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t593 = lv_name; | |
| if ((_t593.tag == SP_TAG_SYM && _t593.v.i == SPS_id)) { | |
| sp_RbVal _t594 = sp_box_int(self->iv_id); | |
| SP_GC_RESTORE(); | |
| return _t594; | |
| } else if ((_t593.tag == SP_TAG_SYM && _t593.v.i == SPS_body)) { | |
| sp_RbVal _t595 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t595; | |
| } else if ((_t593.tag == SP_TAG_SYM && _t593.v.i == SPS_created_at)) { | |
| sp_RbVal _t596 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t596; | |
| } else if ((_t593.tag == SP_TAG_SYM && _t593.v.i == SPS_title)) { | |
| sp_RbVal _t597 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t597; | |
| } else if ((_t593.tag == SP_TAG_SYM && _t593.v.i == SPS_updated_at)) { | |
| sp_RbVal _t598 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t598; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__aset(sp_Article__implicit_7995 *self, sp_sym lv_name, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| mrb_int _t599 = lv_name; | |
| if (_t599 == SPS_id) { | |
| self->iv_id = sp_str_to_i_cruby(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t599 == SPS_body) { | |
| self->iv_body = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t599 == SPS_created_at) { | |
| self->iv_created_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t599 == SPS_title) { | |
| self->iv_title = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t599 == SPS_updated_at) { | |
| self->iv_updated_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_7995_update(sp_Article__implicit_7995 *self, sp_ArticleParams * lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_p); | |
| if (sp_poly_nil_p(lv_p->iv_title)) { | |
| } else { | |
| mrb_int _t600 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t600 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)self, lv_p->iv_title); break; | |
| default: _t600 = sp_Article__implicit_9372_title_eq(self, lv_p->iv_title); break; | |
| } | |
| _t600; | |
| } | |
| if (sp_poly_nil_p(lv_p->iv_body)) { | |
| } else { | |
| mrb_int _t601 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t601 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)self, lv_p->iv_body); break; | |
| default: _t601 = sp_Article__implicit_9372_body_eq(self, lv_p->iv_body); break; | |
| } | |
| _t601; | |
| } | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__adapter_insert(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t602 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t602); | |
| const char * _t603 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t603); | |
| const char * _t604 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t604); | |
| const char * _t605 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t605); | |
| const char * _t606 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t606); | |
| const char * _t607 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t607); | |
| const char * _t608 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t608); | |
| const char * _t609 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t609); | |
| const char * _t610 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t610); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t602, _t603, _t604, _t605, _t606, _t607, _t608, _t609, _t610}, 9)); | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__adapter_update(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t611 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t611); | |
| const char * _t612 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t612); | |
| const char * _t613 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t613); | |
| const char * _t614 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t614); | |
| const char * _t615 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t615); | |
| const char * _t616 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t616); | |
| const char * _t617 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t617); | |
| const char * _t618 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t618); | |
| const char * _t619 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t619); | |
| const char * _t620 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t620); | |
| const char * _t621 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t621); | |
| const char * _t622 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t622); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t611, _t612, _t613, _t614, _t615, _t616, _t617, _t618, _t619, _t620, _t621, _t622}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__adapter_delete(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t623 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t623); | |
| const char * _t624 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t624); | |
| const char * _t625 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t625); | |
| const char * _t626 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t626); | |
| return sp_Db_cls_exec(sp_str_concat4(_t623, _t624, _t625, _t626)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7995__adapter_reload(sp_Article__implicit_7995 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t627 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t627); | |
| const char * _t628 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t628); | |
| const char * _t629 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t629); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t627, _t628, _t629)); | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| self->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL)); | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL)); | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL)); | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL)); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t630 = sp_box_obj(self, 81); | |
| SP_GC_RESTORE(); | |
| return _t630; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_7995_validate(sp_Article__implicit_7995 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t631 = self->iv_title; | |
| mrb_bool _t632 = FALSE; | |
| if (_t631.tag == SP_TAG_STR) _t632 = (sp_str_length(_t631.v.s) == 0); | |
| if (_t631.tag == SP_TAG_OBJ) { | |
| if (_t631.cls_id == 53) _t632 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t631.v.p); | |
| if (_t631.cls_id == 54) _t632 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t631.v.p); | |
| if (_t631.cls_id == SP_BUILTIN_INT_ARRAY) _t632 = (sp_IntArray_length((sp_IntArray *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_FLT_ARRAY) _t632 = (sp_FloatArray_length((sp_FloatArray *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_STR_ARRAY) _t632 = (sp_StrArray_length((sp_StrArray *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_SYM_ARRAY) _t632 = (sp_IntArray_length((sp_IntArray *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_PTR_ARRAY) _t632 = (sp_PtrArray_length((sp_PtrArray *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_POLY_ARRAY) _t632 = (sp_PolyArray_length((sp_PolyArray *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_STR_INT_HASH) _t632 = (sp_StrIntHash_length((sp_StrIntHash *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_STR_STR_HASH) _t632 = (sp_StrStrHash_length((sp_StrStrHash *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_INT_STR_HASH) _t632 = (sp_IntStrHash_length((sp_IntStrHash *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_STR_POLY_HASH) _t632 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t632 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t631.v.p) == 0); | |
| if (_t631.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t632 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t631.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t632)) { | |
| sp_StrArray * _t633 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t633); | |
| sp_StrArray_push(_t633, (&("\xff" "title can't be blank")[1])); | |
| } | |
| sp_RbVal _t634 = self->iv_body; | |
| mrb_bool _t635 = FALSE; | |
| if (_t634.tag == SP_TAG_STR) _t635 = (sp_str_length(_t634.v.s) == 0); | |
| if (_t634.tag == SP_TAG_OBJ) { | |
| if (_t634.cls_id == 53) _t635 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t634.v.p); | |
| if (_t634.cls_id == 54) _t635 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t634.v.p); | |
| if (_t634.cls_id == SP_BUILTIN_INT_ARRAY) _t635 = (sp_IntArray_length((sp_IntArray *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_FLT_ARRAY) _t635 = (sp_FloatArray_length((sp_FloatArray *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_STR_ARRAY) _t635 = (sp_StrArray_length((sp_StrArray *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_SYM_ARRAY) _t635 = (sp_IntArray_length((sp_IntArray *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_PTR_ARRAY) _t635 = (sp_PtrArray_length((sp_PtrArray *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_POLY_ARRAY) _t635 = (sp_PolyArray_length((sp_PolyArray *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_STR_INT_HASH) _t635 = (sp_StrIntHash_length((sp_StrIntHash *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_STR_STR_HASH) _t635 = (sp_StrStrHash_length((sp_StrStrHash *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_INT_STR_HASH) _t635 = (sp_IntStrHash_length((sp_IntStrHash *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_STR_POLY_HASH) _t635 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t635 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t634.v.p) == 0); | |
| if (_t634.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t635 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t634.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t635)) { | |
| sp_StrArray * _t636 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t636); | |
| sp_StrArray_push(_t636, (&("\xff" "body can't be blank")[1])); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| sp_RbVal _t637 = self->iv_body; | |
| mrb_int _t638 = 0; | |
| if (_t637.tag == SP_TAG_STR) _t638 = sp_str_length(_t637.v.s); | |
| if (_t637.tag == SP_TAG_OBJ) { | |
| if (_t637.cls_id == 53) _t638 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t637.v.p); | |
| if (_t637.cls_id == 54) _t638 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_INT_ARRAY) _t638 = sp_IntArray_length((sp_IntArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_FLT_ARRAY) _t638 = sp_FloatArray_length((sp_FloatArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_STR_ARRAY) _t638 = sp_StrArray_length((sp_StrArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_SYM_ARRAY) _t638 = sp_IntArray_length((sp_IntArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_PTR_ARRAY) _t638 = sp_PtrArray_length((sp_PtrArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_POLY_ARRAY) _t638 = sp_PolyArray_length((sp_PolyArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_STR_INT_HASH) _t638 = sp_StrIntHash_length((sp_StrIntHash *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_STR_STR_HASH) _t638 = sp_StrStrHash_length((sp_StrStrHash *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_INT_STR_HASH) _t638 = sp_IntStrHash_length((sp_IntStrHash *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_STR_POLY_HASH) _t638 = sp_StrPolyHash_length((sp_StrPolyHash *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t638 = sp_SymPolyHash_length((sp_SymPolyHash *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t638 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_INT_ARRAY) _t638 = sp_IntArray_length((sp_IntArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_FLT_ARRAY) _t638 = sp_FloatArray_length((sp_FloatArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_STR_ARRAY) _t638 = sp_StrArray_length((sp_StrArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_SYM_ARRAY) _t638 = sp_IntArray_length((sp_IntArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_PTR_ARRAY) _t638 = sp_PtrArray_length((sp_PtrArray *)_t637.v.p); | |
| if (_t637.cls_id == SP_BUILTIN_POLY_ARRAY) _t638 = sp_PolyArray_length((sp_PolyArray *)_t637.v.p); | |
| } | |
| lv_len = _t638; | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t639 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t639); | |
| sp_StrArray_push(_t639, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7995_comments(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t640 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t640; | |
| } | |
| const char * _t641 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t641); | |
| const char * _t642 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t642); | |
| const char * _t643 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t643); | |
| const char * _t644 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t644); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t641, _t642, _t643, _t644)); | |
| lv_results = sp_IntArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_23: ; | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t645 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t645; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__preload_comments(sp_Article__implicit_7995 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_comments_cache = lv_list; | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_before_destroy(sp_Article__implicit_7995 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t646 = sp_Article__implicit_7995_comments(self); | |
| SP_GC_ROOT_RBVAL(_t646); | |
| if (_t646.tag == SP_TAG_OBJ) { | |
| mrb_int _t647_len = 0; | |
| if (_t646.cls_id == SP_BUILTIN_RANGE) _t647_len = ((sp_Range *)_t646.v.p)->last - ((sp_Range *)_t646.v.p)->first + 1; | |
| else if (_t646.cls_id == SP_BUILTIN_INT_ARRAY) _t647_len = sp_IntArray_length((sp_IntArray *)_t646.v.p); | |
| else if (_t646.cls_id == SP_BUILTIN_FLT_ARRAY) _t647_len = sp_FloatArray_length((sp_FloatArray *)_t646.v.p); | |
| else if (_t646.cls_id == SP_BUILTIN_STR_ARRAY) _t647_len = sp_StrArray_length((sp_StrArray *)_t646.v.p); | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_ARRAY) _t647_len = sp_IntArray_length((sp_IntArray *)_t646.v.p); | |
| else if (_t646.cls_id == SP_BUILTIN_PTR_ARRAY) _t647_len = sp_PtrArray_length((sp_PtrArray *)_t646.v.p); | |
| else if (_t646.cls_id == SP_BUILTIN_POLY_ARRAY) _t647_len = sp_PolyArray_length((sp_PolyArray *)_t646.v.p); | |
| else if (_t646.cls_id == SP_BUILTIN_STR_INT_HASH) _t647_len = ((sp_StrIntHash *)_t646.v.p)->len; | |
| else if (_t646.cls_id == SP_BUILTIN_STR_STR_HASH) _t647_len = ((sp_StrStrHash *)_t646.v.p)->len; | |
| else if (_t646.cls_id == SP_BUILTIN_INT_STR_HASH) _t647_len = ((sp_IntStrHash *)_t646.v.p)->len; | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_INT_HASH) _t647_len = ((sp_SymIntHash *)_t646.v.p)->len; | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_STR_HASH) _t647_len = ((sp_SymStrHash *)_t646.v.p)->len; | |
| else if (_t646.cls_id == SP_BUILTIN_STR_POLY_HASH) _t647_len = ((sp_StrPolyHash *)_t646.v.p)->len; | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t647_len = ((sp_SymPolyHash *)_t646.v.p)->len; | |
| else if (_t646.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t647_len = ((sp_PolyPolyHash *)_t646.v.p)->len; | |
| for (mrb_int _t647 = 0; _t647 < _t647_len; _t647++) { | |
| sp_RbVal _t648 = sp_box_nil(); | |
| if (_t646.cls_id == SP_BUILTIN_RANGE) _t648 = sp_box_int(((sp_Range *)_t646.v.p)->first + _t647); | |
| else if (_t646.cls_id == SP_BUILTIN_INT_ARRAY) _t648 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t646.v.p, _t647)); | |
| else if (_t646.cls_id == SP_BUILTIN_FLT_ARRAY) _t648 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t646.v.p, _t647)); | |
| else if (_t646.cls_id == SP_BUILTIN_STR_ARRAY) _t648 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t646.v.p, _t647)); | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_ARRAY) _t648 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t646.v.p, _t647)); | |
| else if (_t646.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t646.v.p, _t647); _t648 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t646.cls_id == SP_BUILTIN_POLY_ARRAY) _t648 = sp_PolyArray_get((sp_PolyArray *)_t646.v.p, _t647); | |
| else if (_t646.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t646.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t647])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t647]))); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t646.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t646.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t647])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t647]))); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t646.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t646.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t647])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t647]))); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t646.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t647])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t647]))); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t646.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t647])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t647]))); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t646.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t646.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t647])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t647])); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t646.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t646.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t647])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t647])); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t646.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t646.v.p; mrb_int _pk = _sh->order[_t647]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t648 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t648; | |
| sp_redo_24: ; | |
| sp_RbVal _t649 = lv_c; | |
| sp_RbVal _t650 = sp_box_nil(); | |
| if (_t649.tag == SP_TAG_OBJ) { | |
| if (_t649.cls_id == 50) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 63) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 65) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 69) _t650 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t649.v.p)), sp_box_nil()); | |
| if (_t649.cls_id == 71) _t650 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t649.v.p)), sp_box_nil()); | |
| if (_t649.cls_id == 76) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 77) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 78) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 79) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 80) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| if (_t649.cls_id == 81) _t650 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t649.v.p), 50); | |
| } | |
| _t650; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_7995_dom_prefix(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_after_create_commit(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_after_update_commit(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t651 = sp_sprintf("article_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t651); | |
| sp_String * _t652 = sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0); | |
| SP_GC_ROOT(_t652); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t651, _t652); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_after_destroy_commit(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%lld", (long long)self->iv_id)); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_7995_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t653 = sp_IntArray_new(); | |
| sp_IntArray_push(_t653, SPS_id); | |
| sp_IntArray_push(_t653, SPS_body); | |
| sp_IntArray_push(_t653, SPS_created_at); | |
| sp_IntArray_push(_t653, SPS_title); | |
| sp_IntArray_push(_t653, SPS_updated_at); | |
| return _t653; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_9355) | |
| static inline sp_Article__implicit_9355 *sp_Article__implicit_9355_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_9355 *self = SP_POOL_NEW(Article__implicit_9355, sp_Article__implicit_9355_gc_scan); | |
| self->cls_id = 80LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t654 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t654 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t654 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t654; | |
| mrb_int _t655 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t655 = sp_Article__implicit_9355_created_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t655 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t655; | |
| mrb_int _t656 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t656 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t656 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t656; | |
| mrb_int _t657 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t657 = sp_Article__implicit_9355_updated_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t657 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t657; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_9355_initialize(sp_Article__implicit_9355 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| mrb_int _t658 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t658 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t658 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t658; | |
| mrb_int _t659 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t659 = sp_Article__implicit_9355_created_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t659 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t659; | |
| mrb_int _t660 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t660 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t660 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t660; | |
| mrb_int _t661 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t661 = sp_Article__implicit_9355_updated_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t661 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t661; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_id(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_id_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_body(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t662 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t662; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_body_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_created_at(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t663 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t663; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_created_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_title(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t664 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t664; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_title_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_updated_at(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t665 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t665; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_updated_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_9355_assign_from_row(sp_Article__implicit_9355 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_attributes(sp_Article__implicit_9355 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355__aref(sp_Article__implicit_9355 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t666 = lv_name; | |
| if ((_t666.tag == SP_TAG_SYM && _t666.v.i == SPS_id)) { | |
| sp_RbVal _t667 = sp_box_int(self->iv_id); | |
| SP_GC_RESTORE(); | |
| return _t667; | |
| } else if ((_t666.tag == SP_TAG_SYM && _t666.v.i == SPS_body)) { | |
| sp_RbVal _t668 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t668; | |
| } else if ((_t666.tag == SP_TAG_SYM && _t666.v.i == SPS_created_at)) { | |
| sp_RbVal _t669 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t669; | |
| } else if ((_t666.tag == SP_TAG_SYM && _t666.v.i == SPS_title)) { | |
| sp_RbVal _t670 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t670; | |
| } else if ((_t666.tag == SP_TAG_SYM && _t666.v.i == SPS_updated_at)) { | |
| sp_RbVal _t671 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t671; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__aset(sp_Article__implicit_9355 *self, sp_sym lv_name, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| mrb_int _t672 = lv_name; | |
| if (_t672 == SPS_id) { | |
| self->iv_id = sp_str_to_i_cruby(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t672 == SPS_body) { | |
| self->iv_body = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t672 == SPS_created_at) { | |
| self->iv_created_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t672 == SPS_title) { | |
| self->iv_title = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t672 == SPS_updated_at) { | |
| self->iv_updated_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_9355_update(sp_Article__implicit_9355 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t673 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t673); | |
| if ((_t673 == NULL)) { | |
| } else { | |
| mrb_int _t674 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t674 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| default: _t674 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| } | |
| _t674; | |
| } | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| } else { | |
| mrb_int _t675 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t675 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| default: _t675 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| } | |
| _t675; | |
| } | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__adapter_insert(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t676 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t676); | |
| const char * _t677 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t677); | |
| const char * _t678 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t678); | |
| const char * _t679 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t679); | |
| const char * _t680 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t680); | |
| const char * _t681 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t681); | |
| const char * _t682 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t682); | |
| const char * _t683 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t683); | |
| const char * _t684 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t684); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t676, _t677, _t678, _t679, _t680, _t681, _t682, _t683, _t684}, 9)); | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__adapter_update(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t685 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t685); | |
| const char * _t686 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t686); | |
| const char * _t687 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t687); | |
| const char * _t688 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t688); | |
| const char * _t689 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t689); | |
| const char * _t690 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t690); | |
| const char * _t691 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t691); | |
| const char * _t692 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t692); | |
| const char * _t693 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t693); | |
| const char * _t694 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t694); | |
| const char * _t695 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t695); | |
| const char * _t696 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t696); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t685, _t686, _t687, _t688, _t689, _t690, _t691, _t692, _t693, _t694, _t695, _t696}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__adapter_delete(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t697 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t697); | |
| const char * _t698 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t698); | |
| const char * _t699 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t699); | |
| const char * _t700 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t700); | |
| return sp_Db_cls_exec(sp_str_concat4(_t697, _t698, _t699, _t700)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9355__adapter_reload(sp_Article__implicit_9355 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t701 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t701); | |
| const char * _t702 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t702); | |
| const char * _t703 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t703); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t701, _t702, _t703)); | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| self->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL)); | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL)); | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL)); | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL)); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t704 = sp_box_obj(self, 81); | |
| SP_GC_RESTORE(); | |
| return _t704; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_9355_validate(sp_Article__implicit_9355 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t705 = self->iv_title; | |
| mrb_bool _t706 = FALSE; | |
| if (_t705.tag == SP_TAG_STR) _t706 = (sp_str_length(_t705.v.s) == 0); | |
| if (_t705.tag == SP_TAG_OBJ) { | |
| if (_t705.cls_id == 53) _t706 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t705.v.p); | |
| if (_t705.cls_id == 54) _t706 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_INT_ARRAY) _t706 = (sp_IntArray_length((sp_IntArray *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_FLT_ARRAY) _t706 = (sp_FloatArray_length((sp_FloatArray *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_STR_ARRAY) _t706 = (sp_StrArray_length((sp_StrArray *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_SYM_ARRAY) _t706 = (sp_IntArray_length((sp_IntArray *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_PTR_ARRAY) _t706 = (sp_PtrArray_length((sp_PtrArray *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_POLY_ARRAY) _t706 = (sp_PolyArray_length((sp_PolyArray *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_STR_INT_HASH) _t706 = (sp_StrIntHash_length((sp_StrIntHash *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_STR_STR_HASH) _t706 = (sp_StrStrHash_length((sp_StrStrHash *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_INT_STR_HASH) _t706 = (sp_IntStrHash_length((sp_IntStrHash *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_STR_POLY_HASH) _t706 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t706 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t705.v.p) == 0); | |
| if (_t705.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t706 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t705.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t706)) { | |
| sp_StrArray * _t707 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t707); | |
| sp_StrArray_push(_t707, (&("\xff" "title can't be blank")[1])); | |
| } | |
| sp_RbVal _t708 = self->iv_body; | |
| mrb_bool _t709 = FALSE; | |
| if (_t708.tag == SP_TAG_STR) _t709 = (sp_str_length(_t708.v.s) == 0); | |
| if (_t708.tag == SP_TAG_OBJ) { | |
| if (_t708.cls_id == 53) _t709 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t708.v.p); | |
| if (_t708.cls_id == 54) _t709 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t708.v.p); | |
| if (_t708.cls_id == SP_BUILTIN_INT_ARRAY) _t709 = (sp_IntArray_length((sp_IntArray *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_FLT_ARRAY) _t709 = (sp_FloatArray_length((sp_FloatArray *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_STR_ARRAY) _t709 = (sp_StrArray_length((sp_StrArray *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_SYM_ARRAY) _t709 = (sp_IntArray_length((sp_IntArray *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_PTR_ARRAY) _t709 = (sp_PtrArray_length((sp_PtrArray *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_POLY_ARRAY) _t709 = (sp_PolyArray_length((sp_PolyArray *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_STR_INT_HASH) _t709 = (sp_StrIntHash_length((sp_StrIntHash *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_STR_STR_HASH) _t709 = (sp_StrStrHash_length((sp_StrStrHash *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_INT_STR_HASH) _t709 = (sp_IntStrHash_length((sp_IntStrHash *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_STR_POLY_HASH) _t709 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t709 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t708.v.p) == 0); | |
| if (_t708.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t709 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t708.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t709)) { | |
| sp_StrArray * _t710 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t710); | |
| sp_StrArray_push(_t710, (&("\xff" "body can't be blank")[1])); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| sp_RbVal _t711 = self->iv_body; | |
| mrb_int _t712 = 0; | |
| if (_t711.tag == SP_TAG_STR) _t712 = sp_str_length(_t711.v.s); | |
| if (_t711.tag == SP_TAG_OBJ) { | |
| if (_t711.cls_id == 53) _t712 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t711.v.p); | |
| if (_t711.cls_id == 54) _t712 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_INT_ARRAY) _t712 = sp_IntArray_length((sp_IntArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_FLT_ARRAY) _t712 = sp_FloatArray_length((sp_FloatArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_STR_ARRAY) _t712 = sp_StrArray_length((sp_StrArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_SYM_ARRAY) _t712 = sp_IntArray_length((sp_IntArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_PTR_ARRAY) _t712 = sp_PtrArray_length((sp_PtrArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_POLY_ARRAY) _t712 = sp_PolyArray_length((sp_PolyArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_STR_INT_HASH) _t712 = sp_StrIntHash_length((sp_StrIntHash *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_STR_STR_HASH) _t712 = sp_StrStrHash_length((sp_StrStrHash *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_INT_STR_HASH) _t712 = sp_IntStrHash_length((sp_IntStrHash *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_STR_POLY_HASH) _t712 = sp_StrPolyHash_length((sp_StrPolyHash *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t712 = sp_SymPolyHash_length((sp_SymPolyHash *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t712 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_INT_ARRAY) _t712 = sp_IntArray_length((sp_IntArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_FLT_ARRAY) _t712 = sp_FloatArray_length((sp_FloatArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_STR_ARRAY) _t712 = sp_StrArray_length((sp_StrArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_SYM_ARRAY) _t712 = sp_IntArray_length((sp_IntArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_PTR_ARRAY) _t712 = sp_PtrArray_length((sp_PtrArray *)_t711.v.p); | |
| if (_t711.cls_id == SP_BUILTIN_POLY_ARRAY) _t712 = sp_PolyArray_length((sp_PolyArray *)_t711.v.p); | |
| } | |
| lv_len = _t712; | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t713 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t713); | |
| sp_StrArray_push(_t713, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9355_comments(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t714 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t714; | |
| } | |
| const char * _t715 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t715); | |
| const char * _t716 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t716); | |
| const char * _t717 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t717); | |
| const char * _t718 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t718); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t715, _t716, _t717, _t718)); | |
| lv_results = sp_IntArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_25: ; | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t719 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t719; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__preload_comments(sp_Article__implicit_9355 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_comments_cache = lv_list; | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_before_destroy(sp_Article__implicit_9355 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t720 = sp_Article__implicit_9355_comments(self); | |
| SP_GC_ROOT_RBVAL(_t720); | |
| if (_t720.tag == SP_TAG_OBJ) { | |
| mrb_int _t721_len = 0; | |
| if (_t720.cls_id == SP_BUILTIN_RANGE) _t721_len = ((sp_Range *)_t720.v.p)->last - ((sp_Range *)_t720.v.p)->first + 1; | |
| else if (_t720.cls_id == SP_BUILTIN_INT_ARRAY) _t721_len = sp_IntArray_length((sp_IntArray *)_t720.v.p); | |
| else if (_t720.cls_id == SP_BUILTIN_FLT_ARRAY) _t721_len = sp_FloatArray_length((sp_FloatArray *)_t720.v.p); | |
| else if (_t720.cls_id == SP_BUILTIN_STR_ARRAY) _t721_len = sp_StrArray_length((sp_StrArray *)_t720.v.p); | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_ARRAY) _t721_len = sp_IntArray_length((sp_IntArray *)_t720.v.p); | |
| else if (_t720.cls_id == SP_BUILTIN_PTR_ARRAY) _t721_len = sp_PtrArray_length((sp_PtrArray *)_t720.v.p); | |
| else if (_t720.cls_id == SP_BUILTIN_POLY_ARRAY) _t721_len = sp_PolyArray_length((sp_PolyArray *)_t720.v.p); | |
| else if (_t720.cls_id == SP_BUILTIN_STR_INT_HASH) _t721_len = ((sp_StrIntHash *)_t720.v.p)->len; | |
| else if (_t720.cls_id == SP_BUILTIN_STR_STR_HASH) _t721_len = ((sp_StrStrHash *)_t720.v.p)->len; | |
| else if (_t720.cls_id == SP_BUILTIN_INT_STR_HASH) _t721_len = ((sp_IntStrHash *)_t720.v.p)->len; | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_INT_HASH) _t721_len = ((sp_SymIntHash *)_t720.v.p)->len; | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_STR_HASH) _t721_len = ((sp_SymStrHash *)_t720.v.p)->len; | |
| else if (_t720.cls_id == SP_BUILTIN_STR_POLY_HASH) _t721_len = ((sp_StrPolyHash *)_t720.v.p)->len; | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t721_len = ((sp_SymPolyHash *)_t720.v.p)->len; | |
| else if (_t720.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t721_len = ((sp_PolyPolyHash *)_t720.v.p)->len; | |
| for (mrb_int _t721 = 0; _t721 < _t721_len; _t721++) { | |
| sp_RbVal _t722 = sp_box_nil(); | |
| if (_t720.cls_id == SP_BUILTIN_RANGE) _t722 = sp_box_int(((sp_Range *)_t720.v.p)->first + _t721); | |
| else if (_t720.cls_id == SP_BUILTIN_INT_ARRAY) _t722 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t720.v.p, _t721)); | |
| else if (_t720.cls_id == SP_BUILTIN_FLT_ARRAY) _t722 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t720.v.p, _t721)); | |
| else if (_t720.cls_id == SP_BUILTIN_STR_ARRAY) _t722 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t720.v.p, _t721)); | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_ARRAY) _t722 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t720.v.p, _t721)); | |
| else if (_t720.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t720.v.p, _t721); _t722 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t720.cls_id == SP_BUILTIN_POLY_ARRAY) _t722 = sp_PolyArray_get((sp_PolyArray *)_t720.v.p, _t721); | |
| else if (_t720.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t720.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t721])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t721]))); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t720.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t720.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t721])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t721]))); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t720.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t720.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t721])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t721]))); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t720.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t721])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t721]))); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t720.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t721])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t721]))); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t720.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t720.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t721])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t721])); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t720.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t720.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t721])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t721])); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t720.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t720.v.p; mrb_int _pk = _sh->order[_t721]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t722 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t722; | |
| sp_redo_26: ; | |
| sp_RbVal _t723 = lv_c; | |
| sp_RbVal _t724 = sp_box_nil(); | |
| if (_t723.tag == SP_TAG_OBJ) { | |
| if (_t723.cls_id == 50) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 63) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 65) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 69) _t724 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t723.v.p)), sp_box_nil()); | |
| if (_t723.cls_id == 71) _t724 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t723.v.p)), sp_box_nil()); | |
| if (_t723.cls_id == 76) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 77) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 78) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 79) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 80) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| if (_t723.cls_id == 81) _t724 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t723.v.p), 50); | |
| } | |
| _t724; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_9355_dom_prefix(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_after_create_commit(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_after_update_commit(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t725 = sp_sprintf("article_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t725); | |
| sp_String * _t726 = sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0); | |
| SP_GC_ROOT(_t726); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t725, _t726); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_after_destroy_commit(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%lld", (long long)self->iv_id)); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_9355_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t727 = sp_IntArray_new(); | |
| sp_IntArray_push(_t727, SPS_id); | |
| sp_IntArray_push(_t727, SPS_body); | |
| sp_IntArray_push(_t727, SPS_created_at); | |
| sp_IntArray_push(_t727, SPS_title); | |
| sp_IntArray_push(_t727, SPS_updated_at); | |
| return _t727; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_9372) | |
| static inline sp_Article__implicit_9372 *sp_Article__implicit_9372_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_9372 *self = SP_POOL_NEW(Article__implicit_9372, sp_Article__implicit_9372_gc_scan); | |
| self->cls_id = 81LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_9372_initialize(sp_Article__implicit_9372 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id)) : 0LL); | |
| sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); | |
| sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_id(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_id_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_body(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t728 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t728; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_created_at(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t729 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t729; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_title(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t730 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t730; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_updated_at(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t731 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t731; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_9372_assign_from_row(sp_Article__implicit_9372 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_attributes(sp_Article__implicit_9372 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372__aref(sp_Article__implicit_9372 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t732 = lv_name; | |
| if ((_t732.tag == SP_TAG_SYM && _t732.v.i == SPS_id)) { | |
| sp_RbVal _t733 = sp_box_int(self->iv_id); | |
| SP_GC_RESTORE(); | |
| return _t733; | |
| } else if ((_t732.tag == SP_TAG_SYM && _t732.v.i == SPS_body)) { | |
| sp_RbVal _t734 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t734; | |
| } else if ((_t732.tag == SP_TAG_SYM && _t732.v.i == SPS_created_at)) { | |
| sp_RbVal _t735 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t735; | |
| } else if ((_t732.tag == SP_TAG_SYM && _t732.v.i == SPS_title)) { | |
| sp_RbVal _t736 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t736; | |
| } else if ((_t732.tag == SP_TAG_SYM && _t732.v.i == SPS_updated_at)) { | |
| sp_RbVal _t737 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t737; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__aset(sp_Article__implicit_9372 *self, sp_sym lv_name, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| mrb_int _t738 = lv_name; | |
| if (_t738 == SPS_id) { | |
| self->iv_id = sp_str_to_i_cruby(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t738 == SPS_body) { | |
| self->iv_body = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t738 == SPS_created_at) { | |
| self->iv_created_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t738 == SPS_title) { | |
| self->iv_title = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } else if (_t738 == SPS_updated_at) { | |
| self->iv_updated_at = sp_box_str(lv_value); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_9372_update(sp_Article__implicit_9372 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t739 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t739); | |
| if ((_t739 == NULL)) { | |
| } else { | |
| sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); | |
| } | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| } else { | |
| sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); | |
| } | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__adapter_insert(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t740 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t740); | |
| const char * _t741 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t741); | |
| const char * _t742 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t742); | |
| const char * _t743 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t743); | |
| const char * _t744 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t744); | |
| const char * _t745 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t745); | |
| const char * _t746 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t746); | |
| const char * _t747 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t747); | |
| const char * _t748 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t748); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t740, _t741, _t742, _t743, _t744, _t745, _t746, _t747, _t748}, 9)); | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__adapter_update(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t749 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t749); | |
| const char * _t750 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t750); | |
| const char * _t751 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t751); | |
| const char * _t752 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t752); | |
| const char * _t753 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t753); | |
| const char * _t754 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t754); | |
| const char * _t755 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t755); | |
| const char * _t756 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t756); | |
| const char * _t757 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t757); | |
| const char * _t758 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t758); | |
| const char * _t759 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t759); | |
| const char * _t760 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t760); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t749, _t750, _t751, _t752, _t753, _t754, _t755, _t756, _t757, _t758, _t759, _t760}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__adapter_delete(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t761 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t761); | |
| const char * _t762 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t762); | |
| const char * _t763 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t763); | |
| const char * _t764 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t764); | |
| return sp_Db_cls_exec(sp_str_concat4(_t761, _t762, _t763, _t764)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9372__adapter_reload(sp_Article__implicit_9372 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t765 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t765); | |
| const char * _t766 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t766); | |
| const char * _t767 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t767); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t765, _t766, _t767)); | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| self->iv_id = sp_Db_cls_column_int(lv_stmt, 0LL); | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL)); | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL)); | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL)); | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL)); | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t768 = sp_box_obj(self, 81); | |
| SP_GC_RESTORE(); | |
| return _t768; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_9372_validate(sp_Article__implicit_9372 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t769 = self->iv_title; | |
| mrb_bool _t770 = FALSE; | |
| if (_t769.tag == SP_TAG_STR) _t770 = (sp_str_length(_t769.v.s) == 0); | |
| if (_t769.tag == SP_TAG_OBJ) { | |
| if (_t769.cls_id == 53) _t770 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t769.v.p); | |
| if (_t769.cls_id == 54) _t770 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t769.v.p); | |
| if (_t769.cls_id == SP_BUILTIN_INT_ARRAY) _t770 = (sp_IntArray_length((sp_IntArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_FLT_ARRAY) _t770 = (sp_FloatArray_length((sp_FloatArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_ARRAY) _t770 = (sp_StrArray_length((sp_StrArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_SYM_ARRAY) _t770 = (sp_IntArray_length((sp_IntArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_PTR_ARRAY) _t770 = (sp_PtrArray_length((sp_PtrArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_POLY_ARRAY) _t770 = (sp_PolyArray_length((sp_PolyArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_INT_HASH) _t770 = (sp_StrIntHash_length((sp_StrIntHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_STR_HASH) _t770 = (sp_StrStrHash_length((sp_StrStrHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_INT_STR_HASH) _t770 = (sp_IntStrHash_length((sp_IntStrHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_POLY_HASH) _t770 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t770 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t770 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t769.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t770)) { | |
| sp_StrArray * _t771 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t771); | |
| sp_StrArray_push(_t771, (&("\xff" "title can't be blank")[1])); | |
| } | |
| sp_RbVal _t772 = self->iv_body; | |
| mrb_bool _t773 = FALSE; | |
| if (_t772.tag == SP_TAG_STR) _t773 = (sp_str_length(_t772.v.s) == 0); | |
| if (_t772.tag == SP_TAG_OBJ) { | |
| if (_t772.cls_id == 53) _t773 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t772.v.p); | |
| if (_t772.cls_id == 54) _t773 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_INT_ARRAY) _t773 = (sp_IntArray_length((sp_IntArray *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_FLT_ARRAY) _t773 = (sp_FloatArray_length((sp_FloatArray *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_STR_ARRAY) _t773 = (sp_StrArray_length((sp_StrArray *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_SYM_ARRAY) _t773 = (sp_IntArray_length((sp_IntArray *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_PTR_ARRAY) _t773 = (sp_PtrArray_length((sp_PtrArray *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_POLY_ARRAY) _t773 = (sp_PolyArray_length((sp_PolyArray *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_STR_INT_HASH) _t773 = (sp_StrIntHash_length((sp_StrIntHash *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_STR_STR_HASH) _t773 = (sp_StrStrHash_length((sp_StrStrHash *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_INT_STR_HASH) _t773 = (sp_IntStrHash_length((sp_IntStrHash *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_STR_POLY_HASH) _t773 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t773 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t772.v.p) == 0); | |
| if (_t772.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t773 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t772.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t773)) { | |
| sp_StrArray * _t774 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t774); | |
| sp_StrArray_push(_t774, (&("\xff" "body can't be blank")[1])); | |
| } | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| sp_RbVal _t775 = self->iv_body; | |
| mrb_int _t776 = 0; | |
| if (_t775.tag == SP_TAG_STR) _t776 = sp_str_length(_t775.v.s); | |
| if (_t775.tag == SP_TAG_OBJ) { | |
| if (_t775.cls_id == 53) _t776 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t775.v.p); | |
| if (_t775.cls_id == 54) _t776 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_INT_ARRAY) _t776 = sp_IntArray_length((sp_IntArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_FLT_ARRAY) _t776 = sp_FloatArray_length((sp_FloatArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_STR_ARRAY) _t776 = sp_StrArray_length((sp_StrArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_SYM_ARRAY) _t776 = sp_IntArray_length((sp_IntArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_PTR_ARRAY) _t776 = sp_PtrArray_length((sp_PtrArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_POLY_ARRAY) _t776 = sp_PolyArray_length((sp_PolyArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_STR_INT_HASH) _t776 = sp_StrIntHash_length((sp_StrIntHash *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_STR_STR_HASH) _t776 = sp_StrStrHash_length((sp_StrStrHash *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_INT_STR_HASH) _t776 = sp_IntStrHash_length((sp_IntStrHash *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_STR_POLY_HASH) _t776 = sp_StrPolyHash_length((sp_StrPolyHash *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t776 = sp_SymPolyHash_length((sp_SymPolyHash *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t776 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_INT_ARRAY) _t776 = sp_IntArray_length((sp_IntArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_FLT_ARRAY) _t776 = sp_FloatArray_length((sp_FloatArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_STR_ARRAY) _t776 = sp_StrArray_length((sp_StrArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_SYM_ARRAY) _t776 = sp_IntArray_length((sp_IntArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_PTR_ARRAY) _t776 = sp_PtrArray_length((sp_PtrArray *)_t775.v.p); | |
| if (_t775.cls_id == SP_BUILTIN_POLY_ARRAY) _t776 = sp_PolyArray_length((sp_PolyArray *)_t775.v.p); | |
| } | |
| lv_len = _t776; | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t777 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t777); | |
| sp_StrArray_push(_t777, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9372_comments(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t778 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t778; | |
| } | |
| const char * _t779 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t779); | |
| const char * _t780 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t780); | |
| const char * _t781 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t781); | |
| const char * _t782 = sp_Db_cls_escape_int(sp_box_int(self->iv_id)); | |
| SP_GC_ROOT(_t782); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t779, _t780, _t781, _t782)); | |
| lv_results = sp_IntArray_new(); | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_27: ; | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| } | |
| sp_Db_cls_finalize(lv_stmt); | |
| sp_RbVal _t783 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t783; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__preload_comments(sp_Article__implicit_9372 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| self->iv_comments_cache = lv_list; | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_before_destroy(sp_Article__implicit_9372 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_RbVal _t784 = sp_Article__implicit_9372_comments(self); | |
| SP_GC_ROOT_RBVAL(_t784); | |
| if (_t784.tag == SP_TAG_OBJ) { | |
| mrb_int _t785_len = 0; | |
| if (_t784.cls_id == SP_BUILTIN_RANGE) _t785_len = ((sp_Range *)_t784.v.p)->last - ((sp_Range *)_t784.v.p)->first + 1; | |
| else if (_t784.cls_id == SP_BUILTIN_INT_ARRAY) _t785_len = sp_IntArray_length((sp_IntArray *)_t784.v.p); | |
| else if (_t784.cls_id == SP_BUILTIN_FLT_ARRAY) _t785_len = sp_FloatArray_length((sp_FloatArray *)_t784.v.p); | |
| else if (_t784.cls_id == SP_BUILTIN_STR_ARRAY) _t785_len = sp_StrArray_length((sp_StrArray *)_t784.v.p); | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_ARRAY) _t785_len = sp_IntArray_length((sp_IntArray *)_t784.v.p); | |
| else if (_t784.cls_id == SP_BUILTIN_PTR_ARRAY) _t785_len = sp_PtrArray_length((sp_PtrArray *)_t784.v.p); | |
| else if (_t784.cls_id == SP_BUILTIN_POLY_ARRAY) _t785_len = sp_PolyArray_length((sp_PolyArray *)_t784.v.p); | |
| else if (_t784.cls_id == SP_BUILTIN_STR_INT_HASH) _t785_len = ((sp_StrIntHash *)_t784.v.p)->len; | |
| else if (_t784.cls_id == SP_BUILTIN_STR_STR_HASH) _t785_len = ((sp_StrStrHash *)_t784.v.p)->len; | |
| else if (_t784.cls_id == SP_BUILTIN_INT_STR_HASH) _t785_len = ((sp_IntStrHash *)_t784.v.p)->len; | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_INT_HASH) _t785_len = ((sp_SymIntHash *)_t784.v.p)->len; | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_STR_HASH) _t785_len = ((sp_SymStrHash *)_t784.v.p)->len; | |
| else if (_t784.cls_id == SP_BUILTIN_STR_POLY_HASH) _t785_len = ((sp_StrPolyHash *)_t784.v.p)->len; | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t785_len = ((sp_SymPolyHash *)_t784.v.p)->len; | |
| else if (_t784.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t785_len = ((sp_PolyPolyHash *)_t784.v.p)->len; | |
| for (mrb_int _t785 = 0; _t785 < _t785_len; _t785++) { | |
| sp_RbVal _t786 = sp_box_nil(); | |
| if (_t784.cls_id == SP_BUILTIN_RANGE) _t786 = sp_box_int(((sp_Range *)_t784.v.p)->first + _t785); | |
| else if (_t784.cls_id == SP_BUILTIN_INT_ARRAY) _t786 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t784.v.p, _t785)); | |
| else if (_t784.cls_id == SP_BUILTIN_FLT_ARRAY) _t786 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t784.v.p, _t785)); | |
| else if (_t784.cls_id == SP_BUILTIN_STR_ARRAY) _t786 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t784.v.p, _t785)); | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_ARRAY) _t786 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t784.v.p, _t785)); | |
| else if (_t784.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t784.v.p, _t785); _t786 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t784.cls_id == SP_BUILTIN_POLY_ARRAY) _t786 = sp_PolyArray_get((sp_PolyArray *)_t784.v.p, _t785); | |
| else if (_t784.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t784.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t785])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t785]))); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t784.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t784.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t785])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t785]))); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t784.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t784.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t785])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t785]))); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t784.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t785])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t785]))); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t784.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t785])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t785]))); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t784.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t784.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t785])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t785])); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t784.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t784.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t785])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t785])); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t784.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t784.v.p; mrb_int _pk = _sh->order[_t785]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t786 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t786; | |
| sp_redo_28: ; | |
| sp_RbVal _t787 = lv_c; | |
| sp_RbVal _t788 = sp_box_nil(); | |
| if (_t787.tag == SP_TAG_OBJ) { | |
| if (_t787.cls_id == 50) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 63) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 65) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 69) _t788 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t787.v.p)), sp_box_nil()); | |
| if (_t787.cls_id == 71) _t788 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t787.v.p)), sp_box_nil()); | |
| if (_t787.cls_id == 76) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 77) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 78) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 79) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 80) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| if (_t787.cls_id == 81) _t788 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t787.v.p), 50); | |
| } | |
| _t788; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_9372_dom_prefix(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_after_create_commit(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_after_update_commit(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| const char * _t789 = sp_sprintf("article_%lld", (long long)self->iv_id); | |
| SP_GC_ROOT(_t789); | |
| sp_String * _t790 = sp_Views_Articles_cls_article(sp_box_obj(self, 81), 0, 0); | |
| SP_GC_ROOT(_t790); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t789, _t790); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_after_destroy_commit(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%lld", (long long)self->iv_id)); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_9372_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| sp_IntArray *_t791 = sp_IntArray_new(); | |
| sp_IntArray_push(_t791, SPS_id); | |
| sp_IntArray_push(_t791, SPS_body); | |
| sp_IntArray_push(_t791, SPS_created_at); | |
| sp_IntArray_push(_t791, SPS_title); | |
| sp_IntArray_push(_t791, SPS_updated_at); | |
| return _t791; | |
| return NULL; | |
| } | |
| /* sp_Class new-dispatch table Tier 5) */ | |
| typedef sp_RbVal (*sp_class_new_fn)(void); | |
| static sp_RbVal sp_class_new_nil_fallback(void) __attribute__((unused)); | |
| static sp_RbVal sp_class_new_nil_fallback(void){return sp_box_nil();} | |
| static sp_RbVal sp_ActionView_Slots_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ActionView_Slots_new_dispatch_adapter(void){return sp_box_obj(sp_ActionView_Slots_new(), 55);} | |
| static sp_RbVal sp_ActionController_Base_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ActionController_Base_new_dispatch_adapter(void){return sp_box_obj(sp_ActionController_Base_new(), 56);} | |
| static sp_RbVal sp_Broadcasts_SeedTransport_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_Broadcasts_SeedTransport_new_dispatch_adapter(void){return sp_box_obj(sp_Broadcasts_SeedTransport_new(), 57);} | |
| static sp_RbVal sp_ActionDispatch_IntegrationTest_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ActionDispatch_IntegrationTest_new_dispatch_adapter(void){return sp_box_obj(sp_ActionDispatch_IntegrationTest_new(), 58);} | |
| static sp_RbVal sp_ApplicationController_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ApplicationController_new_dispatch_adapter(void){return sp_box_obj(sp_ApplicationController_new(), 62);} | |
| static sp_RbVal sp_CommentRow_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_CommentRow_new_dispatch_adapter(void){return sp_box_obj(sp_CommentRow_new(), 64);} | |
| static sp_RbVal sp_ArticleRow_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticleRow_new_dispatch_adapter(void){return sp_box_obj(sp_ArticleRow_new(), 66);} | |
| static sp_RbVal sp_ArticleParams_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticleParams_new_dispatch_adapter(void){return sp_box_obj(sp_ArticleParams_new(), 68);} | |
| static sp_RbVal sp_ArticlesController_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticlesController_new_dispatch_adapter(void){return sp_box_obj(sp_ArticlesController_new(), 69);} | |
| static sp_RbVal sp_CommentParams_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_CommentParams_new_dispatch_adapter(void){return sp_box_obj(sp_CommentParams_new(), 70);} | |
| static sp_RbVal sp_CommentsController_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_CommentsController_new_dispatch_adapter(void){return sp_box_obj(sp_CommentsController_new(), 71);} | |
| static sp_RbVal sp_TestBase_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_TestBase_new_dispatch_adapter(void){return sp_box_obj(sp_TestBase_new(), 73);} | |
| static sp_RbVal sp_ArticlesControllerTest_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticlesControllerTest_new_dispatch_adapter(void){return sp_box_obj(sp_ArticlesControllerTest_new(), 74);} | |
| static const sp_class_new_fn sp_class_constructors[SP_CLASS_COUNT] __attribute__((unused)) = {sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_ActionView_Slots_new_dispatch_adapter,sp_ActionController_Base_new_dispatch_adapter,sp_Broadcasts_SeedTransport_new_dispatch_adapter,sp_ActionDispatch_IntegrationTest_new_dispatch_adapter,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_ApplicationController_new_dispatch_adapter,sp_class_new_nil_fallback,sp_CommentRow_new_dispatch_adapter,sp_class_new_nil_fallback,sp_ArticleRow_new_dispatch_adapter,sp_class_new_nil_fallback,sp_ArticleParams_new_dispatch_adapter,sp_ArticlesController_new_dispatch_adapter,sp_CommentParams_new_dispatch_adapter,sp_CommentsController_new_dispatch_adapter,sp_class_new_nil_fallback,sp_TestBase_new_dispatch_adapter,sp_ArticlesControllerTest_new_dispatch_adapter,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback}; | |
| static sp_RbVal sp_class_new_dispatch(sp_Class c) __attribute__((unused)); | |
| static sp_RbVal sp_class_new_dispatch(sp_Class c){if(c.cls_id<0||c.cls_id>=SP_CLASS_COUNT)return sp_box_nil();return sp_class_constructors[c.cls_id]();} | |
| static const char * sp_Base64_cls_strict_encode64(const char * lv_s) { | |
| SP_GC_SAVE(); | |
| sp_IntArray * lv_bytes = NULL; | |
| mrb_int lv_n = 0; | |
| const char * lv_out = (&("\xff")[1]); | |
| mrb_int lv_i = 0; | |
| mrb_int lv_b0 = 0; | |
| mrb_int lv_b1 = 0; | |
| mrb_int lv_b2 = 0; | |
| mrb_int lv_rem = 0; | |
| SP_GC_ROOT(lv_bytes); | |
| SP_GC_ROOT(lv_out); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_s); | |
| lv_bytes = sp_str_bytes(lv_s); | |
| lv_n = sp_IntArray_length(lv_bytes); | |
| lv_out = (&("\xff" "")[1]); | |
| lv_i = 0LL; | |
| while ((sp_int_add(lv_i, 3LL) <= lv_n)) { | |
| sp_redo_29: ; | |
| lv_b0 = sp_IntArray_get(lv_bytes, lv_i); | |
| lv_b1 = sp_IntArray_get(lv_bytes, sp_int_add(lv_i, 1LL)); | |
| lv_b2 = sp_IntArray_get(lv_bytes, sp_int_add(lv_i, 2LL)); | |
| const char * _t792 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t792); | |
| const char * _t793 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t793); | |
| lv_out = sp_str_concat(lv_out, _t793); | |
| const char * _t794 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t794); | |
| const char * _t795 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t795); | |
| lv_out = sp_str_concat(lv_out, _t795); | |
| const char * _t796 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b1 << 2LL) | (lv_b2 >> 6LL)) & 63LL)); | |
| SP_GC_ROOT(_t796); | |
| const char * _t797 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b1 << 2LL) | (lv_b2 >> 6LL)) & 63LL)); | |
| SP_GC_ROOT(_t797); | |
| lv_out = sp_str_concat(lv_out, _t797); | |
| const char * _t798 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (lv_b2 & 63LL)); | |
| SP_GC_ROOT(_t798); | |
| const char * _t799 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (lv_b2 & 63LL)); | |
| SP_GC_ROOT(_t799); | |
| lv_out = sp_str_concat(lv_out, _t799); | |
| lv_i = sp_int_add(lv_i, 3LL); | |
| } | |
| lv_rem = sp_int_sub(lv_n, lv_i); | |
| if ((lv_rem == 1LL)) { | |
| lv_b0 = sp_IntArray_get(lv_bytes, lv_i); | |
| const char * _t800 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t800); | |
| const char * _t801 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t801); | |
| lv_out = sp_str_concat(lv_out, _t801); | |
| const char * _t802 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 << 4LL) & 63LL)); | |
| SP_GC_ROOT(_t802); | |
| const char * _t803 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 << 4LL) & 63LL)); | |
| SP_GC_ROOT(_t803); | |
| lv_out = sp_str_concat(lv_out, _t803); | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "==")[1])); | |
| } else { | |
| if ((lv_rem == 2LL)) { | |
| lv_b0 = sp_IntArray_get(lv_bytes, lv_i); | |
| lv_b1 = sp_IntArray_get(lv_bytes, sp_int_add(lv_i, 1LL)); | |
| const char * _t804 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t804); | |
| const char * _t805 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t805); | |
| lv_out = sp_str_concat(lv_out, _t805); | |
| const char * _t806 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t806); | |
| const char * _t807 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t807); | |
| lv_out = sp_str_concat(lv_out, _t807); | |
| const char * _t808 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b1 << 2LL) & 63LL)); | |
| SP_GC_ROOT(_t808); | |
| const char * _t809 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b1 << 2LL) & 63LL)); | |
| SP_GC_ROOT(_t809); | |
| lv_out = sp_str_concat(lv_out, _t809); | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "=")[1])); | |
| } | |
| } | |
| return (const char *)lv_out; | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_Base64_cls_strict_decode64(sp_RbVal lv_s) { | |
| (void)lv_s; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Base64_cls_char_value(sp_RbVal lv_c) { | |
| (void)lv_c; | |
| return 0; | |
| } | |
| static inline const char * sp_JSON_cls_generate(const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(lv_value); | |
| if (TRUE) { | |
| const char * _t810 = (&("\xff" "\"")[1]); | |
| SP_GC_ROOT(_t810); | |
| const char * _t811 = sp_JSON_cls_escape_string((const char *)lv_value); | |
| SP_GC_ROOT(_t811); | |
| const char * _t812 = (&("\xff" "\"")[1]); | |
| SP_GC_ROOT(_t812); | |
| return sp_str_concat3(_t810, _t811, _t812); | |
| } else { | |
| return lv_value; | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_JSON_cls_escape_string(const char * lv_s) { | |
| SP_GC_SAVE(); | |
| const char * lv_out = (&("\xff")[1]); | |
| mrb_int lv_i = 0; | |
| mrb_int lv_n = 0; | |
| const char * lv_c = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_out); | |
| SP_GC_ROOT(lv_c); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_s); | |
| lv_out = (&("\xff" "")[1]); | |
| lv_i = 0LL; | |
| lv_n = sp_str_length(lv_s); | |
| while ((lv_i < lv_n)) { | |
| sp_redo_30: ; | |
| lv_c = sp_str_char_at_or_nil(lv_s, lv_i); | |
| if (sp_str_eq(lv_c, (&("\xff" "\"")[1]))) { | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\\"")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\\")[1]))) { | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\\\")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\n")[1]))) { | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\n")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\r")[1]))) { | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\r")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\t")[1]))) { | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\t")[1])); | |
| } else { | |
| lv_out = sp_str_concat(lv_out, lv_c); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| lv_i = sp_int_add(lv_i, 1LL); | |
| } | |
| return (const char *)lv_out; | |
| return (&("\xff")[1]); | |
| } | |
| static mrb_int sp_Db_cls_configure(const char * lv_path, mrb_int lv_pool_size) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_n = 0; | |
| const char * lv_ev = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_ev); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_path); | |
| lv_n = lv_pool_size; | |
| lv_ev = sp_str_dup_external(getenv((&("\xff" "DATABASE_POOL_SIZE")[1]))); | |
| mrb_bool _t813 = (!(lv_ev == NULL)); | |
| mrb_bool _t814 = FALSE; | |
| if (_t813) { | |
| _t814 = (!sp_str_eq(lv_ev, (&("\xff" "")[1]))); | |
| } else { | |
| _t814 = _t813; | |
| } | |
| if (_t814) { | |
| lv_n = sp_str_to_i_cruby(lv_ev); | |
| } | |
| cst_Db_pool = sp_DbPool_new(lv_path, lv_n); | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Db_cls_current_conn(void) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_c = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_c); | |
| lv_c = sp_Fiber_storage_get(sp_fiber_current, SPS_db_conn); | |
| if ((!sp_poly_nil_p(lv_c))) { | |
| sp_RbVal _t815 = lv_c; | |
| SP_GC_RESTORE(); | |
| return _t815; | |
| } | |
| sp_RbVal _t816 = sp_box_obj(sp_DbPool_first(cst_Db_pool), 60); | |
| SP_GC_RESTORE(); | |
| return _t816; | |
| return sp_box_nil(); | |
| } | |
| static mrb_int sp_Db_cls_with_connection(void) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_Db_cls_close(void) { | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_Db_cls_exec(const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| volatile void * lv_h = NULL; | |
| volatile mrb_int lv_rc = 0; | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(lv_sql); | |
| sp_Db_cls_record_query((const char *)lv_sql); | |
| sp_RbVal _t817 = sp_Db_cls_current_conn(); | |
| void * _t818 = NULL; | |
| if (_t817.tag == SP_TAG_OBJ) { | |
| if (_t817.cls_id == 60) _t818 = sp_DbConn_dbh((sp_DbConn *)_t817.v.p); | |
| } | |
| lv_h = _t818; | |
| lv_rc = sqlite3_exec(((void *)(uintptr_t)lv_h), lv_sql, ((void *)(uintptr_t)0), ((void *)(uintptr_t)0), ((void *)(uintptr_t)0)); | |
| if ((lv_rc != cst_SQL_OK)) { | |
| const char * _t819 = (&("\xff" "Db.exec failed (")[1]); | |
| SP_GC_ROOT(_t819); | |
| const char * _t820 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t820); | |
| const char * _t821 = (&("\xff" "): ")[1]); | |
| SP_GC_ROOT(_t821); | |
| const char * _t822 = sp_str_dup_external(sqlite3_errmsg(((void *)(uintptr_t)lv_h))); | |
| SP_GC_ROOT(_t822); | |
| const char * _t823 = (&("\xff" " \xE2\x80\x94 sql: ")[1]); | |
| SP_GC_ROOT(_t823); | |
| const char * _t824 = lv_sql; | |
| SP_GC_ROOT(_t824); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t819, _t820, _t821, _t822, _t823, _t824}, 6)); | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline void * sp_Db_cls_prepare(const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(lv_sql); | |
| sp_Db_cls_record_query((const char *)lv_sql); | |
| sp_RbVal _t825 = sp_Db_cls_current_conn(); | |
| void * _t826 = NULL; | |
| if (_t825.tag == SP_TAG_OBJ) { | |
| if (_t825.cls_id == 60) _t826 = sp_DbConn_prepare_cached((sp_DbConn *)_t825.v.p, lv_sql); | |
| } | |
| return _t826; | |
| return NULL; | |
| } | |
| static sp_IntArray * sp_Db_cls_capture_sql(void) { | |
| return NULL; | |
| } | |
| static inline sp_RbVal sp_Db_cls_record_query(const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(lv_sql); | |
| if (!(sp_poly_nil_p(cst_Db_query_log))) { | |
| sp_RbVal _t827 = cst_Db_query_log; | |
| mrb_int _t828 = 0; | |
| if (_t827.tag == SP_TAG_OBJ) { | |
| } | |
| _t828; | |
| return sp_box_nil(); | |
| } else { | |
| return sp_box_nil(); | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_bool sp_Db_cls_step_p(void * lv_stmt) { | |
| SP_GC_SAVE(); | |
| return (sqlite3_step(((void *)(uintptr_t)lv_stmt)) == cst_SQL_ROW); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Db_cls_column_int(void * lv_stmt, mrb_int lv_i) { | |
| SP_GC_SAVE(); | |
| return sqlite3_column_int(((void *)(uintptr_t)lv_stmt), ((int)(lv_i))); | |
| return 0; | |
| } | |
| static inline const char * sp_Db_cls_column_text(void * lv_stmt, mrb_int lv_i) { | |
| SP_GC_SAVE(); | |
| const char * lv_s = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_s); | |
| lv_s = sp_str_dup_external(sqlite3_column_text(((void *)(uintptr_t)lv_stmt), ((int)(lv_i)))); | |
| if ((lv_s == NULL)) { | |
| return (&("\xff" "")[1]); | |
| } else { | |
| return sp_str_concat(lv_s, (&("\xff" "")[1])); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Db_cls_column_count(mrb_int lv_stmt) { | |
| (void)lv_stmt; | |
| return 0; | |
| } | |
| static inline const char * sp_Db_cls_column_name(mrb_int lv_stmt, mrb_int lv_i) { | |
| (void)lv_stmt; | |
| (void)lv_i; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Db_cls_finalize(void * lv_stmt) { | |
| SP_GC_SAVE(); | |
| sqlite3_reset(((void *)(uintptr_t)lv_stmt)); | |
| return sqlite3_clear_bindings(((void *)(uintptr_t)lv_stmt)); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Db_cls_last_insert_rowid(void) { | |
| SP_GC_SAVE(); | |
| sp_RbVal _t829 = sp_Db_cls_current_conn(); | |
| void * _t830 = NULL; | |
| if (_t829.tag == SP_TAG_OBJ) { | |
| if (_t829.cls_id == 60) _t830 = sp_DbConn_dbh((sp_DbConn *)_t829.v.p); | |
| } | |
| return sqlite3_last_insert_rowid(((void *)(uintptr_t)_t830)); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Db_cls_changes(void) { | |
| return 0; | |
| } | |
| static inline const char * sp_Db_cls_escape_string(sp_RbVal lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_s); | |
| const char * _t831 = sp_poly_to_s(lv_s); | |
| SP_GC_ROOT(_t831); | |
| const char * _t832 = (&("\xff" "'")[1]); | |
| SP_GC_ROOT(_t832); | |
| const char * _t833 = sp_str_gsub(_t831, (&("\xff" "'")[1]), (&("\xff" "''")[1])); | |
| SP_GC_ROOT(_t833); | |
| const char * _t834 = (&("\xff" "'")[1]); | |
| SP_GC_ROOT(_t834); | |
| return sp_str_concat3(_t832, _t833, _t834); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_Db_cls_escape_int(sp_RbVal lv_n) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_n); | |
| sp_RbVal _t836 = lv_n; | |
| mrb_int _t835 = (_t836.tag == SP_TAG_INT) ? _t836.v.i : 0; | |
| return sp_int_to_s(_t835); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_Db_cls_escape_int_list(sp_IntArray * lv_ids) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_i = 0; | |
| SP_GC_ROOT(lv_ids); | |
| SP_GC_ROOT(lv_ids); | |
| if (sp_IntArray_empty(lv_ids)) { | |
| const char * _t837 = (&("\xff" "NULL")[1]); | |
| SP_GC_RESTORE(); | |
| return _t837; | |
| } | |
| SP_GC_ROOT(lv_ids); | |
| sp_StrArray *_t838 = sp_StrArray_new(); | |
| SP_GC_ROOT(_t838); | |
| for (mrb_int _t839 = 0; _t839 < sp_IntArray_length(lv_ids); _t839++) { | |
| mrb_int lv_i = sp_IntArray_get(lv_ids, _t839); | |
| sp_StrArray_push(_t838, sp_int_to_s(lv_i)); | |
| } | |
| sp_StrArray * _t840 = _t838; | |
| SP_GC_ROOT(_t840); | |
| return sp_StrArray_join(_t840, (&("\xff" ", ")[1])); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_Db_cls_escape_bool(mrb_int lv_b) { | |
| (void)lv_b; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_bool sp_Db_cls_column_bool(void * lv_stmt, mrb_int lv_idx) { | |
| (void)lv_stmt; | |
| (void)lv_idx; | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_register(mrb_int lv_name, mrb_int lv_klass) { | |
| (void)lv_name; | |
| (void)lv_klass; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Registry_cls_lookup(mrb_int lv_name) { | |
| (void)lv_name; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Registry_cls_registered_p(mrb_int lv_name) { | |
| (void)lv_name; | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_clear_bang(void) { | |
| return 0; | |
| } | |
| static inline sp_StrArray * sp_Schema_cls_statements(void) { | |
| SP_GC_SAVE(); | |
| sp_StrArray *_t841 = sp_StrArray_new(); | |
| SP_GC_ROOT(_t841); | |
| sp_StrArray_push(_t841, (&("\xff" "CREATE TABLE IF NOT EXISTS articles (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n body TEXT,\n created_at TEXT NOT NULL,\n title TEXT,\n updated_at TEXT NOT NULL\n)")[1])); | |
| sp_StrArray_push(_t841, (&("\xff" "CREATE TABLE IF NOT EXISTS comments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n article_id INTEGER NOT NULL,\n body TEXT,\n commenter TEXT,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL\n)")[1])); | |
| sp_StrArray_push(_t841, (&("\xff" "CREATE INDEX IF NOT EXISTS index_comments_on_article_id ON comments (article_id)")[1])); | |
| return _t841; | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Router_MatchResult * sp_ActionDispatch_Router_cls_match(const char * lv_method, const char * lv_path, sp_PtrArray * lv_table) { | |
| SP_GC_SAVE(); | |
| const char * lv_method_upcase = (&("\xff")[1]); | |
| mrb_int lv_i = 0; | |
| sp_ActionDispatch_Router_Route * lv_route = NULL; | |
| sp_StrStrHash * lv_params = NULL; | |
| SP_GC_ROOT(lv_method_upcase); | |
| SP_GC_ROOT(lv_route); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_table); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_table); | |
| const char * _t842 = lv_method; | |
| SP_GC_ROOT(_t842); | |
| lv_method_upcase = sp_str_upcase(_t842); | |
| lv_i = 0LL; | |
| mrb_int _t843 = sp_PtrArray_length(lv_table); | |
| while ((lv_i < sp_PtrArray_length(lv_table))) { | |
| sp_redo_31: ; | |
| lv_route = ((sp_ActionDispatch_Router_Route *)sp_PtrArray_get(lv_table, lv_i)); | |
| const char * _t844 = lv_route->iv_verb; | |
| SP_GC_ROOT(_t844); | |
| if (sp_str_eq(_t844, lv_method_upcase)) { | |
| const char * _t845 = lv_route->iv_pattern; | |
| SP_GC_ROOT(_t845); | |
| lv_params = sp_ActionDispatch_Router_cls_match_pattern(_t845, (const char *)lv_path); | |
| if (!((lv_params == NULL))) { | |
| sp_ActionDispatch_Router_MatchResult * _t846 = sp_ActionDispatch_Router_MatchResult_new(lv_route->iv_controller, lv_route->iv_action, lv_params); | |
| SP_GC_RESTORE(); | |
| return _t846; | |
| } | |
| } | |
| lv_i += 1LL; | |
| } | |
| return 0; | |
| return NULL; | |
| } | |
| static sp_StrStrHash * sp_ActionDispatch_Router_cls_match_pattern(const char * lv_pattern, const char * lv_path) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_pattern_parts = NULL; | |
| sp_StrArray * lv_path_parts = NULL; | |
| sp_StrStrHash * lv_params = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_pp = (&("\xff")[1]); | |
| const char * lv_ap = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_pattern_parts); | |
| SP_GC_ROOT(lv_path_parts); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(lv_pp); | |
| SP_GC_ROOT(lv_ap); | |
| SP_GC_ROOT(lv_pattern); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_pattern); | |
| SP_GC_ROOT(lv_path); | |
| lv_pattern_parts = sp_str_split_drop_trailing(lv_pattern, (&("\xff" "/")[1])); | |
| lv_path_parts = sp_str_split_drop_trailing(lv_path, (&("\xff" "/")[1])); | |
| if ((sp_StrArray_length(lv_pattern_parts) != sp_StrArray_length(lv_path_parts))) { | |
| SP_GC_RESTORE(); | |
| return NULL; | |
| } | |
| lv_params = sp_StrStrHash_new(); | |
| lv_i = 0LL; | |
| mrb_int _t847 = sp_StrArray_length(lv_pattern_parts); | |
| while ((lv_i < sp_StrArray_length(lv_pattern_parts))) { | |
| sp_redo_32: ; | |
| lv_pp = sp_StrArray_get(lv_pattern_parts, lv_i); | |
| lv_ap = sp_StrArray_get(lv_path_parts, lv_i); | |
| if (sp_str_start_with(lv_pp, (&("\xff" ":")[1]))) { | |
| if (sp_gc_is_frozen(lv_params)) sp_raise_frozen_hash(); | |
| sp_StrStrHash_set(lv_params, sp_str_sub_range_r(lv_pp, 1LL, -1, 0), lv_ap); | |
| } else { | |
| if ((!sp_str_eq(lv_pp, lv_ap))) { | |
| SP_GC_RESTORE(); | |
| return NULL; | |
| } | |
| } | |
| lv_i += 1LL; | |
| } | |
| return (sp_StrStrHash *)lv_params; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_reset_slots_bang(void) { | |
| SP_GC_SAVE(); | |
| cst_ActionView_ViewHelpers_slots = sp_SymPolyHash_new(); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_content_for_set(sp_sym lv_slot, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(lv_value); | |
| if (sp_gc_is_frozen(cst_ActionView_ViewHelpers_slots)) sp_raise_frozen_hash(); | |
| sp_SymPolyHash_set(cst_ActionView_ViewHelpers_slots, lv_slot, sp_box_str(lv_value)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_ActionView_ViewHelpers_cls_content_for_get(sp_sym lv_slot) { | |
| (void)lv_slot; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActionView_ViewHelpers_cls_get_slot(sp_sym lv_slot) { | |
| (void)lv_slot; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActionView_ViewHelpers_cls_get_yield(void) { | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_set_yield(mrb_int lv_content) { | |
| (void)lv_content; | |
| return 0; | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_html_escape(sp_RbVal lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_s); | |
| sp_RbVal _t848 = lv_s; | |
| const char * _t849 = (&("\xff")[1]); | |
| if (_t848.tag == SP_TAG_STR) _t849 = sp_re_gsub_str_str_hash((sp_re_pat_err_0 ? (sp_raise_cls("RegexpError", sp_re_pat_err_0), (mrb_regexp_pattern *)NULL) : sp_re_pat_0), _t848.v.s, cst_ActionView_ViewHelpers_HTML_ESCAPES); | |
| if (_t848.tag == SP_TAG_OBJ) { | |
| } | |
| return _t849; | |
| return (&("\xff")[1]); | |
| } | |
| static sp_RbVal sp_ActionView_ViewHelpers_cls_truncate(sp_RbVal lv_s, mrb_int lv_length, const char * lv_omission) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_cutoff = 0; | |
| SP_GC_ROOT_RBVAL(lv_s); | |
| SP_GC_ROOT(lv_omission); | |
| SP_GC_ROOT(lv_omission); | |
| sp_RbVal _t850 = lv_s; | |
| mrb_int _t851 = 0; | |
| if (_t850.tag == SP_TAG_STR) _t851 = sp_str_length(_t850.v.s); | |
| if (_t850.tag == SP_TAG_OBJ) { | |
| if (_t850.cls_id == 53) _t851 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t850.v.p); | |
| if (_t850.cls_id == 54) _t851 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_INT_ARRAY) _t851 = sp_IntArray_length((sp_IntArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_FLT_ARRAY) _t851 = sp_FloatArray_length((sp_FloatArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_STR_ARRAY) _t851 = sp_StrArray_length((sp_StrArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_SYM_ARRAY) _t851 = sp_IntArray_length((sp_IntArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_PTR_ARRAY) _t851 = sp_PtrArray_length((sp_PtrArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_POLY_ARRAY) _t851 = sp_PolyArray_length((sp_PolyArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_STR_INT_HASH) _t851 = sp_StrIntHash_length((sp_StrIntHash *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_STR_STR_HASH) _t851 = sp_StrStrHash_length((sp_StrStrHash *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_INT_STR_HASH) _t851 = sp_IntStrHash_length((sp_IntStrHash *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_STR_POLY_HASH) _t851 = sp_StrPolyHash_length((sp_StrPolyHash *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t851 = sp_SymPolyHash_length((sp_SymPolyHash *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t851 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_INT_ARRAY) _t851 = sp_IntArray_length((sp_IntArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_FLT_ARRAY) _t851 = sp_FloatArray_length((sp_FloatArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_STR_ARRAY) _t851 = sp_StrArray_length((sp_StrArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_SYM_ARRAY) _t851 = sp_IntArray_length((sp_IntArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_PTR_ARRAY) _t851 = sp_PtrArray_length((sp_PtrArray *)_t850.v.p); | |
| if (_t850.cls_id == SP_BUILTIN_POLY_ARRAY) _t851 = sp_PolyArray_length((sp_PolyArray *)_t850.v.p); | |
| } | |
| if ((_t851 <= lv_length)) { | |
| sp_RbVal _t852 = lv_s; | |
| SP_GC_RESTORE(); | |
| return _t852; | |
| } | |
| lv_cutoff = sp_int_sub(lv_length, sp_str_length(lv_omission)); | |
| if ((lv_cutoff < 0LL)) { | |
| lv_cutoff = 0LL; | |
| } | |
| sp_RbVal _t853 = lv_s; | |
| sp_RbVal _t854 = sp_box_nil(); | |
| if (_t853.tag == SP_TAG_INT) _t854 = sp_box_int(((_t853.v.i >> (0LL)) & 1)); | |
| if (_t853.tag == SP_TAG_STR) _t854 = sp_box_str(sp_str_sub_range(_t853.v.s, 0LL, lv_cutoff)); | |
| if (_t853.tag == SP_TAG_OBJ) { | |
| if (_t853.cls_id == 50) _t854 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 53) _t854 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 54) _t854 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 63) _t854 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 65) _t854 = sp_Comment__aref((sp_Comment *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 76) _t854 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 77) _t854 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 78) _t854 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 79) _t854 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 80) _t854 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == 81) _t854 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t853.v.p, sp_box_int(0LL)); | |
| if (_t853.cls_id == SP_BUILTIN_INT_ARRAY) _t854 = sp_box_int_array(sp_IntArray_slice((sp_IntArray *)_t853.v.p, 0LL, lv_cutoff)); | |
| if (_t853.cls_id == SP_BUILTIN_FLT_ARRAY) _t854 = sp_box_float_array(sp_FloatArray_slice((sp_FloatArray *)_t853.v.p, 0LL, lv_cutoff)); | |
| if (_t853.cls_id == SP_BUILTIN_STR_ARRAY) _t854 = sp_box_str_array(sp_StrArray_slice((sp_StrArray *)_t853.v.p, 0LL, lv_cutoff)); | |
| if (_t853.cls_id == SP_BUILTIN_SYM_ARRAY) _t854 = sp_box_obj((void *)sp_IntArray_slice((sp_IntArray *)_t853.v.p, 0LL, lv_cutoff), SP_BUILTIN_SYM_ARRAY); | |
| if (_t853.cls_id == SP_BUILTIN_PTR_ARRAY) _t854 = sp_box_obj((void *)sp_PtrArray_slice((sp_PtrArray *)_t853.v.p, 0LL, lv_cutoff), SP_BUILTIN_PTR_ARRAY); | |
| } | |
| sp_RbVal _t855 = sp_box_str(sp_sprintf("%s%s", sp_poly_to_s(_t854), lv_omission)); | |
| SP_GC_RESTORE(); | |
| return _t855; | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_dom_id(sp_RbVal lv_record, sp_RbVal lv_suffix) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_record); | |
| SP_GC_ROOT_RBVAL(lv_suffix); | |
| if (sp_poly_nil_p(lv_suffix)) { | |
| sp_RbVal _t856 = lv_record; | |
| const char * _t857 = (&("\xff")[1]); | |
| if (_t856.tag == SP_TAG_OBJ) { | |
| if (_t856.cls_id == 50) _t857 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t856.v.p); | |
| if (_t856.cls_id == 63) _t857 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t856.v.p); | |
| if (_t856.cls_id == 65) _t857 = sp_Comment_dom_prefix((sp_Comment *)_t856.v.p); | |
| if (_t856.cls_id == 76) _t857 = sp_Article__implicit_6872_dom_prefix((sp_Article__implicit_6872 *)_t856.v.p); | |
| if (_t856.cls_id == 77) _t857 = sp_Article__implicit_6906_dom_prefix((sp_Article__implicit_6906 *)_t856.v.p); | |
| if (_t856.cls_id == 78) _t857 = sp_Article__implicit_7484_dom_prefix((sp_Article__implicit_7484 *)_t856.v.p); | |
| if (_t856.cls_id == 79) _t857 = sp_Article__implicit_7995_dom_prefix((sp_Article__implicit_7995 *)_t856.v.p); | |
| if (_t856.cls_id == 80) _t857 = sp_Article__implicit_9355_dom_prefix((sp_Article__implicit_9355 *)_t856.v.p); | |
| if (_t856.cls_id == 81) _t857 = sp_Article__implicit_9372_dom_prefix((sp_Article__implicit_9372 *)_t856.v.p); | |
| } | |
| sp_RbVal _t858 = lv_record; | |
| mrb_int _t859 = 0; | |
| if (_t858.tag == SP_TAG_OBJ) { | |
| if (_t858.cls_id == 50) _t859 = ((sp_ActiveRecord_Base *)_t858.v.p)->iv_id; | |
| if (_t858.cls_id == 63) _t859 = ((sp_ApplicationRecord *)_t858.v.p)->iv_id; | |
| if (_t858.cls_id == 64) _t859 = sp_CommentRow_id((sp_CommentRow *)_t858.v.p); | |
| if (_t858.cls_id == 65) _t859 = sp_Comment_id((sp_Comment *)_t858.v.p); | |
| if (_t858.cls_id == 66) _t859 = sp_ArticleRow_id((sp_ArticleRow *)_t858.v.p); | |
| if (_t858.cls_id == 76) _t859 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t858.v.p); | |
| if (_t858.cls_id == 77) _t859 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t858.v.p); | |
| if (_t858.cls_id == 78) _t859 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t858.v.p); | |
| if (_t858.cls_id == 79) _t859 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t858.v.p); | |
| if (_t858.cls_id == 80) _t859 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t858.v.p); | |
| if (_t858.cls_id == 81) _t859 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t858.v.p); | |
| } | |
| return sp_sprintf("%s_%lld", _t857, (long long)_t859); | |
| } else { | |
| sp_RbVal _t860 = lv_record; | |
| const char * _t861 = (&("\xff")[1]); | |
| if (_t860.tag == SP_TAG_OBJ) { | |
| if (_t860.cls_id == 50) _t861 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t860.v.p); | |
| if (_t860.cls_id == 63) _t861 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t860.v.p); | |
| if (_t860.cls_id == 65) _t861 = sp_Comment_dom_prefix((sp_Comment *)_t860.v.p); | |
| if (_t860.cls_id == 76) _t861 = sp_Article__implicit_6872_dom_prefix((sp_Article__implicit_6872 *)_t860.v.p); | |
| if (_t860.cls_id == 77) _t861 = sp_Article__implicit_6906_dom_prefix((sp_Article__implicit_6906 *)_t860.v.p); | |
| if (_t860.cls_id == 78) _t861 = sp_Article__implicit_7484_dom_prefix((sp_Article__implicit_7484 *)_t860.v.p); | |
| if (_t860.cls_id == 79) _t861 = sp_Article__implicit_7995_dom_prefix((sp_Article__implicit_7995 *)_t860.v.p); | |
| if (_t860.cls_id == 80) _t861 = sp_Article__implicit_9355_dom_prefix((sp_Article__implicit_9355 *)_t860.v.p); | |
| if (_t860.cls_id == 81) _t861 = sp_Article__implicit_9372_dom_prefix((sp_Article__implicit_9372 *)_t860.v.p); | |
| } | |
| sp_RbVal _t862 = lv_record; | |
| mrb_int _t863 = 0; | |
| if (_t862.tag == SP_TAG_OBJ) { | |
| if (_t862.cls_id == 50) _t863 = ((sp_ActiveRecord_Base *)_t862.v.p)->iv_id; | |
| if (_t862.cls_id == 63) _t863 = ((sp_ApplicationRecord *)_t862.v.p)->iv_id; | |
| if (_t862.cls_id == 64) _t863 = sp_CommentRow_id((sp_CommentRow *)_t862.v.p); | |
| if (_t862.cls_id == 65) _t863 = sp_Comment_id((sp_Comment *)_t862.v.p); | |
| if (_t862.cls_id == 66) _t863 = sp_ArticleRow_id((sp_ArticleRow *)_t862.v.p); | |
| if (_t862.cls_id == 76) _t863 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t862.v.p); | |
| if (_t862.cls_id == 77) _t863 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t862.v.p); | |
| if (_t862.cls_id == 78) _t863 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t862.v.p); | |
| if (_t862.cls_id == 79) _t863 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t862.v.p); | |
| if (_t862.cls_id == 80) _t863 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t862.v.p); | |
| if (_t862.cls_id == 81) _t863 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t862.v.p); | |
| } | |
| return sp_sprintf("%s_%s_%lld", sp_poly_to_s(lv_suffix), _t861, (long long)_t863); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_link_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts) { | |
| (void)lv_text; | |
| (void)lv_href; | |
| (void)lv_opts; | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_ActionView_ViewHelpers_cls_button_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts) { | |
| (void)lv_text; | |
| (void)lv_href; | |
| (void)lv_opts; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_meta_tags(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csp_meta_tag(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_stylesheet_link_tag(const char * lv_name, sp_SymStrHash * lv_opts) { | |
| (void)lv_name; | |
| (void)lv_opts; | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_ActionView_ViewHelpers_cls_javascript_importmap_tags(sp_RbVal lv_pins, const char * lv_entry) { | |
| (void)lv_pins; | |
| (void)lv_entry; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_turbo_stream_from(const char * lv_stream) { | |
| SP_GC_SAVE(); | |
| const char * lv_encoded = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_encoded); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_stream); | |
| lv_encoded = sp_Base64_cls_strict_encode64(sp_json_val(sp_box_str(lv_stream))); | |
| return sp_sprintf("<turbo-cable-stream-source channel=\"Turbo::StreamsChannel\" signed-stream-name=\"%s--unsigned\"></turbo-cable-stream-source>", lv_encoded); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(void) { | |
| SP_GC_SAVE(); | |
| return (&("\xff" "<input type=\"hidden\" name=\"authenticity_token\" value=\"\">")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_method_override_input(sp_sym lv_method) { | |
| SP_GC_SAVE(); | |
| const char * lv_method_str = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_method_str); | |
| lv_method_str = sp_sym_to_s(lv_method); | |
| if ((sp_str_eq(lv_method_str, (&("\xff" "get")[1])) || sp_str_eq(lv_method_str, (&("\xff" "post")[1])))) { | |
| return (&("\xff" "")[1]); | |
| } else { | |
| return sp_sprintf("<input type=\"hidden\" name=\"_method\" value=\"%s\">", lv_method_str); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_optional_value_attr(sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| const char * _t864 = sp_poly_to_s(lv_value); | |
| SP_GC_ROOT(_t864); | |
| if ((sp_poly_nil_p(lv_value) || (strlen(_t864) == 0))) { | |
| return (&("\xff" "")[1]); | |
| } else { | |
| return sp_sprintf(" value=\"%s\"", sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_poly_to_s(lv_value)))); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_escape_or_empty(sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| if (sp_poly_nil_p(lv_value)) { | |
| return (&("\xff" "")[1]); | |
| } else { | |
| return sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_poly_to_s(lv_value))); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_ActionView_ViewHelpers_cls_render_attrs(sp_StrPolyHash * lv_attrs) { | |
| (void)lv_attrs; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_JsonBuilder_cls_encode_string(const char * lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_s); | |
| return sp_re_gsub_str_str_hash((sp_re_pat_err_1 ? (sp_raise_cls("RegexpError", sp_re_pat_err_1), (mrb_regexp_pattern *)NULL) : sp_re_pat_1), lv_s, cst_JsonBuilder_ESCAPES); | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_JsonBuilder_cls_encode_value(sp_RbVal lv_v) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| if (sp_poly_nil_p(lv_v)) { | |
| const char * _t865 = (&("\xff" "null")[1]); | |
| SP_GC_RESTORE(); | |
| return _t865; | |
| } | |
| sp_RbVal _t866 = lv_v; | |
| if ((_t866.tag == SP_TAG_BOOL && _t866.v.b)) { | |
| const char * _t867 = (&("\xff" "true")[1]); | |
| SP_GC_RESTORE(); | |
| return _t867; | |
| } | |
| sp_RbVal _t868 = lv_v; | |
| if ((_t868.tag == SP_TAG_BOOL && !_t868.v.b)) { | |
| const char * _t869 = (&("\xff" "false")[1]); | |
| SP_GC_RESTORE(); | |
| return _t869; | |
| } | |
| sp_RbVal _t870 = lv_v; | |
| if ((_t870.tag == SP_TAG_INT)) { | |
| const char * _t871 = sp_int_to_s((lv_v).v.i); | |
| SP_GC_RESTORE(); | |
| return _t871; | |
| } | |
| sp_RbVal _t872 = lv_v; | |
| if ((_t872.tag == SP_TAG_FLT)) { | |
| const char * _t873 = sp_float_to_s((lv_v).v.f); | |
| SP_GC_RESTORE(); | |
| return _t873; | |
| } | |
| sp_RbVal _t874 = lv_v; | |
| if ((_t874.tag == SP_TAG_STR)) { | |
| const char * _t875 = sp_sprintf("\"%s\"", sp_JsonBuilder_cls_encode_string((lv_v).v.s)); | |
| SP_GC_RESTORE(); | |
| return _t875; | |
| } | |
| return sp_sprintf("\"%s\"", sp_JsonBuilder_cls_encode_string(sp_poly_to_s(lv_v))); | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_JsonBuilder_cls_encode_datetime(sp_RbVal lv_s) { | |
| SP_GC_SAVE(); | |
| const char * lv_str = (&("\xff")[1]); | |
| const char * lv_date = (&("\xff")[1]); | |
| const char * lv_time = (&("\xff")[1]); | |
| const char * lv_ms = (&("\xff")[1]); | |
| const char * lv_frac = (&("\xff")[1]); | |
| const char * lv_padded = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_str); | |
| SP_GC_ROOT(lv_date); | |
| SP_GC_ROOT(lv_time); | |
| SP_GC_ROOT(lv_ms); | |
| SP_GC_ROOT(lv_frac); | |
| SP_GC_ROOT(lv_padded); | |
| SP_GC_ROOT_RBVAL(lv_s); | |
| if (sp_poly_nil_p(lv_s)) { | |
| const char * _t876 = (&("\xff" "null")[1]); | |
| SP_GC_RESTORE(); | |
| return _t876; | |
| } | |
| lv_str = sp_poly_to_s(lv_s); | |
| if ((sp_str_length(lv_str) < 19LL)) { | |
| const char * _t877 = sp_sprintf("\"%s\"", sp_JsonBuilder_cls_encode_string((const char *)lv_str)); | |
| SP_GC_RESTORE(); | |
| return _t877; | |
| } | |
| lv_date = sp_str_sub_range(lv_str, 0LL, 10LL); | |
| lv_time = sp_str_sub_range(lv_str, 11LL, 8LL); | |
| lv_ms = (&("\xff" "000")[1]); | |
| mrb_bool _t878 = (sp_str_length(lv_str) > 20LL); | |
| mrb_bool _t879 = FALSE; | |
| if (_t878) { | |
| _t879 = sp_str_eq(sp_str_sub_range(lv_str, 19LL, 1LL), (&("\xff" ".")[1])); | |
| } else { | |
| _t879 = _t878; | |
| } | |
| if (_t879) { | |
| lv_frac = sp_str_sub_range_r(lv_str, 20LL, -1, 0); | |
| lv_padded = sp_sprintf("%s000", lv_frac); | |
| lv_ms = sp_str_sub_range(lv_padded, 0LL, 3LL); | |
| } | |
| return sp_sprintf("\"%sT%s.%sZ\"", lv_date, lv_time, lv_ms); | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_PolyArray * sp_Broadcasts_cls_reset_log_bang(void) { | |
| return NULL; | |
| } | |
| static inline sp_PolyArray * sp_Broadcasts_cls_log(void) { | |
| return NULL; | |
| } | |
| static inline sp_IntArray * sp_Broadcasts_cls_set_transport(mrb_int lv_transport) { | |
| SP_GC_SAVE(); | |
| cst_Broadcasts_TRANSPORTS->len = 0; cst_Broadcasts_TRANSPORTS->start = 0; | |
| sp_IntArray_push(cst_Broadcasts_TRANSPORTS, lv_transport); | |
| return NULL; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_append(const char * lv_stream, const char * lv_target, sp_String * lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| return sp_Broadcasts_cls_record(SPS_append, lv_stream, lv_target, ({ sp_String *_t880 = lv_html; _t880 ? sp_box_str(sp_str_dup_external((_t880)->data)) : sp_box_nil(); })); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_prepend(const char * lv_stream, const char * lv_target, sp_String * lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| return sp_Broadcasts_cls_record(SPS_prepend, lv_stream, lv_target, ({ sp_String *_t881 = lv_html; _t881 ? sp_box_str(sp_str_dup_external((_t881)->data)) : sp_box_nil(); })); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_replace(const char * lv_stream, const char * lv_target, sp_String * lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| return sp_Broadcasts_cls_record(SPS_replace, lv_stream, lv_target, ({ sp_String *_t882 = lv_html; _t882 ? sp_box_str(sp_str_dup_external((_t882)->data)) : sp_box_nil(); })); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_remove(const char * lv_stream, const char * lv_target) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| return sp_Broadcasts_cls_record(SPS_remove, lv_stream, lv_target, sp_box_str((&("\xff" "")[1]))); | |
| return 0; | |
| } | |
| static mrb_int sp_Broadcasts_cls_record(sp_sym lv_action, const char * lv_stream, const char * lv_target, sp_RbVal lv_html) { | |
| SP_GC_SAVE(); | |
| sp_SymPolyHash * lv_entry = NULL; | |
| const char * lv_fragment = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_entry); | |
| SP_GC_ROOT(lv_fragment); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT_RBVAL(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| sp_SymPolyHash *_t883 = sp_SymPolyHash_new(); | |
| sp_SymPolyHash_set(_t883, SPS_action, sp_box_sym(lv_action)); | |
| sp_SymPolyHash_set(_t883, SPS_stream, sp_box_str(lv_stream)); | |
| sp_SymPolyHash_set(_t883, SPS_target, sp_box_str(lv_target)); | |
| sp_SymPolyHash_set(_t883, SPS_html, lv_html); | |
| lv_entry = _t883; | |
| sp_PolyArray_push(cst_Broadcasts_LOG, sp_box_obj((void *)(lv_entry), SP_BUILTIN_SYM_POLY_HASH)); | |
| if ((sp_IntArray_length(cst_Broadcasts_TRANSPORTS) > 0LL)) { | |
| lv_fragment = sp_Broadcasts_cls_render_fragment(lv_action, lv_target, lv_html); | |
| sp_Broadcasts_SeedTransport_broadcast((sp_Broadcasts_SeedTransport *)sp_IntArray_get(cst_Broadcasts_TRANSPORTS, 0LL), lv_stream, lv_fragment); | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_Broadcasts_cls_render_fragment(sp_sym lv_action, const char * lv_target, sp_RbVal lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT_RBVAL(lv_html); | |
| SP_GC_ROOT(lv_target); | |
| if ((lv_action == SPS_remove)) { | |
| return sp_sprintf("<turbo-stream action=\"remove\" target=\"%s\"></turbo-stream>", lv_target); | |
| } else { | |
| return sp_sprintf("<turbo-stream action=\"%s\" target=\"%s\"><template>%s</template></turbo-stream>", sp_sym_to_s(lv_action), lv_target, sp_poly_to_s(lv_html)); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_PolyArray * sp_Importmap_cls_pins(void) { | |
| return NULL; | |
| } | |
| static inline const char * sp_Importmap_cls_entry(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_root_path(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_articles_path(void) { | |
| SP_GC_SAVE(); | |
| return (&("\xff" "/articles")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_new_article_path(void) { | |
| SP_GC_SAVE(); | |
| return (&("\xff" "/articles/new")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_article_path(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| return sp_sprintf("/articles/%lld", (long long)lv_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_edit_article_path(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| return sp_sprintf("/articles/%lld/edit", (long long)lv_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_article_comments_path(mrb_int lv_article_id) { | |
| SP_GC_SAVE(); | |
| return sp_sprintf("/articles/%lld/comments", (long long)lv_article_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_article_comment_path(sp_RbVal lv_article_id, mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_article_id); | |
| return sp_sprintf("/articles/%s/comments/%lld", sp_poly_to_s(lv_article_id), (long long)lv_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_String * sp_Views_Comments_cls_comment(sp_Comment * lv_comment, sp_String * lv_notice, sp_String * lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_comment); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(lv_comment); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| lv_io = sp_String_new(""); | |
| const char *_t884 = sp_ActionView_ViewHelpers_cls_dom_id(sp_box_obj(lv_comment, 65), ((void)(0), sp_box_nil())); | |
| SP_GC_ROOT(_t884); | |
| const char *_t885 = sp_ActionView_ViewHelpers_cls_html_escape(lv_comment->iv_commenter); | |
| SP_GC_ROOT(_t885); | |
| const char *_t886 = sp_ActionView_ViewHelpers_cls_html_escape(lv_comment->iv_body); | |
| SP_GC_ROOT(_t886); | |
| const char *_t887 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_article_comment_path(lv_comment->iv_article_id, lv_comment->iv_id))); | |
| SP_GC_ROOT(_t887); | |
| const char *_t888 = sp_ActionView_ViewHelpers_cls_method_override_input(SPS_delete); | |
| SP_GC_ROOT(_t888); | |
| const char *_t889 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t889); | |
| sp_String_append(lv_io, sp_sprintf("<div id=\"%s\" class=\"p-4 bg-gray-50 rounded\">\n <p class=\"font-semibold\">%s</p>\n <p class=\"text-gray-700\">%s</p>\n <form action=\"%s\" method=\"post\" class=\"%s\">%s<button type=\"submit\" class=\"%s\" data-turbo-confirm=\"%s\">%s</button>%s</form>\n</div>\n", _t884, _t885, _t886, _t887, (&("\xff" "button_to")[1]), _t888, (&("\xff" "text-red-600 text-sm mt-2")[1]), (&("\xff" "Are you sure?")[1]), (&("\xff" "Delete")[1]), _t889)); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static inline const char * sp_Inflector_cls_pluralize(mrb_int lv_count, const char * lv_word) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_word); | |
| SP_GC_ROOT(lv_word); | |
| if ((lv_count == 1LL)) { | |
| return sp_sprintf("1 %s", lv_word); | |
| } else { | |
| return sp_sprintf("%lld %ss", (long long)lv_count, lv_word); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_String * sp_Views_Articles_cls_article(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| lv_io = sp_String_new(""); | |
| sp_RbVal _t890 = lv_article; | |
| mrb_int _t891 = 0; | |
| if (_t890.tag == SP_TAG_OBJ) { | |
| if (_t890.cls_id == 50) _t891 = ((sp_ActiveRecord_Base *)_t890.v.p)->iv_id; | |
| if (_t890.cls_id == 63) _t891 = ((sp_ApplicationRecord *)_t890.v.p)->iv_id; | |
| if (_t890.cls_id == 64) _t891 = sp_CommentRow_id((sp_CommentRow *)_t890.v.p); | |
| if (_t890.cls_id == 65) _t891 = sp_Comment_id((sp_Comment *)_t890.v.p); | |
| if (_t890.cls_id == 66) _t891 = sp_ArticleRow_id((sp_ArticleRow *)_t890.v.p); | |
| if (_t890.cls_id == 76) _t891 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t890.v.p); | |
| if (_t890.cls_id == 77) _t891 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t890.v.p); | |
| if (_t890.cls_id == 78) _t891 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t890.v.p); | |
| if (_t890.cls_id == 79) _t891 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t890.v.p); | |
| if (_t890.cls_id == 80) _t891 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t890.v.p); | |
| if (_t890.cls_id == 81) _t891 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t890.v.p); | |
| } | |
| sp_RbVal _t892 = lv_article; | |
| sp_RbVal _t893 = sp_box_nil(); | |
| if (_t892.tag == SP_TAG_OBJ) { | |
| if (_t892.cls_id == 66) _t893 = sp_box_str(sp_ArticleRow_title((sp_ArticleRow *)_t892.v.p)); | |
| if (_t892.cls_id == 68) _t893 = sp_ArticleParams_title((sp_ArticleParams *)_t892.v.p); | |
| if (_t892.cls_id == 76) _t893 = sp_Article__implicit_6872_title((sp_Article__implicit_6872 *)_t892.v.p); | |
| if (_t892.cls_id == 77) _t893 = sp_Article__implicit_6906_title((sp_Article__implicit_6906 *)_t892.v.p); | |
| if (_t892.cls_id == 78) _t893 = sp_Article__implicit_7484_title((sp_Article__implicit_7484 *)_t892.v.p); | |
| if (_t892.cls_id == 79) _t893 = sp_Article__implicit_7995_title((sp_Article__implicit_7995 *)_t892.v.p); | |
| if (_t892.cls_id == 80) _t893 = sp_Article__implicit_9355_title((sp_Article__implicit_9355 *)_t892.v.p); | |
| if (_t892.cls_id == 81) _t893 = sp_Article__implicit_9372_title((sp_Article__implicit_9372 *)_t892.v.p); | |
| } | |
| sp_RbVal _t894 = lv_article; | |
| sp_RbVal _t895 = sp_box_nil(); | |
| if (_t894.tag == SP_TAG_OBJ) { | |
| if (_t894.cls_id == 76) _t895 = sp_Article__implicit_6872_comments((sp_Article__implicit_6872 *)_t894.v.p); | |
| if (_t894.cls_id == 77) _t895 = sp_box_ptr_array(sp_Article__implicit_6906_comments((sp_Article__implicit_6906 *)_t894.v.p)); | |
| if (_t894.cls_id == 78) _t895 = sp_Article__implicit_7484_comments((sp_Article__implicit_7484 *)_t894.v.p); | |
| if (_t894.cls_id == 79) _t895 = sp_Article__implicit_7995_comments((sp_Article__implicit_7995 *)_t894.v.p); | |
| if (_t894.cls_id == 80) _t895 = sp_Article__implicit_9355_comments((sp_Article__implicit_9355 *)_t894.v.p); | |
| if (_t894.cls_id == 81) _t895 = sp_Article__implicit_9372_comments((sp_Article__implicit_9372 *)_t894.v.p); | |
| } | |
| sp_RbVal _t896 = _t895; | |
| mrb_int _t897 = 0; | |
| if (_t896.tag == SP_TAG_STR) _t897 = sp_str_length(_t896.v.s); | |
| if (_t896.tag == SP_TAG_OBJ) { | |
| if (_t896.cls_id == 49) _t897 = ((sp_ActiveRecord_ConnectionAdapters_ConnectionPool *)_t896.v.p)->iv_size; | |
| if (_t896.cls_id == 53) _t897 = sp_ActionDispatch_Flash_size((sp_ActionDispatch_Flash *)_t896.v.p); | |
| if (_t896.cls_id == 54) _t897 = sp_ActionDispatch_Session_size((sp_ActionDispatch_Session *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_INT_ARRAY) _t897 = sp_IntArray_length((sp_IntArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_FLT_ARRAY) _t897 = sp_FloatArray_length((sp_FloatArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_STR_ARRAY) _t897 = sp_StrArray_length((sp_StrArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_SYM_ARRAY) _t897 = sp_IntArray_length((sp_IntArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_PTR_ARRAY) _t897 = sp_PtrArray_length((sp_PtrArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_POLY_ARRAY) _t897 = sp_PolyArray_length((sp_PolyArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_STR_INT_HASH) _t897 = sp_StrIntHash_length((sp_StrIntHash *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_STR_STR_HASH) _t897 = sp_StrStrHash_length((sp_StrStrHash *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_INT_STR_HASH) _t897 = sp_IntStrHash_length((sp_IntStrHash *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_STR_POLY_HASH) _t897 = sp_StrPolyHash_length((sp_StrPolyHash *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t897 = sp_SymPolyHash_length((sp_SymPolyHash *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t897 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_INT_ARRAY) _t897 = sp_IntArray_length((sp_IntArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_FLT_ARRAY) _t897 = sp_FloatArray_length((sp_FloatArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_STR_ARRAY) _t897 = sp_StrArray_length((sp_StrArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_SYM_ARRAY) _t897 = sp_IntArray_length((sp_IntArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_PTR_ARRAY) _t897 = sp_PtrArray_length((sp_PtrArray *)_t896.v.p); | |
| if (_t896.cls_id == SP_BUILTIN_POLY_ARRAY) _t897 = sp_PolyArray_length((sp_PolyArray *)_t896.v.p); | |
| } | |
| sp_RbVal _t898 = lv_article; | |
| sp_RbVal _t899 = sp_box_nil(); | |
| if (_t898.tag == SP_TAG_OBJ) { | |
| if (_t898.cls_id == 56) _t899 = ((sp_ActionController_Base *)_t898.v.p)->iv_body; | |
| if (_t898.cls_id == 62) _t899 = ((sp_ApplicationController *)_t898.v.p)->iv_body; | |
| if (_t898.cls_id == 64) _t899 = sp_box_str(sp_CommentRow_body((sp_CommentRow *)_t898.v.p)); | |
| if (_t898.cls_id == 65) _t899 = sp_Comment_body((sp_Comment *)_t898.v.p); | |
| if (_t898.cls_id == 66) _t899 = sp_box_str(sp_ArticleRow_body((sp_ArticleRow *)_t898.v.p)); | |
| if (_t898.cls_id == 68) _t899 = sp_ArticleParams_body((sp_ArticleParams *)_t898.v.p); | |
| if (_t898.cls_id == 69) _t899 = ((sp_ArticlesController *)_t898.v.p)->iv_body; | |
| if (_t898.cls_id == 70) _t899 = sp_CommentParams_body((sp_CommentParams *)_t898.v.p); | |
| if (_t898.cls_id == 71) _t899 = ((sp_CommentsController *)_t898.v.p)->iv_body; | |
| if (_t898.cls_id == 72) _t899 = ((sp_ActionResponse *)_t898.v.p)->iv_body; | |
| if (_t898.cls_id == 76) _t899 = sp_Article__implicit_6872_body((sp_Article__implicit_6872 *)_t898.v.p); | |
| if (_t898.cls_id == 77) _t899 = sp_Article__implicit_6906_body((sp_Article__implicit_6906 *)_t898.v.p); | |
| if (_t898.cls_id == 78) _t899 = sp_Article__implicit_7484_body((sp_Article__implicit_7484 *)_t898.v.p); | |
| if (_t898.cls_id == 79) _t899 = sp_Article__implicit_7995_body((sp_Article__implicit_7995 *)_t898.v.p); | |
| if (_t898.cls_id == 80) _t899 = sp_Article__implicit_9355_body((sp_Article__implicit_9355 *)_t898.v.p); | |
| if (_t898.cls_id == 81) _t899 = sp_Article__implicit_9372_body((sp_Article__implicit_9372 *)_t898.v.p); | |
| } | |
| sp_RbVal _t900 = lv_article; | |
| mrb_int _t901 = 0; | |
| if (_t900.tag == SP_TAG_OBJ) { | |
| if (_t900.cls_id == 50) _t901 = ((sp_ActiveRecord_Base *)_t900.v.p)->iv_id; | |
| if (_t900.cls_id == 63) _t901 = ((sp_ApplicationRecord *)_t900.v.p)->iv_id; | |
| if (_t900.cls_id == 64) _t901 = sp_CommentRow_id((sp_CommentRow *)_t900.v.p); | |
| if (_t900.cls_id == 65) _t901 = sp_Comment_id((sp_Comment *)_t900.v.p); | |
| if (_t900.cls_id == 66) _t901 = sp_ArticleRow_id((sp_ArticleRow *)_t900.v.p); | |
| if (_t900.cls_id == 76) _t901 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t900.v.p); | |
| if (_t900.cls_id == 77) _t901 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t900.v.p); | |
| if (_t900.cls_id == 78) _t901 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t900.v.p); | |
| if (_t900.cls_id == 79) _t901 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t900.v.p); | |
| if (_t900.cls_id == 80) _t901 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t900.v.p); | |
| if (_t900.cls_id == 81) _t901 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t900.v.p); | |
| } | |
| sp_RbVal _t902 = lv_article; | |
| mrb_int _t903 = 0; | |
| if (_t902.tag == SP_TAG_OBJ) { | |
| if (_t902.cls_id == 50) _t903 = ((sp_ActiveRecord_Base *)_t902.v.p)->iv_id; | |
| if (_t902.cls_id == 63) _t903 = ((sp_ApplicationRecord *)_t902.v.p)->iv_id; | |
| if (_t902.cls_id == 64) _t903 = sp_CommentRow_id((sp_CommentRow *)_t902.v.p); | |
| if (_t902.cls_id == 65) _t903 = sp_Comment_id((sp_Comment *)_t902.v.p); | |
| if (_t902.cls_id == 66) _t903 = sp_ArticleRow_id((sp_ArticleRow *)_t902.v.p); | |
| if (_t902.cls_id == 76) _t903 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t902.v.p); | |
| if (_t902.cls_id == 77) _t903 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t902.v.p); | |
| if (_t902.cls_id == 78) _t903 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t902.v.p); | |
| if (_t902.cls_id == 79) _t903 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t902.v.p); | |
| if (_t902.cls_id == 80) _t903 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t902.v.p); | |
| if (_t902.cls_id == 81) _t903 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t902.v.p); | |
| } | |
| sp_RbVal _t904 = lv_article; | |
| mrb_int _t905 = 0; | |
| if (_t904.tag == SP_TAG_OBJ) { | |
| if (_t904.cls_id == 50) _t905 = ((sp_ActiveRecord_Base *)_t904.v.p)->iv_id; | |
| if (_t904.cls_id == 63) _t905 = ((sp_ApplicationRecord *)_t904.v.p)->iv_id; | |
| if (_t904.cls_id == 64) _t905 = sp_CommentRow_id((sp_CommentRow *)_t904.v.p); | |
| if (_t904.cls_id == 65) _t905 = sp_Comment_id((sp_Comment *)_t904.v.p); | |
| if (_t904.cls_id == 66) _t905 = sp_ArticleRow_id((sp_ArticleRow *)_t904.v.p); | |
| if (_t904.cls_id == 76) _t905 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t904.v.p); | |
| if (_t904.cls_id == 77) _t905 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t904.v.p); | |
| if (_t904.cls_id == 78) _t905 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t904.v.p); | |
| if (_t904.cls_id == 79) _t905 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t904.v.p); | |
| if (_t904.cls_id == 80) _t905 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t904.v.p); | |
| if (_t904.cls_id == 81) _t905 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t904.v.p); | |
| } | |
| const char *_t906 = sp_ActionView_ViewHelpers_cls_dom_id(lv_article, ((void)(0), sp_box_nil())); | |
| SP_GC_ROOT(_t906); | |
| const char *_t907 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_article_path(_t891))); | |
| SP_GC_ROOT(_t907); | |
| const char *_t908 = sp_ActionView_ViewHelpers_cls_html_escape(_t893); | |
| SP_GC_ROOT(_t908); | |
| const char *_t909 = sp_ActionView_ViewHelpers_cls_dom_id(lv_article, sp_box_sym(SPS_comments_count)); | |
| SP_GC_ROOT(_t909); | |
| const char *_t910 = sp_Inflector_cls_pluralize(_t897, (&("\xff" "comment")[1])); | |
| SP_GC_ROOT(_t910); | |
| const char *_t911 = sp_ActionView_ViewHelpers_cls_html_escape(sp_ActionView_ViewHelpers_cls_truncate(_t899, 100LL, (&("\xff" "...")[1]))); | |
| SP_GC_ROOT(_t911); | |
| const char *_t912 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_article_path(_t901))); | |
| SP_GC_ROOT(_t912); | |
| const char *_t913 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_edit_article_path(_t903))); | |
| SP_GC_ROOT(_t913); | |
| const char *_t914 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_article_path(_t905))); | |
| SP_GC_ROOT(_t914); | |
| const char *_t915 = sp_ActionView_ViewHelpers_cls_method_override_input(SPS_delete); | |
| SP_GC_ROOT(_t915); | |
| const char *_t916 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t916); | |
| sp_String_append(lv_io, sp_sprintf("<div id=\"%s\" class=\"flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0\">\n <div class=\"p-4 border rounded mb-4 flex-grow\">\n <h2 class=\"text-xl font-bold\">\n <a href=\"%s\" class=\"%s\">%s</a>\n <span id=\"%s\" class=\"text-gray-500 text-sm font-normal ml-2\">\n (%s)\n </span>\n </h2>\n <p class=\"text-gray-700 mt-2\">%s</p>\n </div>\n <div class=\"w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2\">\n <a href=\"%s\" class=\"%s\">%s</a>\n <a href=\"%s\" class=\"%s\">%s</a>\n <form action=\"%s\" method=\"post\" class=\"%s\">%s<button type=\"submit\" class=\"%s\" data-turbo-confirm=\"%s\">%s</button>%s</form>\n </div>\n</div>\n", _t906, _t907, (&("\xff" "text-blue-600 hover:underline")[1]), _t908, _t909, _t910, _t911, _t912, (&("\xff" "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Show")[1]), _t913, (&("\xff" "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Edit")[1]), _t914, (&("\xff" "button_to")[1]), _t915, (&("\xff" "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer")[1]), (&("\xff" "Are you sure?")[1]), (&("\xff" "Destroy")[1]), _t916)); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_form(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| sp_sym lv_form_method = ((sp_sym)-1); | |
| const char * lv_error = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_error); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| lv_io = sp_String_new(""); | |
| sp_RbVal _t917 = lv_article; | |
| mrb_bool _t918 = FALSE; | |
| if (_t917.tag == SP_TAG_OBJ) { | |
| if (_t917.cls_id == 50) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 63) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 65) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 76) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 77) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 78) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 79) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 80) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| if (_t917.cls_id == 81) _t918 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t917.v.p); | |
| } | |
| lv_form_method = (_t918 ? SPS_patch : SPS_post); | |
| sp_RbVal _t919 = lv_article; | |
| mrb_bool _t920 = FALSE; | |
| if (_t919.tag == SP_TAG_OBJ) { | |
| if (_t919.cls_id == 50) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 63) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 65) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 76) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 77) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 78) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 79) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 80) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| if (_t919.cls_id == 81) _t920 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t919.v.p); | |
| } | |
| sp_RbVal _t921 = lv_article; | |
| mrb_int _t922 = 0; | |
| if (_t921.tag == SP_TAG_OBJ) { | |
| if (_t921.cls_id == 50) _t922 = ((sp_ActiveRecord_Base *)_t921.v.p)->iv_id; | |
| if (_t921.cls_id == 63) _t922 = ((sp_ApplicationRecord *)_t921.v.p)->iv_id; | |
| if (_t921.cls_id == 64) _t922 = sp_CommentRow_id((sp_CommentRow *)_t921.v.p); | |
| if (_t921.cls_id == 65) _t922 = sp_Comment_id((sp_Comment *)_t921.v.p); | |
| if (_t921.cls_id == 66) _t922 = sp_ArticleRow_id((sp_ArticleRow *)_t921.v.p); | |
| if (_t921.cls_id == 76) _t922 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t921.v.p); | |
| if (_t921.cls_id == 77) _t922 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t921.v.p); | |
| if (_t921.cls_id == 78) _t922 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t921.v.p); | |
| if (_t921.cls_id == 79) _t922 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t921.v.p); | |
| if (_t921.cls_id == 80) _t922 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t921.v.p); | |
| if (_t921.cls_id == 81) _t922 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t921.v.p); | |
| } | |
| const char *_t923 = sp_ActionView_ViewHelpers_cls_html_escape((_t920 ? sp_box_str(sp_RouteHelpers_cls_article_path(_t922)) : sp_box_str(sp_RouteHelpers_cls_articles_path()))); | |
| SP_GC_ROOT(_t923); | |
| const char *_t924 = sp_ActionView_ViewHelpers_cls_method_override_input(lv_form_method); | |
| SP_GC_ROOT(_t924); | |
| const char *_t925 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t925); | |
| sp_String_append(lv_io, sp_sprintf("<form action=\"%s\" accept-charset=\"UTF-8\" method=\"post\" class=\"%s\">%s%s\n", _t923, (&("\xff" "contents")[1]), _t924, _t925)); | |
| sp_RbVal _t926 = lv_article; | |
| sp_StrArray * _t927 = NULL; | |
| if (_t926.tag == SP_TAG_OBJ) { | |
| if (_t926.cls_id == 50) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 63) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 65) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 76) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 77) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 78) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 79) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 80) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 81) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| } | |
| sp_StrArray * _t928 = _t927; | |
| SP_GC_ROOT(_t928); | |
| if ((!sp_StrArray_empty(_t928))) { | |
| sp_RbVal _t929 = lv_article; | |
| sp_StrArray * _t930 = NULL; | |
| if (_t929.tag == SP_TAG_OBJ) { | |
| if (_t929.cls_id == 50) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 63) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 65) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 76) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 77) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 78) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 79) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 80) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 81) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| } | |
| sp_StrArray * _t931 = _t930; | |
| SP_GC_ROOT(_t931); | |
| sp_String_append(lv_io, sp_sprintf(" <div id=\"error_explanation\" class=\"bg-red-50 text-red-500 px-3 py-2 font-medium rounded-md mt-3\">\n <h2>%s prohibited this article from being saved:</h2>\n\n <ul class=\"list-disc ml-6\">\n ", sp_Inflector_cls_pluralize(sp_StrArray_length(_t931), (&("\xff" "error")[1])))); | |
| sp_RbVal _t932 = lv_article; | |
| sp_StrArray * _t933 = NULL; | |
| if (_t932.tag == SP_TAG_OBJ) { | |
| if (_t932.cls_id == 50) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 63) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 65) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 76) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 77) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 78) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 79) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 80) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| if (_t932.cls_id == 81) _t933 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t932.v.p); | |
| } | |
| sp_StrArray * _t934 = _t933; | |
| SP_GC_ROOT(_t934); | |
| for (mrb_int _t935 = 0; _t935 < sp_StrArray_length(_t934); _t935++) { | |
| const char * lv_error = sp_StrArray_get(_t934, _t935); | |
| sp_redo_33: ; | |
| sp_String_append(lv_io, sp_sprintf("\n <li>%s</li>\n ", sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(lv_error)))); | |
| } | |
| sp_String_append(lv_io, (&("\xff" "\n </ul>\n </div>\n")[1])); | |
| } | |
| sp_RbVal _t936 = lv_article; | |
| sp_RbVal _t937 = sp_box_nil(); | |
| if (_t936.tag == SP_TAG_OBJ) { | |
| if (_t936.cls_id == 50) _t937 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 53) _t937 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 54) _t937 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 63) _t937 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 65) _t937 = sp_Comment__aref((sp_Comment *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 76) _t937 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 77) _t937 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 78) _t937 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 79) _t937 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 80) _t937 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == 81) _t937 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t936.v.p, sp_box_sym(SPS_title)); | |
| if (_t936.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t937 = sp_SymPolyHash_get((sp_SymPolyHash *)_t936.v.p, SPS_title); | |
| if (_t936.cls_id == SP_BUILTIN_SYM_INT_HASH) _t937 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t936.v.p, SPS_title)); | |
| if (_t936.cls_id == SP_BUILTIN_SYM_STR_HASH) _t937 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t936.v.p, SPS_title)); | |
| } | |
| sp_RbVal _t938 = lv_article; | |
| sp_RbVal _t939 = sp_box_nil(); | |
| if (_t938.tag == SP_TAG_OBJ) { | |
| if (_t938.cls_id == 50) _t939 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 53) _t939 = sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 54) _t939 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 63) _t939 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 65) _t939 = sp_Comment__aref((sp_Comment *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 76) _t939 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 77) _t939 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 78) _t939 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 79) _t939 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 80) _t939 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == 81) _t939 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t938.v.p, sp_box_sym(SPS_body)); | |
| if (_t938.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t939 = sp_SymPolyHash_get((sp_SymPolyHash *)_t938.v.p, SPS_body); | |
| if (_t938.cls_id == SP_BUILTIN_SYM_INT_HASH) _t939 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t938.v.p, SPS_body)); | |
| if (_t938.cls_id == SP_BUILTIN_SYM_STR_HASH) _t939 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t938.v.p, SPS_body)); | |
| } | |
| const char *_t940 = sp_ActionView_ViewHelpers_cls_optional_value_attr(_t937); | |
| SP_GC_ROOT(_t940); | |
| const char *_t941 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_int_to_s(4LL))); | |
| SP_GC_ROOT(_t941); | |
| const char *_t942 = sp_ActionView_ViewHelpers_cls_escape_or_empty(_t939); | |
| SP_GC_ROOT(_t942); | |
| const char *_t943 = sp_ActionView_ViewHelpers_cls_html_escape(((lv_form_method == SPS_patch) ? sp_box_str((&("\xff" "Update Article")[1])) : sp_box_str((&("\xff" "Create Article")[1])))); | |
| SP_GC_ROOT(_t943); | |
| const char *_t944 = sp_ActionView_ViewHelpers_cls_html_escape(((lv_form_method == SPS_patch) ? sp_box_str((&("\xff" "Update Article")[1])) : sp_box_str((&("\xff" "Create Article")[1])))); | |
| SP_GC_ROOT(_t944); | |
| sp_String_append(lv_io, sp_sprintf("\n <div class=\"my-5\">\n <label for=\"article_title\">Title</label>\n <input type=\"text\" name=\"article[title]\" id=\"article_title\"%s class=\"%s\">\n </div>\n\n <div class=\"my-5\">\n <label for=\"article_body\">Body</label>\n <textarea name=\"article[body]\" id=\"article_body\" rows=\"%s\" class=\"%s\">%s</textarea>\n </div>\n\n <div class=\"inline\">\n <input type=\"submit\" name=\"commit\" value=\"%s\" data-disable-with=\"%s\" class=\"%s\">\n </div>\n</form>", _t940, (&("\xff" "block shadow-sm rounded-md border px-3 py-2 mt-2 w-full border-gray-400 focus:outline-blue-600")[1]), _t941, (&("\xff" "block shadow-sm rounded-md border px-3 py-2 mt-2 w-full border-gray-400 focus:outline-blue-600")[1]), _t942, _t943, _t944, (&("\xff" "w-full sm:w-auto rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer")[1]))); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_index(sp_PtrArray * lv_articles, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| sp_Article__implicit_6906 * lv_a = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_a); | |
| SP_GC_ROOT(lv_articles); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| SP_GC_ROOT(lv_articles); | |
| lv_io = sp_String_new(""); | |
| sp_String_append(lv_io, sp_sprintf("%s\n\n", sp_ActionView_ViewHelpers_cls_turbo_stream_from((&("\xff" "articles")[1])))); | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "Articles")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\n<div class=\"w-full\">\n")[1])); | |
| mrb_bool _t945 = (!sp_poly_nil_p(lv_notice)); | |
| mrb_bool _t946 = FALSE; | |
| if (_t945) { | |
| sp_RbVal _t947 = lv_notice; | |
| mrb_bool _t948 = FALSE; | |
| if (_t947.tag == SP_TAG_STR) _t948 = (sp_str_length(_t947.v.s) == 0); | |
| if (_t947.tag == SP_TAG_OBJ) { | |
| if (_t947.cls_id == 53) _t948 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t947.v.p); | |
| if (_t947.cls_id == 54) _t948 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t947.v.p); | |
| if (_t947.cls_id == SP_BUILTIN_INT_ARRAY) _t948 = (sp_IntArray_length((sp_IntArray *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_FLT_ARRAY) _t948 = (sp_FloatArray_length((sp_FloatArray *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_STR_ARRAY) _t948 = (sp_StrArray_length((sp_StrArray *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_SYM_ARRAY) _t948 = (sp_IntArray_length((sp_IntArray *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_PTR_ARRAY) _t948 = (sp_PtrArray_length((sp_PtrArray *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_POLY_ARRAY) _t948 = (sp_PolyArray_length((sp_PolyArray *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_STR_INT_HASH) _t948 = (sp_StrIntHash_length((sp_StrIntHash *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_STR_STR_HASH) _t948 = (sp_StrStrHash_length((sp_StrStrHash *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_INT_STR_HASH) _t948 = (sp_IntStrHash_length((sp_IntStrHash *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_STR_POLY_HASH) _t948 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t948 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t947.v.p) == 0); | |
| if (_t947.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t948 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t947.v.p) == 0); | |
| } | |
| _t946 = (!_t948); | |
| } else { | |
| _t946 = _t945; | |
| } | |
| if (_t946) { | |
| sp_String_append(lv_io, sp_sprintf(" <p class=\"py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block\" id=\"notice\">%s</p>\n", sp_ActionView_ViewHelpers_cls_html_escape(lv_notice))); | |
| } | |
| sp_String_append(lv_io, sp_sprintf("\n <div class=\"flex justify-between items-center\">\n <h1 class=\"font-bold text-4xl\">Articles</h1>\n <a href=\"%s\" class=\"%s\">%s</a>\n </div>\n\n <div id=\"articles\" class=\"min-w-full divide-y divide-gray-200 space-y-5\">\n", sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_new_article_path())), (&("\xff" "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium")[1]), (&("\xff" "New article")[1]))); | |
| if ((!sp_PtrArray_empty(lv_articles))) { | |
| sp_String_append(lv_io, (&("\xff" " ")[1])); | |
| for (mrb_int _t949 = 0; _t949 < sp_PtrArray_length(lv_articles); _t949++) { | |
| sp_Article__implicit_6906 * _t950 = (sp_Article__implicit_6906 *)sp_PtrArray_get(lv_articles, _t949); | |
| lv_a = _t950; | |
| sp_redo_34: ; | |
| sp_String_append(lv_io, sp_Views_Articles_cls_article(sp_box_obj(lv_a, 77), 0, 0)->data); | |
| } | |
| sp_String_append(lv_io, (&("\xff" "\n")[1])); | |
| } else { | |
| sp_String_append(lv_io, (&("\xff" " <p class=\"text-center my-10\">No articles found.</p>\n")[1])); | |
| } | |
| sp_String_append(lv_io, (&("\xff" " </div>\n</div>\n")[1])); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_show(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| mrb_int lv_c = 0; | |
| sp_Comment * lv_form_record = NULL; | |
| sp_sym lv_form_method = ((sp_sym)-1); | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_form_record); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| lv_io = sp_String_new(""); | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "Showing article")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\n<div class=\"md:w-2/3 w-full\">\n")[1])); | |
| mrb_bool _t951 = (!sp_poly_nil_p(lv_notice)); | |
| mrb_bool _t952 = FALSE; | |
| if (_t951) { | |
| sp_RbVal _t953 = lv_notice; | |
| mrb_bool _t954 = FALSE; | |
| if (_t953.tag == SP_TAG_STR) _t954 = (sp_str_length(_t953.v.s) == 0); | |
| if (_t953.tag == SP_TAG_OBJ) { | |
| if (_t953.cls_id == 53) _t954 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t953.v.p); | |
| if (_t953.cls_id == 54) _t954 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t953.v.p); | |
| if (_t953.cls_id == SP_BUILTIN_INT_ARRAY) _t954 = (sp_IntArray_length((sp_IntArray *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_FLT_ARRAY) _t954 = (sp_FloatArray_length((sp_FloatArray *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_STR_ARRAY) _t954 = (sp_StrArray_length((sp_StrArray *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_SYM_ARRAY) _t954 = (sp_IntArray_length((sp_IntArray *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_PTR_ARRAY) _t954 = (sp_PtrArray_length((sp_PtrArray *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_POLY_ARRAY) _t954 = (sp_PolyArray_length((sp_PolyArray *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_STR_INT_HASH) _t954 = (sp_StrIntHash_length((sp_StrIntHash *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_STR_STR_HASH) _t954 = (sp_StrStrHash_length((sp_StrStrHash *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_INT_STR_HASH) _t954 = (sp_IntStrHash_length((sp_IntStrHash *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_STR_POLY_HASH) _t954 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t954 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t953.v.p) == 0); | |
| if (_t953.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t954 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t953.v.p) == 0); | |
| } | |
| _t952 = (!_t954); | |
| } else { | |
| _t952 = _t951; | |
| } | |
| if (_t952) { | |
| sp_String_append(lv_io, sp_sprintf(" <p class=\"py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block\" id=\"notice\">%s</p>\n", sp_ActionView_ViewHelpers_cls_html_escape(lv_notice))); | |
| } | |
| sp_RbVal _t955 = lv_article; | |
| sp_RbVal _t956 = sp_box_nil(); | |
| if (_t955.tag == SP_TAG_OBJ) { | |
| if (_t955.cls_id == 66) _t956 = sp_box_str(sp_ArticleRow_title((sp_ArticleRow *)_t955.v.p)); | |
| if (_t955.cls_id == 68) _t956 = sp_ArticleParams_title((sp_ArticleParams *)_t955.v.p); | |
| if (_t955.cls_id == 76) _t956 = sp_Article__implicit_6872_title((sp_Article__implicit_6872 *)_t955.v.p); | |
| if (_t955.cls_id == 77) _t956 = sp_Article__implicit_6906_title((sp_Article__implicit_6906 *)_t955.v.p); | |
| if (_t955.cls_id == 78) _t956 = sp_Article__implicit_7484_title((sp_Article__implicit_7484 *)_t955.v.p); | |
| if (_t955.cls_id == 79) _t956 = sp_Article__implicit_7995_title((sp_Article__implicit_7995 *)_t955.v.p); | |
| if (_t955.cls_id == 80) _t956 = sp_Article__implicit_9355_title((sp_Article__implicit_9355 *)_t955.v.p); | |
| if (_t955.cls_id == 81) _t956 = sp_Article__implicit_9372_title((sp_Article__implicit_9372 *)_t955.v.p); | |
| } | |
| sp_RbVal _t957 = lv_article; | |
| sp_RbVal _t958 = sp_box_nil(); | |
| if (_t957.tag == SP_TAG_OBJ) { | |
| if (_t957.cls_id == 56) _t958 = ((sp_ActionController_Base *)_t957.v.p)->iv_body; | |
| if (_t957.cls_id == 62) _t958 = ((sp_ApplicationController *)_t957.v.p)->iv_body; | |
| if (_t957.cls_id == 64) _t958 = sp_box_str(sp_CommentRow_body((sp_CommentRow *)_t957.v.p)); | |
| if (_t957.cls_id == 65) _t958 = sp_Comment_body((sp_Comment *)_t957.v.p); | |
| if (_t957.cls_id == 66) _t958 = sp_box_str(sp_ArticleRow_body((sp_ArticleRow *)_t957.v.p)); | |
| if (_t957.cls_id == 68) _t958 = sp_ArticleParams_body((sp_ArticleParams *)_t957.v.p); | |
| if (_t957.cls_id == 69) _t958 = ((sp_ArticlesController *)_t957.v.p)->iv_body; | |
| if (_t957.cls_id == 70) _t958 = sp_CommentParams_body((sp_CommentParams *)_t957.v.p); | |
| if (_t957.cls_id == 71) _t958 = ((sp_CommentsController *)_t957.v.p)->iv_body; | |
| if (_t957.cls_id == 72) _t958 = ((sp_ActionResponse *)_t957.v.p)->iv_body; | |
| if (_t957.cls_id == 76) _t958 = sp_Article__implicit_6872_body((sp_Article__implicit_6872 *)_t957.v.p); | |
| if (_t957.cls_id == 77) _t958 = sp_Article__implicit_6906_body((sp_Article__implicit_6906 *)_t957.v.p); | |
| if (_t957.cls_id == 78) _t958 = sp_Article__implicit_7484_body((sp_Article__implicit_7484 *)_t957.v.p); | |
| if (_t957.cls_id == 79) _t958 = sp_Article__implicit_7995_body((sp_Article__implicit_7995 *)_t957.v.p); | |
| if (_t957.cls_id == 80) _t958 = sp_Article__implicit_9355_body((sp_Article__implicit_9355 *)_t957.v.p); | |
| if (_t957.cls_id == 81) _t958 = sp_Article__implicit_9372_body((sp_Article__implicit_9372 *)_t957.v.p); | |
| } | |
| sp_RbVal _t959 = lv_article; | |
| mrb_int _t960 = 0; | |
| if (_t959.tag == SP_TAG_OBJ) { | |
| if (_t959.cls_id == 50) _t960 = ((sp_ActiveRecord_Base *)_t959.v.p)->iv_id; | |
| if (_t959.cls_id == 63) _t960 = ((sp_ApplicationRecord *)_t959.v.p)->iv_id; | |
| if (_t959.cls_id == 64) _t960 = sp_CommentRow_id((sp_CommentRow *)_t959.v.p); | |
| if (_t959.cls_id == 65) _t960 = sp_Comment_id((sp_Comment *)_t959.v.p); | |
| if (_t959.cls_id == 66) _t960 = sp_ArticleRow_id((sp_ArticleRow *)_t959.v.p); | |
| if (_t959.cls_id == 76) _t960 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t959.v.p); | |
| if (_t959.cls_id == 77) _t960 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t959.v.p); | |
| if (_t959.cls_id == 78) _t960 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t959.v.p); | |
| if (_t959.cls_id == 79) _t960 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t959.v.p); | |
| if (_t959.cls_id == 80) _t960 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t959.v.p); | |
| if (_t959.cls_id == 81) _t960 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t959.v.p); | |
| } | |
| sp_RbVal _t961 = lv_article; | |
| mrb_int _t962 = 0; | |
| if (_t961.tag == SP_TAG_OBJ) { | |
| if (_t961.cls_id == 50) _t962 = ((sp_ActiveRecord_Base *)_t961.v.p)->iv_id; | |
| if (_t961.cls_id == 63) _t962 = ((sp_ApplicationRecord *)_t961.v.p)->iv_id; | |
| if (_t961.cls_id == 64) _t962 = sp_CommentRow_id((sp_CommentRow *)_t961.v.p); | |
| if (_t961.cls_id == 65) _t962 = sp_Comment_id((sp_Comment *)_t961.v.p); | |
| if (_t961.cls_id == 66) _t962 = sp_ArticleRow_id((sp_ArticleRow *)_t961.v.p); | |
| if (_t961.cls_id == 76) _t962 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t961.v.p); | |
| if (_t961.cls_id == 77) _t962 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t961.v.p); | |
| if (_t961.cls_id == 78) _t962 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t961.v.p); | |
| if (_t961.cls_id == 79) _t962 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t961.v.p); | |
| if (_t961.cls_id == 80) _t962 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t961.v.p); | |
| if (_t961.cls_id == 81) _t962 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t961.v.p); | |
| } | |
| sp_RbVal _t963 = lv_article; | |
| mrb_int _t964 = 0; | |
| if (_t963.tag == SP_TAG_OBJ) { | |
| if (_t963.cls_id == 50) _t964 = ((sp_ActiveRecord_Base *)_t963.v.p)->iv_id; | |
| if (_t963.cls_id == 63) _t964 = ((sp_ApplicationRecord *)_t963.v.p)->iv_id; | |
| if (_t963.cls_id == 64) _t964 = sp_CommentRow_id((sp_CommentRow *)_t963.v.p); | |
| if (_t963.cls_id == 65) _t964 = sp_Comment_id((sp_Comment *)_t963.v.p); | |
| if (_t963.cls_id == 66) _t964 = sp_ArticleRow_id((sp_ArticleRow *)_t963.v.p); | |
| if (_t963.cls_id == 76) _t964 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t963.v.p); | |
| if (_t963.cls_id == 77) _t964 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t963.v.p); | |
| if (_t963.cls_id == 78) _t964 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t963.v.p); | |
| if (_t963.cls_id == 79) _t964 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t963.v.p); | |
| if (_t963.cls_id == 80) _t964 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t963.v.p); | |
| if (_t963.cls_id == 81) _t964 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t963.v.p); | |
| } | |
| const char *_t965 = sp_ActionView_ViewHelpers_cls_html_escape(_t956); | |
| SP_GC_ROOT(_t965); | |
| const char *_t966 = sp_ActionView_ViewHelpers_cls_html_escape(_t958); | |
| SP_GC_ROOT(_t966); | |
| const char *_t967 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_edit_article_path(_t960))); | |
| SP_GC_ROOT(_t967); | |
| const char *_t968 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_articles_path())); | |
| SP_GC_ROOT(_t968); | |
| const char *_t969 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_article_path(_t962))); | |
| SP_GC_ROOT(_t969); | |
| const char *_t970 = sp_ActionView_ViewHelpers_cls_method_override_input(SPS_delete); | |
| SP_GC_ROOT(_t970); | |
| const char *_t971 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t971); | |
| const char *_t972 = sp_ActionView_ViewHelpers_cls_turbo_stream_from(sp_sprintf("article_%lld_comments", (long long)_t964)); | |
| SP_GC_ROOT(_t972); | |
| sp_String_append(lv_io, sp_sprintf("\n <h1 class=\"font-bold text-4xl\">%s</h1>\n\n <div class=\"my-4\">\n <p class=\"text-gray-700\">%s</p>\n </div>\n\n <a href=\"%s\" class=\"%s\">%s</a>\n <a href=\"%s\" class=\"%s\">%s</a>\n <form action=\"%s\" method=\"post\" class=\"%s\">%s<button type=\"submit\" class=\"%s\" data-turbo-confirm=\"%s\">%s</button>%s</form>\n</div>\n\n<hr class=\"my-8\">\n\n<h2 class=\"text-xl font-bold mb-4\">Comments</h2>\n\n%s\n\n<div id=\"comments\" class=\"space-y-4 mb-8\">\n ", _t965, _t966, _t967, (&("\xff" "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Edit this article")[1]), _t968, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Back to articles")[1]), _t969, (&("\xff" "sm:inline-block mt-2 sm:mt-0 sm:ml-2")[1]), _t970, (&("\xff" "w-full rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer")[1]), (&("\xff" "Are you sure?")[1]), (&("\xff" "Destroy this article")[1]), _t971, _t972)); | |
| sp_RbVal _t973 = lv_article; | |
| sp_RbVal _t974 = sp_box_nil(); | |
| if (_t973.tag == SP_TAG_OBJ) { | |
| if (_t973.cls_id == 76) _t974 = sp_Article__implicit_6872_comments((sp_Article__implicit_6872 *)_t973.v.p); | |
| if (_t973.cls_id == 77) _t974 = sp_box_ptr_array(sp_Article__implicit_6906_comments((sp_Article__implicit_6906 *)_t973.v.p)); | |
| if (_t973.cls_id == 78) _t974 = sp_Article__implicit_7484_comments((sp_Article__implicit_7484 *)_t973.v.p); | |
| if (_t973.cls_id == 79) _t974 = sp_Article__implicit_7995_comments((sp_Article__implicit_7995 *)_t973.v.p); | |
| if (_t973.cls_id == 80) _t974 = sp_Article__implicit_9355_comments((sp_Article__implicit_9355 *)_t973.v.p); | |
| if (_t973.cls_id == 81) _t974 = sp_Article__implicit_9372_comments((sp_Article__implicit_9372 *)_t973.v.p); | |
| } | |
| sp_RbVal _t975 = _t974; | |
| SP_GC_ROOT_RBVAL(_t975); | |
| if (_t975.tag == SP_TAG_OBJ) { | |
| mrb_int _t976_len = 0; | |
| if (_t975.cls_id == SP_BUILTIN_RANGE) _t976_len = ((sp_Range *)_t975.v.p)->last - ((sp_Range *)_t975.v.p)->first + 1; | |
| else if (_t975.cls_id == SP_BUILTIN_INT_ARRAY) _t976_len = sp_IntArray_length((sp_IntArray *)_t975.v.p); | |
| else if (_t975.cls_id == SP_BUILTIN_FLT_ARRAY) _t976_len = sp_FloatArray_length((sp_FloatArray *)_t975.v.p); | |
| else if (_t975.cls_id == SP_BUILTIN_STR_ARRAY) _t976_len = sp_StrArray_length((sp_StrArray *)_t975.v.p); | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_ARRAY) _t976_len = sp_IntArray_length((sp_IntArray *)_t975.v.p); | |
| else if (_t975.cls_id == SP_BUILTIN_PTR_ARRAY) _t976_len = sp_PtrArray_length((sp_PtrArray *)_t975.v.p); | |
| else if (_t975.cls_id == SP_BUILTIN_POLY_ARRAY) _t976_len = sp_PolyArray_length((sp_PolyArray *)_t975.v.p); | |
| else if (_t975.cls_id == SP_BUILTIN_STR_INT_HASH) _t976_len = ((sp_StrIntHash *)_t975.v.p)->len; | |
| else if (_t975.cls_id == SP_BUILTIN_STR_STR_HASH) _t976_len = ((sp_StrStrHash *)_t975.v.p)->len; | |
| else if (_t975.cls_id == SP_BUILTIN_INT_STR_HASH) _t976_len = ((sp_IntStrHash *)_t975.v.p)->len; | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_INT_HASH) _t976_len = ((sp_SymIntHash *)_t975.v.p)->len; | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_STR_HASH) _t976_len = ((sp_SymStrHash *)_t975.v.p)->len; | |
| else if (_t975.cls_id == SP_BUILTIN_STR_POLY_HASH) _t976_len = ((sp_StrPolyHash *)_t975.v.p)->len; | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t976_len = ((sp_SymPolyHash *)_t975.v.p)->len; | |
| else if (_t975.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t976_len = ((sp_PolyPolyHash *)_t975.v.p)->len; | |
| for (mrb_int _t976 = 0; _t976 < _t976_len; _t976++) { | |
| sp_RbVal _t977 = sp_box_nil(); | |
| if (_t975.cls_id == SP_BUILTIN_RANGE) _t977 = sp_box_int(((sp_Range *)_t975.v.p)->first + _t976); | |
| else if (_t975.cls_id == SP_BUILTIN_INT_ARRAY) _t977 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t975.v.p, _t976)); | |
| else if (_t975.cls_id == SP_BUILTIN_FLT_ARRAY) _t977 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t975.v.p, _t976)); | |
| else if (_t975.cls_id == SP_BUILTIN_STR_ARRAY) _t977 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t975.v.p, _t976)); | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_ARRAY) _t977 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t975.v.p, _t976)); | |
| else if (_t975.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t975.v.p, _t976); _t977 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t975.cls_id == SP_BUILTIN_POLY_ARRAY) _t977 = sp_PolyArray_get((sp_PolyArray *)_t975.v.p, _t976); | |
| else if (_t975.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t975.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t976])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t976]))); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t975.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t975.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t976])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t976]))); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t975.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t975.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t976])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t976]))); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t975.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t976])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t976]))); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t975.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t976])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t976]))); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t975.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t975.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t976])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t976])); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t975.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t975.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t976])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t976])); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t975.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t975.v.p; mrb_int _pk = _sh->order[_t976]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t977 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t977; | |
| sp_redo_35: ; | |
| sp_String_append(lv_io, sp_Views_Comments_cls_comment(((sp_Comment *)(lv_c).v.p), 0, 0)->data); | |
| } | |
| } | |
| sp_String_append(lv_io, (&("\xff" "\n</div>\n\n<h3 class=\"text-lg font-semibold mb-2\">Add a Comment</h3>\n\n")[1])); | |
| sp_StrIntHash * _t978 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t978); | |
| lv_form_record = sp_Comment_new(_t978); | |
| lv_form_method = SPS_post; | |
| sp_RbVal _t979 = lv_article; | |
| mrb_int _t980 = 0; | |
| if (_t979.tag == SP_TAG_OBJ) { | |
| if (_t979.cls_id == 50) _t980 = ((sp_ActiveRecord_Base *)_t979.v.p)->iv_id; | |
| if (_t979.cls_id == 63) _t980 = ((sp_ApplicationRecord *)_t979.v.p)->iv_id; | |
| if (_t979.cls_id == 64) _t980 = sp_CommentRow_id((sp_CommentRow *)_t979.v.p); | |
| if (_t979.cls_id == 65) _t980 = sp_Comment_id((sp_Comment *)_t979.v.p); | |
| if (_t979.cls_id == 66) _t980 = sp_ArticleRow_id((sp_ArticleRow *)_t979.v.p); | |
| if (_t979.cls_id == 76) _t980 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t979.v.p); | |
| if (_t979.cls_id == 77) _t980 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t979.v.p); | |
| if (_t979.cls_id == 78) _t980 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t979.v.p); | |
| if (_t979.cls_id == 79) _t980 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t979.v.p); | |
| if (_t979.cls_id == 80) _t980 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t979.v.p); | |
| if (_t979.cls_id == 81) _t980 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t979.v.p); | |
| } | |
| const char *_t981 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_article_comments_path(_t980))); | |
| SP_GC_ROOT(_t981); | |
| const char *_t982 = sp_ActionView_ViewHelpers_cls_method_override_input(lv_form_method); | |
| SP_GC_ROOT(_t982); | |
| const char *_t983 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t983); | |
| const char *_t984 = sp_ActionView_ViewHelpers_cls_optional_value_attr(sp_Comment__aref(lv_form_record, sp_box_sym(SPS_commenter))); | |
| SP_GC_ROOT(_t984); | |
| const char *_t985 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_int_to_s(3LL))); | |
| SP_GC_ROOT(_t985); | |
| const char *_t986 = sp_ActionView_ViewHelpers_cls_escape_or_empty(sp_Comment__aref(lv_form_record, sp_box_sym(SPS_body))); | |
| SP_GC_ROOT(_t986); | |
| sp_String_append(lv_io, sp_sprintf("<form action=\"%s\" accept-charset=\"UTF-8\" method=\"post\" class=\"%s\">%s%s\n <div>\n <label for=\"comment_commenter\" class=\"%s\">Commenter</label>\n <input type=\"text\" name=\"comment[commenter]\" id=\"comment_commenter\"%s class=\"%s\">\n </div>\n <div>\n <label for=\"comment_body\" class=\"%s\">Body</label>\n <textarea name=\"comment[body]\" id=\"comment_body\" rows=\"%s\" class=\"%s\">%s</textarea>\n </div>\n <input type=\"submit\" name=\"commit\" value=\"%s\" data-disable-with=\"%s\" class=\"%s\">\n</form>", _t981, (&("\xff" "space-y-4")[1]), _t982, _t983, (&("\xff" "block font-medium")[1]), _t984, (&("\xff" "block w-full border rounded p-2")[1]), (&("\xff" "block font-medium")[1]), _t985, (&("\xff" "block w-full border rounded p-2")[1]), _t986, (&("\xff" "Add Comment")[1]), (&("\xff" "Add Comment")[1]), (&("\xff" "bg-blue-600 text-white px-4 py-2 rounded")[1]))); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_new(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| lv_io = sp_String_new(""); | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "New article")[1])); | |
| const char *_t987 = sp_String_cstr(sp_Views_Articles_cls_form(lv_article, 0, 0)); | |
| SP_GC_ROOT(_t987); | |
| const char *_t988 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_articles_path())); | |
| SP_GC_ROOT(_t988); | |
| sp_String_append(lv_io, sp_sprintf("\n<div class=\"md:w-2/3 w-full\">\n <h1 class=\"font-bold text-4xl\">New article</h1>\n\n %s\n\n <a href=\"%s\" class=\"%s\">%s</a>\n</div>\n", _t987, _t988, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Back to articles")[1]))); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_edit(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| lv_io = sp_String_new(""); | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "Editing article")[1])); | |
| sp_RbVal _t989 = lv_article; | |
| mrb_int _t990 = 0; | |
| if (_t989.tag == SP_TAG_OBJ) { | |
| if (_t989.cls_id == 50) _t990 = ((sp_ActiveRecord_Base *)_t989.v.p)->iv_id; | |
| if (_t989.cls_id == 63) _t990 = ((sp_ApplicationRecord *)_t989.v.p)->iv_id; | |
| if (_t989.cls_id == 64) _t990 = sp_CommentRow_id((sp_CommentRow *)_t989.v.p); | |
| if (_t989.cls_id == 65) _t990 = sp_Comment_id((sp_Comment *)_t989.v.p); | |
| if (_t989.cls_id == 66) _t990 = sp_ArticleRow_id((sp_ArticleRow *)_t989.v.p); | |
| if (_t989.cls_id == 76) _t990 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t989.v.p); | |
| if (_t989.cls_id == 77) _t990 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t989.v.p); | |
| if (_t989.cls_id == 78) _t990 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t989.v.p); | |
| if (_t989.cls_id == 79) _t990 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t989.v.p); | |
| if (_t989.cls_id == 80) _t990 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t989.v.p); | |
| if (_t989.cls_id == 81) _t990 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t989.v.p); | |
| } | |
| const char *_t991 = sp_String_cstr(sp_Views_Articles_cls_form(lv_article, 0, 0)); | |
| SP_GC_ROOT(_t991); | |
| const char *_t992 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_article_path(_t990))); | |
| SP_GC_ROOT(_t992); | |
| const char *_t993 = sp_ActionView_ViewHelpers_cls_html_escape(sp_box_str(sp_RouteHelpers_cls_articles_path())); | |
| SP_GC_ROOT(_t993); | |
| sp_String_append(lv_io, sp_sprintf("\n<div class=\"md:w-2/3 w-full\">\n <h1 class=\"font-bold text-4xl\">Editing article</h1>\n\n %s\n\n <a href=\"%s\" class=\"%s\">%s</a>\n <a href=\"%s\" class=\"%s\">%s</a>\n</div>\n", _t991, _t992, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Show this article")[1]), _t993, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Back to articles")[1]))); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static inline sp_String * sp_Views_Layouts_cls_application(mrb_int lv_body, sp_String * lv_notice, sp_String * lv_alert) { | |
| (void)lv_body; | |
| (void)lv_notice; | |
| (void)lv_alert; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_article_json(sp_RbVal lv_article) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| lv_io = sp_String_new(""); | |
| sp_String_append(lv_io, (&("\xff" "{")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\"id\":")[1])); | |
| sp_RbVal _t994 = lv_article; | |
| mrb_int _t995 = 0; | |
| if (_t994.tag == SP_TAG_OBJ) { | |
| if (_t994.cls_id == 50) _t995 = ((sp_ActiveRecord_Base *)_t994.v.p)->iv_id; | |
| if (_t994.cls_id == 63) _t995 = ((sp_ApplicationRecord *)_t994.v.p)->iv_id; | |
| if (_t994.cls_id == 64) _t995 = sp_CommentRow_id((sp_CommentRow *)_t994.v.p); | |
| if (_t994.cls_id == 65) _t995 = sp_Comment_id((sp_Comment *)_t994.v.p); | |
| if (_t994.cls_id == 66) _t995 = sp_ArticleRow_id((sp_ArticleRow *)_t994.v.p); | |
| if (_t994.cls_id == 76) _t995 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t994.v.p); | |
| if (_t994.cls_id == 77) _t995 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t994.v.p); | |
| if (_t994.cls_id == 78) _t995 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t994.v.p); | |
| if (_t994.cls_id == 79) _t995 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t994.v.p); | |
| if (_t994.cls_id == 80) _t995 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t994.v.p); | |
| if (_t994.cls_id == 81) _t995 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t994.v.p); | |
| } | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(sp_box_int(_t995))); | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\"title\":")[1])); | |
| sp_RbVal _t996 = lv_article; | |
| sp_RbVal _t997 = sp_box_nil(); | |
| if (_t996.tag == SP_TAG_OBJ) { | |
| if (_t996.cls_id == 66) _t997 = sp_box_str(sp_ArticleRow_title((sp_ArticleRow *)_t996.v.p)); | |
| if (_t996.cls_id == 68) _t997 = sp_ArticleParams_title((sp_ArticleParams *)_t996.v.p); | |
| if (_t996.cls_id == 76) _t997 = sp_Article__implicit_6872_title((sp_Article__implicit_6872 *)_t996.v.p); | |
| if (_t996.cls_id == 77) _t997 = sp_Article__implicit_6906_title((sp_Article__implicit_6906 *)_t996.v.p); | |
| if (_t996.cls_id == 78) _t997 = sp_Article__implicit_7484_title((sp_Article__implicit_7484 *)_t996.v.p); | |
| if (_t996.cls_id == 79) _t997 = sp_Article__implicit_7995_title((sp_Article__implicit_7995 *)_t996.v.p); | |
| if (_t996.cls_id == 80) _t997 = sp_Article__implicit_9355_title((sp_Article__implicit_9355 *)_t996.v.p); | |
| if (_t996.cls_id == 81) _t997 = sp_Article__implicit_9372_title((sp_Article__implicit_9372 *)_t996.v.p); | |
| } | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(_t997)); | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\"body\":")[1])); | |
| sp_RbVal _t998 = lv_article; | |
| sp_RbVal _t999 = sp_box_nil(); | |
| if (_t998.tag == SP_TAG_OBJ) { | |
| if (_t998.cls_id == 56) _t999 = ((sp_ActionController_Base *)_t998.v.p)->iv_body; | |
| if (_t998.cls_id == 62) _t999 = ((sp_ApplicationController *)_t998.v.p)->iv_body; | |
| if (_t998.cls_id == 64) _t999 = sp_box_str(sp_CommentRow_body((sp_CommentRow *)_t998.v.p)); | |
| if (_t998.cls_id == 65) _t999 = sp_Comment_body((sp_Comment *)_t998.v.p); | |
| if (_t998.cls_id == 66) _t999 = sp_box_str(sp_ArticleRow_body((sp_ArticleRow *)_t998.v.p)); | |
| if (_t998.cls_id == 68) _t999 = sp_ArticleParams_body((sp_ArticleParams *)_t998.v.p); | |
| if (_t998.cls_id == 69) _t999 = ((sp_ArticlesController *)_t998.v.p)->iv_body; | |
| if (_t998.cls_id == 70) _t999 = sp_CommentParams_body((sp_CommentParams *)_t998.v.p); | |
| if (_t998.cls_id == 71) _t999 = ((sp_CommentsController *)_t998.v.p)->iv_body; | |
| if (_t998.cls_id == 72) _t999 = ((sp_ActionResponse *)_t998.v.p)->iv_body; | |
| if (_t998.cls_id == 76) _t999 = sp_Article__implicit_6872_body((sp_Article__implicit_6872 *)_t998.v.p); | |
| if (_t998.cls_id == 77) _t999 = sp_Article__implicit_6906_body((sp_Article__implicit_6906 *)_t998.v.p); | |
| if (_t998.cls_id == 78) _t999 = sp_Article__implicit_7484_body((sp_Article__implicit_7484 *)_t998.v.p); | |
| if (_t998.cls_id == 79) _t999 = sp_Article__implicit_7995_body((sp_Article__implicit_7995 *)_t998.v.p); | |
| if (_t998.cls_id == 80) _t999 = sp_Article__implicit_9355_body((sp_Article__implicit_9355 *)_t998.v.p); | |
| if (_t998.cls_id == 81) _t999 = sp_Article__implicit_9372_body((sp_Article__implicit_9372 *)_t998.v.p); | |
| } | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(_t999)); | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\"created_at\":")[1])); | |
| sp_RbVal _t1000 = lv_article; | |
| sp_RbVal _t1001 = sp_box_nil(); | |
| if (_t1000.tag == SP_TAG_OBJ) { | |
| if (_t1000.cls_id == 64) _t1001 = sp_box_str(sp_CommentRow_created_at((sp_CommentRow *)_t1000.v.p)); | |
| if (_t1000.cls_id == 65) _t1001 = sp_Comment_created_at((sp_Comment *)_t1000.v.p); | |
| if (_t1000.cls_id == 66) _t1001 = sp_box_str(sp_ArticleRow_created_at((sp_ArticleRow *)_t1000.v.p)); | |
| if (_t1000.cls_id == 76) _t1001 = sp_Article__implicit_6872_created_at((sp_Article__implicit_6872 *)_t1000.v.p); | |
| if (_t1000.cls_id == 77) _t1001 = sp_Article__implicit_6906_created_at((sp_Article__implicit_6906 *)_t1000.v.p); | |
| if (_t1000.cls_id == 78) _t1001 = sp_Article__implicit_7484_created_at((sp_Article__implicit_7484 *)_t1000.v.p); | |
| if (_t1000.cls_id == 79) _t1001 = sp_Article__implicit_7995_created_at((sp_Article__implicit_7995 *)_t1000.v.p); | |
| if (_t1000.cls_id == 80) _t1001 = sp_Article__implicit_9355_created_at((sp_Article__implicit_9355 *)_t1000.v.p); | |
| if (_t1000.cls_id == 81) _t1001 = sp_Article__implicit_9372_created_at((sp_Article__implicit_9372 *)_t1000.v.p); | |
| } | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_datetime(_t1001)); | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\"updated_at\":")[1])); | |
| sp_RbVal _t1002 = lv_article; | |
| sp_RbVal _t1003 = sp_box_nil(); | |
| if (_t1002.tag == SP_TAG_OBJ) { | |
| if (_t1002.cls_id == 64) _t1003 = sp_box_str(sp_CommentRow_updated_at((sp_CommentRow *)_t1002.v.p)); | |
| if (_t1002.cls_id == 65) _t1003 = sp_Comment_updated_at((sp_Comment *)_t1002.v.p); | |
| if (_t1002.cls_id == 66) _t1003 = sp_box_str(sp_ArticleRow_updated_at((sp_ArticleRow *)_t1002.v.p)); | |
| if (_t1002.cls_id == 76) _t1003 = sp_Article__implicit_6872_updated_at((sp_Article__implicit_6872 *)_t1002.v.p); | |
| if (_t1002.cls_id == 77) _t1003 = sp_Article__implicit_6906_updated_at((sp_Article__implicit_6906 *)_t1002.v.p); | |
| if (_t1002.cls_id == 78) _t1003 = sp_Article__implicit_7484_updated_at((sp_Article__implicit_7484 *)_t1002.v.p); | |
| if (_t1002.cls_id == 79) _t1003 = sp_Article__implicit_7995_updated_at((sp_Article__implicit_7995 *)_t1002.v.p); | |
| if (_t1002.cls_id == 80) _t1003 = sp_Article__implicit_9355_updated_at((sp_Article__implicit_9355 *)_t1002.v.p); | |
| if (_t1002.cls_id == 81) _t1003 = sp_Article__implicit_9372_updated_at((sp_Article__implicit_9372 *)_t1002.v.p); | |
| } | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_datetime(_t1003)); | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| sp_String_append(lv_io, (&("\xff" "\"url\":")[1])); | |
| sp_RbVal _t1004 = lv_article; | |
| mrb_int _t1005 = 0; | |
| if (_t1004.tag == SP_TAG_OBJ) { | |
| if (_t1004.cls_id == 50) _t1005 = ((sp_ActiveRecord_Base *)_t1004.v.p)->iv_id; | |
| if (_t1004.cls_id == 63) _t1005 = ((sp_ApplicationRecord *)_t1004.v.p)->iv_id; | |
| if (_t1004.cls_id == 64) _t1005 = sp_CommentRow_id((sp_CommentRow *)_t1004.v.p); | |
| if (_t1004.cls_id == 65) _t1005 = sp_Comment_id((sp_Comment *)_t1004.v.p); | |
| if (_t1004.cls_id == 66) _t1005 = sp_ArticleRow_id((sp_ArticleRow *)_t1004.v.p); | |
| if (_t1004.cls_id == 76) _t1005 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t1004.v.p); | |
| if (_t1004.cls_id == 77) _t1005 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t1004.v.p); | |
| if (_t1004.cls_id == 78) _t1005 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t1004.v.p); | |
| if (_t1004.cls_id == 79) _t1005 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t1004.v.p); | |
| if (_t1004.cls_id == 80) _t1005 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t1004.v.p); | |
| if (_t1004.cls_id == 81) _t1005 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t1004.v.p); | |
| } | |
| sp_RbVal _t1006 = lv_article; | |
| mrb_int _t1007 = 0; | |
| if (_t1006.tag == SP_TAG_OBJ) { | |
| if (_t1006.cls_id == 50) _t1007 = ((sp_ActiveRecord_Base *)_t1006.v.p)->iv_id; | |
| if (_t1006.cls_id == 63) _t1007 = ((sp_ApplicationRecord *)_t1006.v.p)->iv_id; | |
| if (_t1006.cls_id == 64) _t1007 = sp_CommentRow_id((sp_CommentRow *)_t1006.v.p); | |
| if (_t1006.cls_id == 65) _t1007 = sp_Comment_id((sp_Comment *)_t1006.v.p); | |
| if (_t1006.cls_id == 66) _t1007 = sp_ArticleRow_id((sp_ArticleRow *)_t1006.v.p); | |
| if (_t1006.cls_id == 76) _t1007 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t1006.v.p); | |
| if (_t1006.cls_id == 77) _t1007 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t1006.v.p); | |
| if (_t1006.cls_id == 78) _t1007 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t1006.v.p); | |
| if (_t1006.cls_id == 79) _t1007 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t1006.v.p); | |
| if (_t1006.cls_id == 80) _t1007 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t1006.v.p); | |
| if (_t1006.cls_id == 81) _t1007 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t1006.v.p); | |
| } | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(sp_box_str(sp_str_concat(sp_RouteHelpers_cls_article_path(_t1007), (&("\xff" ".json")[1]))))); | |
| sp_String_append(lv_io, (&("\xff" "}")[1])); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_index_json(sp_PtrArray * lv_articles) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| sp_Article__implicit_6906 * lv_article = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(lv_articles); | |
| SP_GC_ROOT(lv_articles); | |
| lv_io = sp_String_new(""); | |
| sp_String_append(lv_io, (&("\xff" "[")[1])); | |
| SP_GC_ROOT(lv_articles); | |
| sp_PtrArray *_t1008 = sp_PtrArray_new(); | |
| SP_GC_ROOT(_t1008); | |
| for (mrb_int _t1009 = 0; _t1009 < sp_PtrArray_length(lv_articles); _t1009++) { | |
| sp_Article__implicit_6906 * lv_article = (sp_Article__implicit_6906 *)sp_PtrArray_get(lv_articles, _t1009); | |
| sp_PtrArray_push(_t1008, (void *)(sp_Views_Articles_cls_article_json(sp_box_obj(lv_article, 77)))); | |
| } | |
| sp_PtrArray * _t1010 = _t1008; | |
| SP_GC_ROOT(_t1010); | |
| sp_String_append(lv_io, sp_PtrArray_str_join(_t1010, (&("\xff" ",")[1]))); | |
| sp_String_append(lv_io, (&("\xff" "]")[1])); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static inline sp_String * sp_Views_Articles_cls_show_json(sp_RbVal lv_article) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| lv_io = sp_String_new(""); | |
| sp_String_append(lv_io, sp_Views_Articles_cls_article_json(lv_article)->data); | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static inline sp_PtrArray * sp_Routes_cls_table(void) { | |
| SP_GC_SAVE(); | |
| sp_PtrArray *_t1011 = sp_PtrArray_new(); | |
| SP_GC_ROOT(_t1011); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles")[1]), SPS_articles, SPS_index)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles/new")[1]), SPS_articles, SPS_new)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "POST")[1]), (&("\xff" "/articles")[1]), SPS_articles, SPS_create)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles/:id")[1]), SPS_articles, SPS_show)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles/:id/edit")[1]), SPS_articles, SPS_edit)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "PATCH")[1]), (&("\xff" "/articles/:id")[1]), SPS_articles, SPS_update)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "DELETE")[1]), (&("\xff" "/articles/:id")[1]), SPS_articles, SPS_destroy)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "POST")[1]), (&("\xff" "/articles/:article_id/comments")[1]), SPS_comments, SPS_create)); | |
| sp_PtrArray_push(_t1011, sp_ActionDispatch_Router_Route_new((&("\xff" "DELETE")[1]), (&("\xff" "/articles/:article_id/comments/:id")[1]), SPS_comments, SPS_destroy)); | |
| return _t1011; | |
| return NULL; | |
| } | |
| static inline sp_ActionDispatch_Router_Route * sp_Routes_cls_root(void) { | |
| return NULL; | |
| } | |
| static inline mrb_bool sp_SchemaSetup_cls_reset_bang(void) { | |
| SP_GC_SAVE(); | |
| if (("constant" != NULL)) { | |
| sp_Article_cls__adapter_truncate(); | |
| } | |
| if (("constant" != NULL)) { | |
| sp_Comment_cls__adapter_truncate(); | |
| } | |
| return sp_FixtureLoader_cls_load_all_bang(); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_FixtureLoader_cls_load_all_bang(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| return sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| return FALSE; | |
| } | |
| static inline sp_Article__implicit_6906 * sp_ArticlesFixtures_cls_one(void) { | |
| SP_GC_SAVE(); | |
| return sp_Article_cls_find(1LL); | |
| return NULL; | |
| } | |
| static inline sp_Article__implicit_6906 * sp_ArticlesFixtures_cls_two(void) { | |
| return NULL; | |
| } | |
| static mrb_bool sp_ArticlesFixtures_cls__fixtures_load_bang(void) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_instance = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_instance); | |
| sp_StrIntHash * _t1012 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t1012); | |
| lv_instance = sp_box_obj(sp_Article__implicit_9355_new(_t1012), 80); | |
| sp_RbVal _t1013 = lv_instance; | |
| mrb_int _t1014 = 0; | |
| if (_t1013.tag == SP_TAG_OBJ) { | |
| if (_t1013.cls_id == 50) { ((sp_ActiveRecord_Base *)_t1013.v.p)->iv_id = 1LL; _t1014 = 1LL; } | |
| if (_t1013.cls_id == 63) { ((sp_ApplicationRecord *)_t1013.v.p)->iv_id = 1LL; _t1014 = 1LL; } | |
| if (_t1013.cls_id == 64) _t1014 = sp_CommentRow_id_eq((sp_CommentRow *)_t1013.v.p, 1LL); | |
| if (_t1013.cls_id == 65) _t1014 = sp_Comment_id_eq((sp_Comment *)_t1013.v.p, sp_box_int(1LL)); | |
| if (_t1013.cls_id == 66) _t1014 = sp_ArticleRow_id_eq((sp_ArticleRow *)_t1013.v.p, 1LL); | |
| if (_t1013.cls_id == 76) _t1014 = sp_Article__implicit_6872_id_eq((sp_Article__implicit_6872 *)_t1013.v.p, sp_box_int(1LL)); | |
| if (_t1013.cls_id == 77) _t1014 = sp_Article__implicit_6906_id_eq((sp_Article__implicit_6906 *)_t1013.v.p, sp_box_int(1LL)); | |
| if (_t1013.cls_id == 78) _t1014 = sp_Article__implicit_7484_id_eq((sp_Article__implicit_7484 *)_t1013.v.p, sp_box_int(1LL)); | |
| if (_t1013.cls_id == 79) _t1014 = sp_Article__implicit_7995_id_eq((sp_Article__implicit_7995 *)_t1013.v.p, sp_box_int(1LL)); | |
| if (_t1013.cls_id == 80) _t1014 = sp_Article__implicit_9355_id_eq((sp_Article__implicit_9355 *)_t1013.v.p, sp_box_int(1LL)); | |
| if (_t1013.cls_id == 81) _t1014 = sp_Article__implicit_9372_id_eq((sp_Article__implicit_9372 *)_t1013.v.p, sp_box_int(1LL)); | |
| } | |
| _t1014; | |
| sp_RbVal _t1015 = lv_instance; | |
| mrb_int _t1016 = 0; | |
| if (_t1015.tag == SP_TAG_OBJ) { | |
| if (_t1015.cls_id == 66) _t1016 = sp_ArticleRow_title_eq((sp_ArticleRow *)_t1015.v.p, (&("\xff" "Getting Started with Rails")[1])); | |
| if (_t1015.cls_id == 68) _t1016 = sp_ArticleParams_title_eq((sp_ArticleParams *)_t1015.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t1015.cls_id == 76) _t1016 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)_t1015.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t1015.cls_id == 77) _t1016 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)_t1015.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t1015.cls_id == 78) _t1016 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)_t1015.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t1015.cls_id == 79) _t1016 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)_t1015.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t1015.cls_id == 80) _t1016 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)_t1015.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t1015.cls_id == 81) _t1016 = sp_Article__implicit_9372_title_eq((sp_Article__implicit_9372 *)_t1015.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| } | |
| _t1016; | |
| sp_RbVal _t1017 = lv_instance; | |
| mrb_int _t1018 = 0; | |
| if (_t1017.tag == SP_TAG_OBJ) { | |
| if (_t1017.cls_id == 64) _t1018 = sp_CommentRow_body_eq((sp_CommentRow *)_t1017.v.p, (&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1])); | |
| if (_t1017.cls_id == 65) _t1018 = sp_Comment_body_eq((sp_Comment *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 66) _t1018 = sp_ArticleRow_body_eq((sp_ArticleRow *)_t1017.v.p, (&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1])); | |
| if (_t1017.cls_id == 68) _t1018 = sp_ArticleParams_body_eq((sp_ArticleParams *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 70) _t1018 = sp_CommentParams_body_eq((sp_CommentParams *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 76) _t1018 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 77) _t1018 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 78) _t1018 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 79) _t1018 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 80) _t1018 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1017.cls_id == 81) _t1018 = sp_Article__implicit_9372_body_eq((sp_Article__implicit_9372 *)_t1017.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| } | |
| _t1018; | |
| sp_RbVal _t1019 = lv_instance; | |
| mrb_bool _t1020 = FALSE; | |
| if (_t1019.tag == SP_TAG_OBJ) { | |
| if (_t1019.cls_id == 50) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 63) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 65) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 76) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 77) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 78) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 79) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 80) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| if (_t1019.cls_id == 81) _t1020 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1019.v.p); | |
| } | |
| _t1020; | |
| sp_StrIntHash * _t1021 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t1021); | |
| lv_instance = sp_box_obj(sp_Article__implicit_9372_new(_t1021), 81); | |
| sp_RbVal _t1022 = lv_instance; | |
| mrb_int _t1023 = 0; | |
| if (_t1022.tag == SP_TAG_OBJ) { | |
| if (_t1022.cls_id == 50) { ((sp_ActiveRecord_Base *)_t1022.v.p)->iv_id = 2LL; _t1023 = 2LL; } | |
| if (_t1022.cls_id == 63) { ((sp_ApplicationRecord *)_t1022.v.p)->iv_id = 2LL; _t1023 = 2LL; } | |
| if (_t1022.cls_id == 64) _t1023 = sp_CommentRow_id_eq((sp_CommentRow *)_t1022.v.p, 2LL); | |
| if (_t1022.cls_id == 65) _t1023 = sp_Comment_id_eq((sp_Comment *)_t1022.v.p, sp_box_int(2LL)); | |
| if (_t1022.cls_id == 66) _t1023 = sp_ArticleRow_id_eq((sp_ArticleRow *)_t1022.v.p, 2LL); | |
| if (_t1022.cls_id == 76) _t1023 = sp_Article__implicit_6872_id_eq((sp_Article__implicit_6872 *)_t1022.v.p, sp_box_int(2LL)); | |
| if (_t1022.cls_id == 77) _t1023 = sp_Article__implicit_6906_id_eq((sp_Article__implicit_6906 *)_t1022.v.p, sp_box_int(2LL)); | |
| if (_t1022.cls_id == 78) _t1023 = sp_Article__implicit_7484_id_eq((sp_Article__implicit_7484 *)_t1022.v.p, sp_box_int(2LL)); | |
| if (_t1022.cls_id == 79) _t1023 = sp_Article__implicit_7995_id_eq((sp_Article__implicit_7995 *)_t1022.v.p, sp_box_int(2LL)); | |
| if (_t1022.cls_id == 80) _t1023 = sp_Article__implicit_9355_id_eq((sp_Article__implicit_9355 *)_t1022.v.p, sp_box_int(2LL)); | |
| if (_t1022.cls_id == 81) _t1023 = sp_Article__implicit_9372_id_eq((sp_Article__implicit_9372 *)_t1022.v.p, sp_box_int(2LL)); | |
| } | |
| _t1023; | |
| sp_RbVal _t1024 = lv_instance; | |
| mrb_int _t1025 = 0; | |
| if (_t1024.tag == SP_TAG_OBJ) { | |
| if (_t1024.cls_id == 66) _t1025 = sp_ArticleRow_title_eq((sp_ArticleRow *)_t1024.v.p, (&("\xff" "Understanding MVC Architecture")[1])); | |
| if (_t1024.cls_id == 68) _t1025 = sp_ArticleParams_title_eq((sp_ArticleParams *)_t1024.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1024.cls_id == 76) _t1025 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)_t1024.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1024.cls_id == 77) _t1025 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)_t1024.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1024.cls_id == 78) _t1025 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)_t1024.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1024.cls_id == 79) _t1025 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)_t1024.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1024.cls_id == 80) _t1025 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)_t1024.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1024.cls_id == 81) _t1025 = sp_Article__implicit_9372_title_eq((sp_Article__implicit_9372 *)_t1024.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| } | |
| _t1025; | |
| sp_RbVal _t1026 = lv_instance; | |
| mrb_int _t1027 = 0; | |
| if (_t1026.tag == SP_TAG_OBJ) { | |
| if (_t1026.cls_id == 64) _t1027 = sp_CommentRow_body_eq((sp_CommentRow *)_t1026.v.p, (&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1])); | |
| if (_t1026.cls_id == 65) _t1027 = sp_Comment_body_eq((sp_Comment *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 66) _t1027 = sp_ArticleRow_body_eq((sp_ArticleRow *)_t1026.v.p, (&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1])); | |
| if (_t1026.cls_id == 68) _t1027 = sp_ArticleParams_body_eq((sp_ArticleParams *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 70) _t1027 = sp_CommentParams_body_eq((sp_CommentParams *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 76) _t1027 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 77) _t1027 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 78) _t1027 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 79) _t1027 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 80) _t1027 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1026.cls_id == 81) _t1027 = sp_Article__implicit_9372_body_eq((sp_Article__implicit_9372 *)_t1026.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| } | |
| _t1027; | |
| sp_RbVal _t1028 = lv_instance; | |
| mrb_bool _t1029 = FALSE; | |
| if (_t1028.tag == SP_TAG_OBJ) { | |
| if (_t1028.cls_id == 50) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 63) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 65) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 76) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 77) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 78) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 79) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 80) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| if (_t1028.cls_id == 81) _t1029 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1028.v.p); | |
| } | |
| return _t1029; | |
| return FALSE; | |
| } | |
| static inline sp_Comment * sp_CommentsFixtures_cls_one(void) { | |
| SP_GC_SAVE(); | |
| return sp_Comment_cls_find(1LL); | |
| return NULL; | |
| } | |
| static inline sp_Comment * sp_CommentsFixtures_cls_two(void) { | |
| return NULL; | |
| } | |
| static mrb_bool sp_CommentsFixtures_cls__fixtures_load_bang(void) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| sp_StrIntHash * _t1030 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t1030); | |
| lv_instance = sp_Comment_new(_t1030); | |
| lv_instance->iv_id = 1LL; | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(1LL)); | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str((&("\xff" "Alice")[1]))); | |
| sp_Comment_body_eq(lv_instance, sp_box_str((&("\xff" "Great introduction! Rails really does make development faster.")[1]))); | |
| sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)lv_instance); | |
| sp_StrIntHash * _t1031 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t1031); | |
| lv_instance = sp_Comment_new(_t1031); | |
| lv_instance->iv_id = 2LL; | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(2LL)); | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str((&("\xff" "Bob")[1]))); | |
| sp_Comment_body_eq(lv_instance, sp_box_str((&("\xff" "This pattern really helps keep code organized!")[1]))); | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)lv_instance); | |
| return FALSE; | |
| } | |
| static void sp_clsbody_515(void); | |
| static void sp_clsbody_3821(void); | |
| static void sp_clsbody_515(void) { | |
| } | |
| static void sp_clsbody_3821(void) { | |
| } | |
| static mrb_int sp_method_obj_hash_dispatch(int cls_id, void *p) { | |
| if (cls_id == 75) { | |
| sp_Method *m = (sp_Method *)p; | |
| return ((mrb_int)(uintptr_t)m->iv_self_obj * 31) ^ (mrb_int)m->iv_fn_ptr; | |
| } | |
| if (cls_id == SP_BUILTIN_INT_ARRAY) { | |
| sp_IntArray *a = (sp_IntArray *)p; | |
| mrb_int h = 5381; | |
| for (mrb_int i = 0; i < a->len; i++) h = ((h << 5) + h) ^ sp_IntArray_get(a, i); | |
| return h; | |
| } | |
| return (mrb_int)((uintptr_t)p); | |
| } | |
| static mrb_bool sp_method_obj_eql_dispatch(int cls_id, void *a, void *b) { | |
| if (cls_id == 75) { | |
| sp_Method *ma = (sp_Method *)a; | |
| sp_Method *mb = (sp_Method *)b; | |
| return ma->iv_self_obj == mb->iv_self_obj && ma->iv_fn_ptr == mb->iv_fn_ptr; | |
| } | |
| if (cls_id == SP_BUILTIN_INT_ARRAY) { | |
| sp_IntArray *aa = (sp_IntArray *)a; | |
| sp_IntArray *bb = (sp_IntArray *)b; | |
| if (aa->len != bb->len) return FALSE; | |
| for (mrb_int i = 0; i < aa->len; i++) if (sp_IntArray_get(aa, i) != sp_IntArray_get(bb, i)) return FALSE; | |
| return TRUE; | |
| } | |
| return FALSE; | |
| } | |
| int main(int argc,char**argv){ | |
| sp_re_init(); | |
| sp_obj_hash_hook = sp_method_obj_hash_dispatch; | |
| sp_obj_eql_hook = sp_method_obj_eql_dispatch; | |
| SP_GC_SAVE(); | |
| const char * lv_sql = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_sql); | |
| sp_ArticlesControllerTest * lv___t = NULL; | |
| SP_GC_ROOT(lv___t); | |
| cst_Base64_ALPHABET = (&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]); | |
| SP_GC_ROOT(cst_Base64_ALPHABET); | |
| cst_SQL_OK = 0LL; | |
| cst_SQL_ROW = 100LL; | |
| cst_SQL_DONE = 101LL; | |
| cst_Db_pool = 0; | |
| SP_GC_ROOT(cst_Db_pool); | |
| cst_Db_query_log = ((void)(0), sp_box_nil()); | |
| SP_GC_ROOT_RBVAL(cst_Db_query_log); | |
| cst_ActiveRecord_Registry_entries = sp_PolyPolyHash_new(); | |
| SP_GC_ROOT(cst_ActiveRecord_Registry_entries); | |
| cst_ActionView_ViewHelpers_slots = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(cst_ActionView_ViewHelpers_slots); | |
| sp_StrStrHash *_t1032 = sp_StrStrHash_new(); | |
| SP_GC_ROOT(_t1032); | |
| sp_StrStrHash_set(_t1032, (&("\xff" "&")[1]), (&("\xff" "&")[1])); | |
| sp_StrStrHash_set(_t1032, (&("\xff" "<")[1]), (&("\xff" "<")[1])); | |
| sp_StrStrHash_set(_t1032, (&("\xff" ">")[1]), (&("\xff" ">")[1])); | |
| sp_StrStrHash_set(_t1032, (&("\xff" "\"")[1]), (&("\xff" """)[1])); | |
| sp_StrStrHash_set(_t1032, (&("\xff" "'")[1]), (&("\xff" "'")[1])); | |
| cst_ActionView_ViewHelpers_HTML_ESCAPES = (sp_StrStrHash *)sp_gc_freeze(_t1032); | |
| SP_GC_ROOT(cst_ActionView_ViewHelpers_HTML_ESCAPES); | |
| cst_ActionView_ViewHelpers_HTML_ESCAPE_PATTERN = 0; | |
| sp_SymIntHash *_t1033 = sp_SymIntHash_new(); | |
| SP_GC_ROOT(_t1033); | |
| sp_SymIntHash_set(_t1033, SPS_ok, 200LL); | |
| sp_SymIntHash_set(_t1033, SPS_created, 201LL); | |
| sp_SymIntHash_set(_t1033, SPS_accepted, 202LL); | |
| sp_SymIntHash_set(_t1033, SPS_no_content, 204LL); | |
| sp_SymIntHash_set(_t1033, SPS_moved_permanently, 301LL); | |
| sp_SymIntHash_set(_t1033, SPS_found, 302LL); | |
| sp_SymIntHash_set(_t1033, SPS_see_other, 303LL); | |
| sp_SymIntHash_set(_t1033, SPS_not_modified, 304LL); | |
| sp_SymIntHash_set(_t1033, SPS_bad_request, 400LL); | |
| sp_SymIntHash_set(_t1033, SPS_unauthorized, 401LL); | |
| sp_SymIntHash_set(_t1033, SPS_forbidden, 403LL); | |
| sp_SymIntHash_set(_t1033, SPS_not_found, 404LL); | |
| sp_SymIntHash_set(_t1033, SPS_unprocessable_entity, 422LL); | |
| sp_SymIntHash_set(_t1033, SPS_unprocessable_content, 422LL); | |
| sp_SymIntHash_set(_t1033, SPS_internal_server_error, 500LL); | |
| cst_ActionController_STATUS_CODES = (sp_SymIntHash *)sp_gc_freeze(_t1033); | |
| SP_GC_ROOT(cst_ActionController_STATUS_CODES); | |
| sp_StrStrHash *_t1034 = sp_StrStrHash_new(); | |
| SP_GC_ROOT(_t1034); | |
| sp_StrStrHash_set(_t1034, (&("\xff" "\\")[1]), (&("\xff" "\\\\")[1])); | |
| sp_StrStrHash_set(_t1034, (&("\xff" "\"")[1]), (&("\xff" "\\\"")[1])); | |
| sp_StrStrHash_set(_t1034, (&("\xff" "\n")[1]), (&("\xff" "\\n")[1])); | |
| sp_StrStrHash_set(_t1034, (&("\xff" "\r")[1]), (&("\xff" "\\r")[1])); | |
| sp_StrStrHash_set(_t1034, (&("\xff" "\t")[1]), (&("\xff" "\\t")[1])); | |
| sp_StrStrHash_set(_t1034, (&("\xff" "")[1]), (&("\xff" "\\b")[1])); | |
| sp_StrStrHash_set(_t1034, (&("\xff" "")[1]), (&("\xff" "\\f")[1])); | |
| cst_JsonBuilder_ESCAPES = (sp_StrStrHash *)sp_gc_freeze(_t1034); | |
| SP_GC_ROOT(cst_JsonBuilder_ESCAPES); | |
| cst_JsonBuilder_ESCAPE_PATTERN = 0; | |
| cst_Broadcasts_LOG = sp_PolyArray_new(); | |
| SP_GC_ROOT(cst_Broadcasts_LOG); | |
| cst_Broadcasts_TRANSPORTS = sp_IntArray_new(); | |
| SP_GC_ROOT(cst_Broadcasts_TRANSPORTS); | |
| sp_SymPolyHash *_t1035 = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(_t1035); | |
| sp_SymPolyHash_set(_t1035, SPS_success, sp_box_range(sp_range_new(200LL, 299LL, 0))); | |
| sp_SymPolyHash_set(_t1035, SPS_redirect, sp_box_range(sp_range_new(300LL, 399LL, 0))); | |
| sp_SymPolyHash_set(_t1035, SPS_missing, sp_box_int(404LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_not_found, sp_box_int(404LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_error, sp_box_range(sp_range_new(500LL, 599LL, 0))); | |
| sp_SymPolyHash_set(_t1035, SPS_ok, sp_box_int(200LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_created, sp_box_int(201LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_no_content, sp_box_int(204LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_moved_permanently, sp_box_int(301LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_found, sp_box_int(302LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_see_other, sp_box_int(303LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_bad_request, sp_box_int(400LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_unauthorized, sp_box_int(401LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_forbidden, sp_box_int(403LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_unprocessable_entity, sp_box_int(422LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_unprocessable_content, sp_box_int(422LL)); | |
| sp_SymPolyHash_set(_t1035, SPS_internal_server_error, sp_box_int(500LL)); | |
| cst_RequestDispatch_STATUS_SYMBOLS = (sp_SymPolyHash *)sp_gc_freeze(_t1035); | |
| SP_GC_ROOT(cst_RequestDispatch_STATUS_SYMBOLS); | |
| cst_DbConn_CAP = 128LL; | |
| sp_clsbody_515(); | |
| sp_clsbody_3821(); | |
| sp_Db_cls_configure((&("\xff" ":memory:")[1]), 8LL); | |
| sp_StrArray * _t1036 = sp_Schema_cls_statements(); | |
| SP_GC_ROOT(_t1036); | |
| for (mrb_int _t1037 = 0; _t1037 < sp_StrArray_length(_t1036); _t1037++) { | |
| const char * lv_sql = sp_StrArray_get(_t1036, _t1037); | |
| sp_redo_36: ; | |
| sp_Db_cls_exec((const char *)lv_sql); | |
| } | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_get_index(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_get_new(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_create_article(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_not_create_article_with_invalid_params(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_show_article(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_get_edit(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_update_article(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_not_update_article_with_invalid_params(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| lv___t = sp_ArticlesControllerTest_new(); | |
| sp_Article_cls__adapter_truncate(); | |
| sp_Comment_cls__adapter_truncate(); | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| sp_ArticlesControllerTest_test_should_destroy_article(lv___t); | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| { const char *_ps = (const char *)((&("\xff" "ArticlesControllerTest: 9 tests passed")[1])); if (_ps) { fputs(_ps, stdout); if (!*_ps || _ps[strlen(_ps)-1] != '\n') putchar('\n'); } else putchar('\n'); } | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0 | |
| Copyright (C) 2023 Free Software Foundation, Inc. | |
| This is free software; see the source for copying conditions. There is NO | |
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| Linux runnervm3jyl0 6.17.0-1015-azure #15~24.04.1-Ubuntu SMP Wed May 6 22:37:49 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux | |
| Usage: ruby spinel_analyze.rb ast.txt out.ir [seed.txt] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /tmp/out.c: In function ‘_sp_proc_fn_1’: | |
| /tmp/out.c:1500:95: error: ‘self’ undeclared (first use in this function) | |
| 1500 | return sp_ActionDispatch_IntegrationTest_assert_select((sp_ActionDispatch_IntegrationTest *)self, (&("\xff" "h2")[1]), ((void)(0), sp_box_nil()), ((void)(0), sp_box_nil()), 0, NULL, NULL); | |
| | ^~~~ | |
| /tmp/out.c:1500:95: note: each undeclared identifier is reported only once for each function it appears in | |
| /tmp/out.c: In function ‘sp_ActiveRecord_Base_save’: | |
| /tmp/out.c:1733:26: warning: implicit declaration of function ‘sp_Article__adapter_insert’; did you mean ‘sp_Comment__adapter_insert’? [-Wimplicit-function-declaration] | |
| 1733 | case 67LL: _t5 = sp_Article__adapter_insert((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_Comment__adapter_insert | |
| /tmp/out.c:1748:26: warning: implicit declaration of function ‘sp_Article_after_create_commit’; did you mean ‘sp_Comment_after_create_commit’? [-Wimplicit-function-declaration] | |
| 1748 | case 67LL: _t6 = sp_Article_after_create_commit((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_Comment_after_create_commit | |
| /tmp/out.c:1764:26: warning: implicit declaration of function ‘sp_Article__adapter_update’; did you mean ‘sp_Comment__adapter_update’? [-Wimplicit-function-declaration] | |
| 1764 | case 67LL: _t7 = sp_Article__adapter_update((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_Comment__adapter_update | |
| /tmp/out.c:1778:26: warning: implicit declaration of function ‘sp_Article_after_update_commit’; did you mean ‘sp_Comment_after_update_commit’? [-Wimplicit-function-declaration] | |
| 1778 | case 67LL: _t8 = sp_Article_after_update_commit((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_Comment_after_update_commit | |
| /tmp/out.c: In function ‘sp_ActiveRecord_Base_destroy’: | |
| /tmp/out.c:1810:25: warning: implicit declaration of function ‘sp_Article_before_destroy’; did you mean ‘sp_ArticlesController_destroy’? [-Wimplicit-function-declaration] | |
| 1810 | case 67LL: _t10 = sp_Article_before_destroy((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_ArticlesController_destroy | |
| /tmp/out.c:1810:25: error: incompatible types when assigning to type ‘sp_RbVal’ from type ‘int’ | |
| /tmp/out.c:1823:25: warning: implicit declaration of function ‘sp_Article__adapter_delete’; did you mean ‘sp_Comment__adapter_delete’? [-Wimplicit-function-declaration] | |
| 1823 | case 67LL: _t11 = sp_Article__adapter_delete((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_Comment__adapter_delete | |
| /tmp/out.c:1839:25: warning: implicit declaration of function ‘sp_Article_after_destroy_commit’; did you mean ‘sp_Comment_after_destroy_commit’? [-Wimplicit-function-declaration] | |
| 1839 | case 67LL: _t12 = sp_Article_after_destroy_commit((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_Comment_after_destroy_commit | |
| /tmp/out.c: In function ‘sp_ActiveRecord_Base_reload’: | |
| /tmp/out.c:1860:25: warning: implicit declaration of function ‘sp_Article__adapter_reload’; did you mean ‘sp_Comment__adapter_reload’? [-Wimplicit-function-declaration] | |
| 1860 | case 67LL: _t13 = sp_Article__adapter_reload((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_Comment__adapter_reload | |
| /tmp/out.c:1860:25: error: incompatible types when assigning to type ‘sp_RbVal’ from type ‘int’ | |
| /tmp/out.c: In function ‘sp_ActiveRecord_Base_fill_timestamps’: | |
| /tmp/out.c:1977:20: warning: implicit declaration of function ‘sp_Article__aset’; did you mean ‘sp_Article_new’? [-Wimplicit-function-declaration] | |
| 1977 | case 67LL: sp_Article__aset((sp_Article *)self, SPS_updated_at, lv_now); break; | |
| | ^~~~~~~~~~~~~~~~ | |
| | sp_Article_new | |
| /tmp/out.c:2010:25: warning: implicit declaration of function ‘sp_Article__aref’; did you mean ‘sp_Article_new’? [-Wimplicit-function-declaration] | |
| 2010 | case 67LL: _t23 = sp_Article__aref((sp_Article *)self, sp_box_sym(SPS_created_at)); break; | |
| | ^~~~~~~~~~~~~~~~ | |
| | sp_Article_new | |
| /tmp/out.c:2010:25: error: incompatible types when assigning to type ‘sp_RbVal’ from type ‘int’ | |
| /tmp/out.c: In function ‘sp_ActiveRecord_Base_valid_p’: | |
| /tmp/out.c:2049:25: warning: implicit declaration of function ‘sp_Article_validate’; did you mean ‘sp_Article_cls_all’? [-Wimplicit-function-declaration] | |
| 2049 | case 67LL: _t24 = sp_Article_validate((sp_Article *)self); break; | |
| | ^~~~~~~~~~~~~~~~~~~ | |
| | sp_Article_cls_all | |
| /tmp/out.c:2049:23: warning: assignment to ‘sp_StrArray *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] | |
| 2049 | case 67LL: _t24 = sp_Article_validate((sp_Article *)self); break; | |
| | ^ | |
| /tmp/out.c: In function ‘sp_ActionDispatch_IntegrationTest_get’: | |
| /tmp/out.c:2957:100: warning: passing argument 4 of ‘sp_ActionDispatch_IntegrationTest_dispatch_request’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 2957 | return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "GET")[1]), lv_path, lv_params); | |
| | ^~~~~~~~~ | |
| | | | |
| | sp_StrIntHash * | |
| /tmp/out.c:1137:183: note: expected ‘sp_SymPolyHash *’ but argument is of type ‘sp_StrIntHash *’ | |
| 1137 | static sp_ActionResponse * sp_ActionDispatch_IntegrationTest_dispatch_request(sp_ActionDispatch_IntegrationTest *self, const char * lv_method, const char * lv_path, sp_SymPolyHash * lv_params); | |
| | ~~~~~~~~~~~~~~~~~^~~~~~~~~ | |
| /tmp/out.c: In function ‘sp_ActionDispatch_IntegrationTest_delete’: | |
| /tmp/out.c:2990:103: warning: passing argument 4 of ‘sp_ActionDispatch_IntegrationTest_dispatch_request’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 2990 | return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "DELETE")[1]), lv_path, lv_params); | |
| | ^~~~~~~~~ | |
| | | | |
| | sp_StrIntHash * | |
| /tmp/out.c:1137:183: note: expected ‘sp_SymPolyHash *’ but argument is of type ‘sp_StrIntHash *’ | |
| 1137 | static sp_ActionResponse * sp_ActionDispatch_IntegrationTest_dispatch_request(sp_ActionDispatch_IntegrationTest *self, const char * lv_method, const char * lv_path, sp_SymPolyHash * lv_params); | |
| | ~~~~~~~~~~~~~~~~~^~~~~~~~~ | |
| /tmp/out.c: In function ‘sp_ActionDispatch_IntegrationTest_assert_select’: | |
| /tmp/out.c:3297:27: warning: passing argument 1 of ‘sp_re_match_p’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers] | |
| 3297 | if (!(sp_re_match_p(lv_pattern, lv_body))) { | |
| | ^~~~~~~~~~ | |
| In file included from /tmp/out.c:2: | |
| /home/runner/work/roundhouse/roundhouse/spinel-dist/lib/sp_runtime.h:2153:51: note: expected ‘mrb_regexp_pattern *’ but argument is of type ‘volatile mrb_regexp_pattern *’ | |
| 2153 | static mrb_bool sp_re_match_p(mrb_regexp_pattern *pat, const char *str) { | |
| | ~~~~~~~~~~~~~~~~~~~~^~~ | |
| /tmp/out.c: In function ‘sp_DbConn_prepare_cached’: | |
| /tmp/out.c:3450:62: warning: passing argument 2 of ‘sp_Stmt_new’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers] | |
| 3450 | sp_PtrArray_push(self->iv_entries, sp_Stmt_new(lv_sql, lv_st)); | |
| | ^~~~~ | |
| /tmp/out.c:3351:64: note: expected ‘void *’ but argument is of type ‘volatile void *’ | |
| 3351 | static inline sp_Stmt *sp_Stmt_new(const char * lv_sql, void * lv_ptr) { | |
| | ~~~~~~~^~~~~~ | |
| /tmp/out.c:3452:12: warning: return discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers] | |
| 3452 | return lv_st; | |
| | ^~~~~ | |
| /tmp/out.c: In function ‘sp_Article_new’: | |
| /tmp/out.c:4523:24: warning: implicit declaration of function ‘sp_Article_body_eq’; did you mean ‘sp_ArticleRow_body_eq’? [-Wimplicit-function-declaration] | |
| 4523 | case 67LL: _t210 = sp_Article_body_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~~~~~~~~~~~~~~~ | |
| | sp_ArticleRow_body_eq | |
| /tmp/out.c:4524:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4524 | default: _t210 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:4529:24: warning: implicit declaration of function ‘sp_Article_created_at_eq’; did you mean ‘sp_ArticleRow_created_at_eq’? [-Wimplicit-function-declaration] | |
| 4529 | case 67LL: _t211 = sp_Article_created_at_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_ArticleRow_created_at_eq | |
| /tmp/out.c:4530:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4530 | default: _t211 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:4535:24: warning: implicit declaration of function ‘sp_Article_title_eq’; did you mean ‘sp_ArticleRow_title_eq’? [-Wimplicit-function-declaration] | |
| 4535 | case 67LL: _t212 = sp_Article_title_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~~~~~~~~~~~~~~~~ | |
| | sp_ArticleRow_title_eq | |
| /tmp/out.c:4536:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4536 | default: _t212 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:4541:24: warning: implicit declaration of function ‘sp_Article_updated_at_eq’; did you mean ‘sp_ArticleRow_updated_at_eq’? [-Wimplicit-function-declaration] | |
| 4541 | case 67LL: _t213 = sp_Article_updated_at_eq((sp_Article *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~ | |
| | sp_ArticleRow_updated_at_eq | |
| /tmp/out.c:4542:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4542 | default: _t213 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article_initialize’: | |
| /tmp/out.c:4558:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4558 | default: _t214 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:4564:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4564 | default: _t215 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:4570:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4570 | default: _t216 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:4576:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 4576 | default: _t217 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article * {aka struct sp_Article_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article *’ {aka ‘struct sp_Article_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6872_new’: | |
| /tmp/out.c:5960:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 5960 | default: _t363 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:5966:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 5966 | default: _t364 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:5972:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 5972 | default: _t365 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:5978:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 5978 | default: _t366 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6872_initialize’: | |
| /tmp/out.c:5994:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 5994 | default: _t367 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6000:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6000 | default: _t368 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6006:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6006 | default: _t369 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6012:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6012 | default: _t370 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6872_update’: | |
| /tmp/out.c:6180:61: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6180 | default: _t383 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6189:60: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6189 | default: _t384 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6872 * {aka struct sp_Article__implicit_6872_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6872 *’ {aka ‘struct sp_Article__implicit_6872_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6872_comments’: | |
| /tmp/out.c:6411:36: warning: passing argument 2 of ‘sp_IntArray_push’ makes integer from pointer without a cast [-Wint-conversion] | |
| 6411 | sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | | | |
| | sp_Comment * {aka struct sp_Comment_s *} | |
| /home/runner/work/roundhouse/roundhouse/spinel-dist/lib/sp_runtime.h:970:59: note: expected ‘mrb_int’ {aka ‘long int’} but argument is of type ‘sp_Comment *’ {aka ‘struct sp_Comment_s *’} | |
| 970 | static inline void sp_IntArray_push(sp_IntArray*a,mrb_int v){if(a->frozen){sp_raise_frozen_array();return;}if(a->start+a->len>=a->cap)sp_IntArray_push_grow(a);a->data[a->start+a->len]=v;a->len++;} | |
| | ~~~~~~~~^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6872__preload_comments’: | |
| /tmp/out.c:6423:29: warning: assignment to ‘sp_IntArray *’ from ‘mrb_int’ {aka ‘long int’} makes pointer from integer without a cast [-Wint-conversion] | |
| 6423 | self->iv_comments_cache = lv_list; | |
| | ^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6906_new’: | |
| /tmp/out.c:6557:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6557 | default: _t437 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6563:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6563 | default: _t438 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6569:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6569 | default: _t439 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6575:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6575 | default: _t440 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6906_initialize’: | |
| /tmp/out.c:6591:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6591 | default: _t441 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6597:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6597 | default: _t442 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6603:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6603 | default: _t443 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6609:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6609 | default: _t444 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6906_update’: | |
| /tmp/out.c:6777:61: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6777 | default: _t457 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:6786:60: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 6786 | default: _t458 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_6906 * {aka struct sp_Article__implicit_6906_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_6906 *’ {aka ‘struct sp_Article__implicit_6906_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6906_comments’: | |
| /tmp/out.c:7008:36: warning: passing argument 2 of ‘sp_IntArray_push’ makes integer from pointer without a cast [-Wint-conversion] | |
| 7008 | sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | | | |
| | sp_Comment * {aka struct sp_Comment_s *} | |
| /home/runner/work/roundhouse/roundhouse/spinel-dist/lib/sp_runtime.h:970:59: note: expected ‘mrb_int’ {aka ‘long int’} but argument is of type ‘sp_Comment *’ {aka ‘struct sp_Comment_s *’} | |
| 970 | static inline void sp_IntArray_push(sp_IntArray*a,mrb_int v){if(a->frozen){sp_raise_frozen_array();return;}if(a->start+a->len>=a->cap)sp_IntArray_push_grow(a);a->data[a->start+a->len]=v;a->len++;} | |
| | ~~~~~~~~^ | |
| /tmp/out.c:7011:12: warning: returning ‘sp_IntArray *’ from a function with incompatible return type ‘sp_PtrArray *’ [-Wincompatible-pointer-types] | |
| 7011 | return (sp_IntArray *)lv_results; | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_6906_before_destroy’: | |
| /tmp/out.c:7034:12: warning: assignment to ‘mrb_int’ {aka ‘long int’} from ‘sp_Comment *’ {aka ‘struct sp_Comment_s *’} makes integer from pointer without a cast [-Wint-conversion] | |
| 7034 | lv_c = _t504; | |
| | ^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7484_new’: | |
| /tmp/out.c:7106:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7106 | default: _t508 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7112:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7112 | default: _t509 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7118:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7118 | default: _t510 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7124:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7124 | default: _t511 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7484_initialize’: | |
| /tmp/out.c:7140:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7140 | default: _t512 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7146:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7146 | default: _t513 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7152:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7152 | default: _t514 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7158:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7158 | default: _t515 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7484_update’: | |
| /tmp/out.c:7326:61: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7326 | default: _t527 = sp_Article__implicit_9372_title_eq(self, lv_p->iv_title); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7335:60: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7335 | default: _t528 = sp_Article__implicit_9372_body_eq(self, lv_p->iv_body); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7484 * {aka struct sp_Article__implicit_7484_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7484 *’ {aka ‘struct sp_Article__implicit_7484_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7484_comments’: | |
| /tmp/out.c:7557:36: warning: passing argument 2 of ‘sp_IntArray_push’ makes integer from pointer without a cast [-Wint-conversion] | |
| 7557 | sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | | | |
| | sp_Comment * {aka struct sp_Comment_s *} | |
| /home/runner/work/roundhouse/roundhouse/spinel-dist/lib/sp_runtime.h:970:59: note: expected ‘mrb_int’ {aka ‘long int’} but argument is of type ‘sp_Comment *’ {aka ‘struct sp_Comment_s *’} | |
| 970 | static inline void sp_IntArray_push(sp_IntArray*a,mrb_int v){if(a->frozen){sp_raise_frozen_array();return;}if(a->start+a->len>=a->cap)sp_IntArray_push_grow(a);a->data[a->start+a->len]=v;a->len++;} | |
| | ~~~~~~~~^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7484__preload_comments’: | |
| /tmp/out.c:7569:29: warning: assignment to ‘sp_IntArray *’ from ‘mrb_int’ {aka ‘long int’} makes pointer from integer without a cast [-Wint-conversion] | |
| 7569 | self->iv_comments_cache = lv_list; | |
| | ^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7995_new’: | |
| /tmp/out.c:7703:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7703 | default: _t581 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7709:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7709 | default: _t582 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7715:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7715 | default: _t583 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7721:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7721 | default: _t584 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7995_initialize’: | |
| /tmp/out.c:7737:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7737 | default: _t585 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7743:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7743 | default: _t586 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7749:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7749 | default: _t587 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7755:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7755 | default: _t588 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7995_update’: | |
| /tmp/out.c:7923:61: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7923 | default: _t600 = sp_Article__implicit_9372_title_eq(self, lv_p->iv_title); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:7932:60: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 7932 | default: _t601 = sp_Article__implicit_9372_body_eq(self, lv_p->iv_body); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_7995 * {aka struct sp_Article__implicit_7995_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_7995 *’ {aka ‘struct sp_Article__implicit_7995_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7995_comments’: | |
| /tmp/out.c:8154:36: warning: passing argument 2 of ‘sp_IntArray_push’ makes integer from pointer without a cast [-Wint-conversion] | |
| 8154 | sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | | | |
| | sp_Comment * {aka struct sp_Comment_s *} | |
| /home/runner/work/roundhouse/roundhouse/spinel-dist/lib/sp_runtime.h:970:59: note: expected ‘mrb_int’ {aka ‘long int’} but argument is of type ‘sp_Comment *’ {aka ‘struct sp_Comment_s *’} | |
| 970 | static inline void sp_IntArray_push(sp_IntArray*a,mrb_int v){if(a->frozen){sp_raise_frozen_array();return;}if(a->start+a->len>=a->cap)sp_IntArray_push_grow(a);a->data[a->start+a->len]=v;a->len++;} | |
| | ~~~~~~~~^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_7995__preload_comments’: | |
| /tmp/out.c:8166:29: warning: assignment to ‘sp_IntArray *’ from ‘mrb_int’ {aka ‘long int’} makes pointer from integer without a cast [-Wint-conversion] | |
| 8166 | self->iv_comments_cache = lv_list; | |
| | ^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_9355_new’: | |
| /tmp/out.c:8300:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8300 | default: _t654 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:8306:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8306 | default: _t655 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:8312:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8312 | default: _t656 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:8318:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8318 | default: _t657 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_9355_initialize’: | |
| /tmp/out.c:8334:56: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8334 | default: _t658 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:8340:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_created_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8340 | default: _t659 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1452:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1452 | static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:8346:57: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8346 | default: _t660 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:8352:62: warning: passing argument 1 of ‘sp_Article__implicit_9372_updated_at_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8352 | default: _t661 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1456:90: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1456 | static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_9355_update’: | |
| /tmp/out.c:8520:61: warning: passing argument 1 of ‘sp_Article__implicit_9372_title_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8520 | default: _t674 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1454:85: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1454 | static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c:8529:60: warning: passing argument 1 of ‘sp_Article__implicit_9372_body_eq’ from incompatible pointer type [-Wincompatible-pointer-types] | |
| 8529 | default: _t675 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| | ^~~~ | |
| | | | |
| | sp_Article__implicit_9355 * {aka struct sp_Article__implicit_9355_s *} | |
| /tmp/out.c:1450:84: note: expected ‘sp_Article__implicit_9372 *’ {aka ‘struct sp_Article__implicit_9372_s *’} but argument is of type ‘sp_Article__implicit_9355 *’ {aka ‘struct sp_Article__implicit_9355_s *’} | |
| 1450 | static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | |
| /tmp/out.c: In function ‘sp_Article__implicit_9355_comments’: | |
| /tmp/out.c:8751:36: warning: passing argument 2 of ‘sp_IntArray_push’ makes integer from pointer without a cast [-Wint-conversion] | |
| 8751 | sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | | | |
| | sp_Comment * {aka struct sp_Comment_s *} | |
| /home/runner/work/roundhouse/roundhouse/spinel-dist/lib/sp_runtime.h:970:59: note: expected ‘mrb_int’ {aka ‘long int’} but argument is of type ‘sp_Comment *’ {aka ‘struct sp_Comment_s *’} | |
| 970 | static inline void sp_IntArray_push(sp_IntArray*a,mrb_int v){if(a->frozen){sp_raise_frozen_array();return;}if(a->start+a->len>=a->cap)sp_IntArray_push_grow(a);a->data[a->start+a->len]=v;a->len++;} | |
| | ~~~~~~~~^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_9355__preload_comments’: | |
| /tmp/out.c:8763:29: warning: assignment to ‘sp_IntArray *’ from ‘mrb_int’ {aka ‘long int’} makes pointer from integer without a cast [-Wint-conversion] | |
| 8763 | self->iv_comments_cache = lv_list; | |
| | ^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_9372_comments’: | |
| /tmp/out.c:9298:36: warning: passing argument 2 of ‘sp_IntArray_push’ makes integer from pointer without a cast [-Wint-conversion] | |
| 9298 | sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(lv_stmt)); | |
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| | | | |
| | sp_Comment * {aka struct sp_Comment_s *} | |
| /home/runner/work/roundhouse/roundhouse/spinel-dist/lib/sp_runtime.h:970:59: note: expected ‘mrb_int’ {aka ‘long int’} but argument is of type ‘sp_Comment *’ {aka ‘struct sp_Comment_s *’} | |
| 970 | static inline void sp_IntArray_push(sp_IntArray*a,mrb_int v){if(a->frozen){sp_raise_frozen_array();return;}if(a->start+a->len>=a->cap)sp_IntArray_push_grow(a);a->data[a->start+a->len]=v;a->len++;} | |
| | ~~~~~~~~^ | |
| /tmp/out.c: In function ‘sp_Article__implicit_9372__preload_comments’: | |
| /tmp/out.c:9310:29: warning: assignment to ‘sp_IntArray *’ from ‘mrb_int’ {aka ‘long int’} makes pointer from integer without a cast [-Wint-conversion] | |
| 9310 | self->iv_comments_cache = lv_list; | |
| | ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment