|
|
| version 1.24, 2004/12/23 16:18:21 | version 1.25, 2004/12/23 16:54:52 |
|---|---|
| Line 58 static char *lsplit(char **string_ref, c | Line 58 static char *lsplit(char **string_ref, c |
| return result; | return result; |
| } | } |
| static char* rsplit(char* string, char delim) { | |
| if(string) { | |
| char* v=strrchr(string, delim); | |
| if(v) { | |
| *v=0; | |
| return v+1; | |
| } | |
| } | |
| return NULL; | |
| } | |
| static void toupper_str(char *out, const char *in, size_t size) { | static void toupper_str(char *out, const char *in, size_t size) { |
| while(size--) | while(size--) |
| *out++=(char)toupper(*in++); | *out++=(char)toupper(*in++); |
| Line 104 public: | Line 115 public: |
| void **connection_ref ///< output: Connection* | void **connection_ref ///< output: Connection* |
| ) { | ) { |
| char *user=url; | char *user=url; |
| char *host=lsplit(user, '@'); | char *host=rsplit(user, '@'); |
| char *db=lsplit(host, '/'); | char *db=lsplit(host, '/'); |
| char *pwd=lsplit(user, ':'); | char *pwd=lsplit(user, ':'); |
| char *port=lsplit(host, ':'); | char *port=lsplit(host, ':'); |