static@staticfox:/srv/staticfox.net/public_html$ # Welcome! Additional information is at the bottom of this page!
static@staticfox:/srv/staticfox.net/public_html$ clang site.c -std=c11 -Wall -Wextra -Werror -pedantic -o site
static@staticfox:/srv/staticfox.net/public_html$
static@staticfox:/srv/staticfox.net/public_html$ ./site
Welcome to my site!
Below, you can find some information about me as well as how to get ahold of me.
About me
I am a programmer, with a background in C, C++, Ruby, PHP, Python, Rust, Haskell, and Go.
Contact
Github: https://github.com/staticfox
Email: staticfox@staticfox.net
IRC: #blindsight @ irc.gamesurge.net
static@staticfox:/srv/staticfox.net/public_html$ nano site.c
/*
* https://staticfox.net: A less than useful website
* site.c: The website home page
*
* Copyright (C) 2016 staticfox <staticfox@staticfox.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include <stdio.h>
struct text_node {
const char *tagline;
const char *description;
};
static void
getIntro(struct text_node *greet)
{
greet->tagline = "Welcome to my site!";
greet->description = "Below, you can find some information about me as well as how to get ahold of me.\n";
}
static void
getAbout(struct text_node *about)
{
about->tagline = "About me";
about->description = "I am a programmer, with a background in C, C++, Ruby, PHP, Python, Haskell, and Go.\n;"
}
static void
getContact(struct text_node *contact)
{
contact->tagline = "Contact";
contact->description = "Github: https://github.com/staticfox\n"
"Email: staticfox@staticfox.net\n";
"IRC: #blindsight @ irc.gamesurge.net\n";
}
static void
printData(struct text_node *nodes, size_t count)
{
for(size_t i = 0; i < count; i++)
{
if(!nodes[i].tagline)
continue;
printf("%s\n", nodes[i].tagline);
printf("%s\n", nodes[i].description);
}
}
int
main(void)
{
size_t idx = 0;
struct text_node nodes[3];
getIntro(&nodes[idx++]);
getAbout(&nodes[idx++]);
getContact(&nodes[idx++]);
printData(nodes, sizeof(nodes) / sizeof(*nodes));
return 0;
}