Add missing files
This commit is contained in:
parent
fc039b6045
commit
349909ff47
2 changed files with 17 additions and 0 deletions
12
src/url.c
Normal file
12
src/url.c
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#include "url.h"
|
||||||
|
|
||||||
|
char* url_get_port(char* out, char* in) {
|
||||||
|
sscanf(in, "%*[a-z]:%*[a-z]:%*[a-zA-Z0-9.]:%[0-9]", out);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
int url_get_port_int(char* in) {
|
||||||
|
int out;
|
||||||
|
sscanf(in, "%*[a-z]:%*[a-z]:%*[a-zA-Z0-9.]:%d", &out);
|
||||||
|
return out;
|
||||||
|
}
|
5
src/url.h
Normal file
5
src/url.h
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#pragma once
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
char* url_get_port(char* out, char* in);
|
||||||
|
int url_get_port_int(char* in);
|
Loading…
Reference in a new issue