Skip to content

Commit

Permalink
reorganized includes, added versioning macros, update rev
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw committed Sep 21, 2014
1 parent ee59987 commit 09477b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
11 changes: 10 additions & 1 deletion src/screenfetch-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
If you have any questions, please contact me on github (http://www.github.com/woodruffw/screenfetch-c) or at william @ tuffbizz.com
*/

#define _POSIX_C_SOURCE 200112L /* makes all these systems play nicely together */

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>

#include "screenfetch-c.h" /* contains all other includes, function prototypes, macros */
#include "logos.h" /* contains ascii logos */
#include "thread.h" /* for cross-platform threading */
Expand Down Expand Up @@ -2407,7 +2416,7 @@ void main_text_output(char* data[], char* data_names[])
*/
void display_version(void)
{
printf("%s\n", "screenfetch-c - Version 1.2, revision 5");
printf("%s\n", "screenfetch-c - Version " SCREENFETCH_C_VERSION_MAJOR "." SCREENFETCH_C_VERSION_MINOR ", revision " SCREENFETCH_C_VERSION_RELEASE ".");
return;
}

Expand Down
15 changes: 4 additions & 11 deletions src/screenfetch-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@
#ifndef SCREENFETCH_C_H
#define SCREENFETCH_C_H

#define _POSIX_C_SOURCE 200112L /* makes all these systems play nicely together */

/* includes, all from the standard library */
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
/* version macros */
#define SCREENFETCH_C_VERSION_MAJOR "1"
#define SCREENFETCH_C_VERSION_MINOR "2"
#define SCREENFETCH_C_VERSION_RELEASE "6"

/* a number is assigned to each OS or OS family */
#define UNKNOWN 0
Expand Down Expand Up @@ -73,7 +68,6 @@
#define OS UNKNOWN
#endif


/* color/fmt definitions */
#define TNRM "\x1B[0m" /* normal */
#define TBLK "\x1B[30m" /* black */
Expand Down Expand Up @@ -103,7 +97,6 @@
#define ERROR_OUT(str1, str2) (fprintf(stderr, TWHT "[[ " TLRD "!" TWHT " ]] " TNRM "%s%s\n", str1, str2))
#define VERBOSE_OUT(str1, str2) (fprintf(stdout, TLRD ":: " TNRM "%s%s\n", str1, str2))


/* screenfetch detection function definitions */
void detect_distro(char* str);
void detect_arch(char* str);
Expand Down

0 comments on commit 09477b1

Please sign in to comment.