Add missing files

This commit is contained in:
Quentin Dufour 2019-02-19 10:38:01 +01:00
parent fc039b6045
commit 349909ff47
2 changed files with 17 additions and 0 deletions

12
src/url.c Normal file
View 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
View 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);