Annotation of src/usr.bin/mg/theo.c, Revision 1.37
1.37 ! henning 1: /* $OpenBSD: theo.c,v 1.36 2002/11/25 00:45:00 pvalchev Exp $ */
1.19 hugh 2:
1.1 art 3: #include "def.h"
4: #include "kbd.h"
5: #include "funmap.h"
6:
7: void theo_init(void);
8: static int theo_analyze(int, int);
9: static int theo(int, int);
10:
11: static PF theo_pf[] = {
12: theo_analyze,
13: };
14:
15: static struct KEYMAPE (1 + IMAPEXT) theomap = {
16: 1,
17: 1 + IMAPEXT,
18: rescan,
19: {
20: { CCHR('M'), CCHR('M'), theo_pf, NULL },
21: }
22: };
23:
24: static BUFFER *tbuf;
25:
26: void
27: theo_init(void)
28: {
29: funmap_add(theo, "theo");
30: maps_add((KEYMAP *)&theomap, "theo");
31: }
32:
33: static int
34: theo(int f, int n)
35: {
36: BUFFER *bp;
37: MGWIN *wp;
38:
39: bp = bfind("theo", TRUE);
40: if (bclear(bp) != TRUE)
41: return FALSE;
42:
43: bp->b_modes[0] = name_mode("fundamental");
44: bp->b_modes[1] = name_mode("theo");
45: bp->b_nmodes = 1;
46:
47: if ((wp = popbuf(bp)) == NULL)
48: return FALSE;
49:
50: tbuf = curbp = bp;
51: curwp = wp;
52: return TRUE;
53: }
54:
1.3 mickey 55: static const char *talk[] = {
1.1 art 56: "Write more code.",
57: "Make more commits.",
58: "That's because you have been slacking.",
59: "slacker!",
60: "That's what happens when you're lazy.",
61: "idler!",
62: "slackass!",
63: "lazy bum!",
1.2 millert 64: "Stop slacking you lazy bum!",
1.4 mickey 65: "slacker slacker lazy bum bum bum slacker!",
1.5 miod 66: "I could search... but I'm a lazy bum ;)",
1.6 mickey 67: "sshutup sshithead, ssharpsshooting susshi sshplats ssharking assholes.",
1.7 mickey 68: "Lazy bums slacking on your asses.",
1.8 beck 69: "35 commits an hour? That's pathetic!",
1.9 angelos 70: "Fine software takes time to prepare. Give a little slack.",
1.20 hugh 71: "emacs on the vax",
1.13 mickey 72: "Just a minute ago we were hugging and now you, guys, do not love me anymore",
1.11 fgsch 73: "I'll let you know when I need to floss my teeth",
1.12 fgsch 74: "If you can't figure out yourself, you're lacking some mental faculties",
75: "I am just stating a fact",
76: "blah blah",
77: "i'd love to hack, but i can't",
78: "Wait, yes, I am on drugs",
1.14 mickey 79: "during release it is a constant. almost noone helps.",
1.15 mickey 80: "i let you guys do whatever you wanted",
1.16 beck 81: "you bring new meaning to the terms slackass. I will have to invent a new term.",
82: "if they cut you out, muddy their back yards",
1.17 beck 83: "Make them want to start over, and play nice the next time.",
1.21 miod 84: "It is clear that this has not been thought through.",
1.29 mickey 85: "avoid using abort(). it is not nice.",
1.22 beck 86: "if you do not test that, you are banned from editing theo.c",
1.23 kjell 87: "That's the most ridiculous thing I've heard in the last two or three minutes!",
1.24 aaron 88: "I'm not just doing this for crowd response. I need to be right.",
1.25 beck 89: "i admit you are better than i am...",
1.26 kjell 90: "I'd put a fan on my bomb.. And blinking lights...",
1.27 kjell 91: "I love to fight",
1.28 miod 92: "I am not concerned with commit count",
1.29 mickey 93: "No sane people allowed here. Go home.",
1.30 henning 94: "you have to stop peeing on your breakfast",
1.31 henning 95: "feature requests come from idiots",
1.32 mickey 96: "henning and darren / sitting in a tree / t o k i n g / a joint or three",
1.33 henning 97: "KICK ASS. TIME FOR A JASON LOVE IN! WE CAN ALL GET LOST IN HIS HAIR!",
1.34 henning 98: "shame on you for following my rules.",
1.35 henning 99: "altq's parser sucks dead whale farts through the finest chemistry pipette's",
1.36 pvalchev 100: "screw this operating system shit, i just want to drive!",
1.37 ! henning 101: "That is the most stupid thing I have heard all week.",
! 102: "Search for fuck. Anytime you see that word, you have a paragraph to write."
1.1 art 103: };
104:
1.3 mickey 105: static const int ntalk = sizeof(talk)/sizeof(talk[0]);
1.1 art 106:
107: static int
108: theo_analyze(int f, int n)
109: {
1.3 mickey 110: const char *str;
1.1 art 111: int len;
112:
113: str = talk[arc4random() % ntalk];
114: len = strlen(str);
115:
116: newline(FFRAND, 2);
117:
118: while (len--) {
119: linsert(1, *str++);
120: }
121:
122: newline(FFRAND, 2);
123:
124: return TRUE;
1.2 millert 125: }