/* * ======== Exception_Module_startup ======== * must initialize IRQ, FIQ, (and SWI?) SPs (R13s) */ Int Exception_Module_startup (Int startupPhase) { /* set abort and undefined exception stacks */ Exception_init(); return Startup_DONE; }
int main(void) { URL_T url; char buf[BSIZE]; char *help = "Please enter a valid database connection URL and press ENTER\n" "E.g. sqlite:///tmp/sqlite.db?synchronous=off&heap_limit=2000\n" "E.g. mysql://localhost:3306/test?user=root&password=root\n" "E.g. postgresql://localhost:5432/test?user=root&password=root\n" "E.g. oracle://localhost:1526/test?user=scott&password=tiger\n" "To exit, enter '.' on a single line\n\nConnection URL> "; ZBDEBUG = true; Exception_init(); printf("============> Start Connection Pool Tests\n\n"); printf("This test will create and drop a table called zild_t in the database\n"); printf("%s", help); while (fgets(buf, BSIZE, stdin)) { if (*buf == '.') break; if (*buf == '\r' || *buf == '\n' || *buf == 0) goto next; url = URL_new(buf); if (! url) { printf("Please enter a valid database URL or stop by entering '.'\n"); goto next; } testPool(URL_toString(url)); URL_free(&url); printf("%s", help); continue; next: printf("Connection URL> "); } return 0; }
T URL_create(const char *url, ...) { if (STR_UNDEF(url)) return NULL; Exception_init(); va_list ap; va_start(ap, url); T U = ctor((uchar_t*)Str_vcat(url, ap)); va_end(ap); return U; }
T URL_new(const char *url) { if (STR_UNDEF(url)) return NULL; Exception_init(); return ctor((uchar_t*)Str_dup(url)); }