Compare commits

...

6 commits

7 changed files with 193 additions and 22 deletions

43
basic.c
View file

@ -16,6 +16,17 @@ void rainbow_8() {
draw(6, colors);
}
void aromantic_8() {
color colors [] = {
GREEN,
L_GREEN,
WHITE,
GRAY,
BLACK
};
draw(5, colors);
}
void aroace_8() {
color colors [] = {
YELLOW,
@ -27,6 +38,27 @@ void aroace_8() {
draw(5, colors);
}
void asexual_8() {
color colors [] = {
BLACK,
GRAY,
WHITE,
MAGENTA
};
draw(4, colors);
}
void bigender_8() {
color colors [] = {
L_RED,
L_YELLOW,
WHITE,
MAGENTA,
L_BLUE
};
draw(5, colors);
}
void bisexual_8() {
color colors [] = {
RED,
@ -49,6 +81,17 @@ void gay_8() {
draw(5, colors);
}
void genderfluid_8() {
color colors [] = {
L_RED,
WHITE,
MAGENTA,
BLACK,
BLUE
};
draw(5, colors);
}
void lesbian_8() {
color colors [] = {
RED,

View file

@ -18,9 +18,13 @@
#define WHITE 15
void rainbow_8();
void aromantic_8();
void aroace_8();
void asexual_8();
void bigender_8();
void bisexual_8();
void gay_8();
void genderfluid_8();
void lesbian_8();
void nonbinary_8();
void pansexual_8();

43
full.c
View file

@ -16,6 +16,17 @@ void rainbow_256() {
draw(6, colors);
}
void aromantic_256() {
color colors [] = {
40, // green
83, // light green
255, // white
249, // gray
16 // black
};
draw(5, colors);
}
void aroace_256() {
color colors [] = {
172, // orange
@ -27,6 +38,27 @@ void aroace_256() {
draw(5, colors);
}
void asexual_256() {
color colors [] = {
16, // black
249, // gray
255, // white
90 // purple
};
draw(4, colors);
}
void bigender_256() {
color colors [] = {
204, // pink
227, // yellow
255, // white
134, // purple
69 // blue
};
draw(5, colors);
}
void bisexual_256() {
color colors [] = {
161, // magenta
@ -51,6 +83,17 @@ void gay_256() {
draw(7, colors);
}
void genderfluid_256() {
color colors[] = {
204, // pink
255, // white
164, // purple
16, // black
63, // blue
};
draw(5, colors);
}
void lesbian_256() {
color colors [] = {
202, // orange

4
full.h
View file

@ -3,9 +3,13 @@
#include "draw.h"
void rainbow_256();
void aromantic_256();
void aroace_256();
void asexual_256();
void bigender_256();
void bisexual_256();
void gay_256();
void genderfluid_256();
void lesbian_256();
void nonbinary_256();
void pansexual_256();

View file

@ -1,4 +1,4 @@
build:
gcc main.c draw.c basic.c full.c -o pride-c
gcc -s main.c draw.c basic.c full.c -o pride-c

78
main.c
View file

@ -5,6 +5,7 @@
#include "draw.h"
#include "basic.h"
#include "full.h"
#include "name.h"
#define VERSION "0.0.1"
@ -23,9 +24,13 @@ void help() {
"usage: pride [name]\n\n"
"flag names:\n"
" aromantic\n"
" aroace\n"
" asexual\n"
" bigender\n"
" bisexual\n"
" gay\n"
" genderfluid\n"
" lesbian\n"
" nonbinary\n"
" pansexual\n"
@ -50,11 +55,6 @@ int main(int argc, char **argv) {
if(argc > 1) { flag = argv[1]; }
else { flag = ""; }
int color_mode = 0;
char * term = getenv("TERM");
if(strcmp(term, "linux"))
color_mode = 1;
// handle flags
if(strcmp(flag, "--version") == 0) {
version();
@ -64,62 +64,98 @@ int main(int argc, char **argv) {
return 0;
}
int color_mode = 0;
char * term = getenv("TERM");
if(strcmp(term, "linux"))
color_mode = 1;
unsigned long flag_hash = djb_hash(flag);
#ifdef DEBUG_HASH
printf("[ %lu ]\n\n", flag_hash);
return 0;
#endif
char *output;
switch(flag_hash) {
// - RAINBOW -
case 229480993726103lu: // 'rainbow'
case 5381lu: // (empty)
case RAINBOW:
case EMPTY:
if(color_mode) rainbow_256();
else rainbow_8();
break;
// - AROMANTIC -
case AROMANTIC:
case ARO:
if(color_mode) aromantic_256();
else aromantic_8();
break;
// - ARO/ACE -
case 6953324567312lu: // 'aroace'
case 22945708850429lu: // 'aro-ace'
case AROACE:
case ARO_ACE:
if(color_mode) aroace_256();
else aroace_8();
break;
// - ASEXUAL -
case ASEXUAL:
case ACE:
if(color_mode) asexual_256();
else asexual_8();
break;
// - BIGENDER -
case BIGENDER:
if(color_mode) bigender_256();
else bigender_8();
break;
// - BISEXUAL -
case 7572201611094690lu: // 'bisexual'
case 5863248lu: // 'bi'
case BISEXUAL:
case BI: // 'bi'
if(color_mode) bisexual_256();
else bisexual_8();
break;
// - GAY -
case 193492486lu: // 'gay'
case 193499371lu: // 'mlm'
case GAY:
case MLM:
if(color_mode) gay_256();
else gay_8();
break;
// - GENDERFLUID -
case GENDERFLUID:
if(color_mode) genderfluid_256();
else genderfluid_8();
break;
// - LESBIAN -
case 229473412894979lu: // 'lesbian'
case 193510271lu: // 'wlw'
case LESBIAN:
case WLW:
if(color_mode) lesbian_256();
else lesbian_8();
break;
// - NONBINARY -
case 249899779187415445lu: // 'nonbinary'
case 5863637lu: // 'nb'
case NONBINARY:
case NB:
if(color_mode) nonbinary_256();
else nonbinary_8();
break;
// - PANSEXUAL -
case 249901996007388822lu: // 'pansexual'
case 193502276lu: // 'pan'
case PANSEXUAL:
case PAN:
if(color_mode) pansexual_256();
else pansexual_8();
break;
// - TRANSGENDER -
case 13895753452281080578lu: // 'transgender'
case 210729322765lu: // 'trans'
case TRANSGENDER:
case TRANS:
if(color_mode) transgender_256();
else transgender_8();
break;

41
name.h Normal file
View file

@ -0,0 +1,41 @@
#define RAINBOW 229480993726103lu
#define EMPTY 5381lu
#define AROMANTIC 249881625443197539lu
#define ARO 193486503lu
#define AROACE 6953324567312lu
#define ARO_ACE 229459708850429lu
#define ASEXUAL 229459738843608lu
#define ACE 193485998lu
#define BIGENDER 7572201141092229lu
#define BISEXUAL 7572201611094690lu
#define BI 5863248lu
#define GAY 193492486lu
#define MLM 193499371lu
#define GENDERFLUID 13875257415654095150lu
#define LESBIAN 229473412894979lu
#define WLW 193510271lu
#define NONBINARY 249899779187415445lu
#define NB 5863637lu
#define PANSEXUAL 249901996007388822lu
#define PAN 193502276lu
#define TRANSGENDER 13895753452281080578lu
#define TRANS 210729322765lu