27int main(
int argc,
char **argv) {
28 const char *username =
"izelnakri";
32 for (
int i = 1; i < argc; i++) {
33 if (strcmp(argv[i],
"--user") == 0 && i + 1 < argc) {
34 username = argv[i + 1];
36 }
else if (strncmp(argv[i],
"--user=", 7) == 0) {
37 username = argv[i] + 7;
38 }
else if (strcmp(argv[i],
"--server") == 0) {
40 }
else if (strncmp(argv[i],
"--port=", 7) == 0) {
42 port = (int)strtol(argv[i] + 7, &endptr, 10);
43 if (endptr == argv[i] + 7 || *endptr !=
'\0') {
44 (void)fprintf(stderr,
"Invalid port number: %s\n", argv[i] + 7);
void start_http_server(int port)
Starts an HTTP server on the specified port.
Declaration of the HTTP server functions.
Structure representing a GitHub user.
void print_github_user(const User *user)
Print a User's information to the console.
User fetch_github_user(const char *username)
Fetch a GitHub user's information via the GitHub API.