[BACK]Return to theo.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Annotation of src/usr.bin/mg/theo.c, Revision 1.92

1.92    ! cloder      1: /*     $OpenBSD: theo.c,v 1.91 2005/10/14 19:46:46 kjell Exp $ */
1.45      art         2: /*
                      3:  * Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
1.58      deraadt     4:  * All rights reserved.
1.45      art         5:  *
1.58      deraadt     6:  * Redistribution and use in source and binary forms, with or without
                      7:  * modification, are permitted provided that the following conditions
                      8:  * are met:
1.45      art         9:  *
1.58      deraadt    10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
1.45      art        12:  * 2. The name of the author may not be used to endorse or promote products
1.58      deraadt    13:  *    derived from this software without specific prior written permission.
1.45      art        14:  *
                     15:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
                     16:  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
                     17:  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
                     18:  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
                     19:  * EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
                     20:  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
                     21:  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
                     22:  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
                     23:  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1.58      deraadt    24:  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.45      art        25:  */
1.19      hugh       26:
1.1       art        27: #include "def.h"
                     28: #include "kbd.h"
                     29: #include "funmap.h"
                     30:
1.81      db         31: void           theo_init(void);
1.1       art        32: static int     theo_analyze(int, int);
                     33: static int     theo(int, int);
                     34:
                     35: static PF theo_pf[] = {
1.81      db         36:        theo_analyze
1.1       art        37: };
                     38:
                     39: static struct KEYMAPE (1 + IMAPEXT) theomap = {
                     40:        1,
                     41:        1 + IMAPEXT,
                     42:        rescan,
                     43:        {
1.81      db         44:                { CCHR('M'), CCHR('M'), theo_pf, NULL }
1.1       art        45:        }
                     46: };
                     47:
                     48: void
                     49: theo_init(void)
                     50: {
                     51:        funmap_add(theo, "theo");
                     52:        maps_add((KEYMAP *)&theomap, "theo");
                     53: }
                     54:
1.91      kjell      55: /* ARGSUSED */
1.1       art        56: static int
                     57: theo(int f, int n)
                     58: {
1.81      db         59:        BUFFER  *bp;
                     60:        MGWIN   *wp;
1.1       art        61:
                     62:        bp = bfind("theo", TRUE);
                     63:        if (bclear(bp) != TRUE)
1.81      db         64:                return (FALSE);
1.1       art        65:
                     66:        bp->b_modes[0] = name_mode("fundamental");
                     67:        bp->b_modes[1] = name_mode("theo");
                     68:        bp->b_nmodes = 1;
                     69:
                     70:        if ((wp = popbuf(bp)) == NULL)
1.81      db         71:                return (FALSE);
1.1       art        72:
1.90      deraadt    73:        curbp = bp;
1.1       art        74:        curwp = wp;
1.81      db         75:        return (TRUE);
1.1       art        76: }
                     77:
1.3       mickey     78: static const char *talk[] = {
1.1       art        79:        "Write more code.",
                     80:        "Make more commits.",
                     81:        "That's because you have been slacking.",
                     82:        "slacker!",
                     83:        "That's what happens when you're lazy.",
                     84:        "idler!",
                     85:        "slackass!",
                     86:        "lazy bum!",
1.2       millert    87:        "Stop slacking you lazy bum!",
1.4       mickey     88:        "slacker slacker lazy bum bum bum slacker!",
1.5       miod       89:        "I could search... but I'm a lazy bum ;)",
1.6       mickey     90:        "sshutup sshithead, ssharpsshooting susshi sshplats ssharking assholes.",
1.7       mickey     91:        "Lazy bums slacking on your asses.",
1.8       beck       92:        "35 commits an hour? That's pathetic!",
1.9       angelos    93:        "Fine software takes time to prepare.  Give a little slack.",
1.20      hugh       94:        "emacs on the vax",
1.13      mickey     95:        "Just a minute ago we were hugging and now you, guys, do not love me anymore",
1.11      fgsch      96:        "I'll let you know when I need to floss my teeth",
1.12      fgsch      97:        "If you can't figure out yourself, you're lacking some mental faculties",
                     98:        "I am just stating a fact",
                     99:        "blah blah",
                    100:        "i'd love to hack, but i can't",
                    101:        "Wait, yes, I am on drugs",
1.14      mickey    102:        "during release it is a constant.  almost noone helps.",
1.15      mickey    103:        "i let you guys do whatever you wanted",
1.16      beck      104:        "you bring new meaning to the terms slackass. I will have to invent a new term.",
                    105:        "if they cut you out, muddy their back yards",
1.17      beck      106:        "Make them want to start over, and play nice the next time.",
1.21      miod      107:        "It is clear that this has not been thought through.",
1.29      mickey    108:        "avoid using abort().  it is not nice.",
1.22      beck      109:        "if you do not test that, you are banned from editing theo.c",
1.23      kjell     110:        "That's the most ridiculous thing I've heard in the last two or three minutes!",
1.24      aaron     111:        "I'm not just doing this for crowd response. I need to be right.",
1.25      beck      112:        "i admit you are better than i am...",
1.26      kjell     113:        "I'd put a fan on my bomb.. And blinking lights...",
1.27      kjell     114:        "I love to fight",
1.28      miod      115:        "I am not concerned with commit count",
1.29      mickey    116:        "No sane people allowed here.  Go home.",
1.30      henning   117:        "you have to stop peeing on your breakfast",
1.31      henning   118:        "feature requests come from idiots",
1.32      mickey    119:        "henning and darren / sitting in a tree / t o k i n g / a joint or three",
1.33      henning   120:        "KICK ASS. TIME FOR A JASON LOVE IN!  WE CAN ALL GET LOST IN HIS HAIR!",
1.34      henning   121:        "shame on you for following my rules.",
1.35      henning   122:        "altq's parser sucks dead whale farts through the finest chemistry pipette's",
1.36      pvalchev  123:        "screw this operating system shit, i just want to drive!",
1.37      henning   124:        "That is the most stupid thing I have heard all week.",
1.38      miod      125:        "Search for fuck.  Anytime you see that word, you have a paragraph to write.",
1.39      mickey    126:        "what I'm doing [...] is hell. it's kind of fun.",
1.40      henning   127:        "Yes, but the ports people are into S&M.",
1.43      mcbride   128:        "Buttons are for idiots.",
1.44      grange    129:        "We are not hackers. We are turd polishing craftsmen.",
1.46      henning   130:        "if ya break cvs, we hunt ya and break yer legs",
1.47      grange    131:        "who cares.  style(9) can bite my ass",
1.48      mickey    132:        "The argument is totally Linux.",
1.49      mickey    133:        "It'd be one fucking happy planet if it wasn't for what's under this fucking sticker.",
1.50      drahn     134:        "noone is gonna add that thing to theo.c?  wow, i'm stunned.  no henning?",
                    135:        "I would explain, but I am too drunk.",
                    136:        "Take a picture of my butt, it's what everyone wants.",
1.60      mickey    137:        "you slackers don't deserve pictures yet",
1.51      henning   138:        "You guys are about four days behind on theo.c",
1.74      miod      139:        "I'm just talking.",
1.53      todd      140:        "Vegetarian my ass",
1.56      pvalchev  141:        "Wait a minute, that's a McNally's!",
1.55      henning   142:        "Your connection is breaking up.",
1.57      henning   143:        "germans are not allowed to get involved there",
1.59      henning   144:        "gprs sucks camel dick dryer than the gobi desert",
1.62      jolan     145:        "I AM NEVER SATISFIED",
                    146:        "don't they recognize their moral responsibility to entertain me?",
1.63      mickey    147:        "#ifdef is for emacs developers.",
1.74      miod      148:        "Many well known people become net-kooks in their later life, because they lose touch with reality.",
1.64      mcbride   149:        "You're not allowed to have an opinion.",
1.66      marco     150:        "tweep tweep tweep",
1.74      miod      151:        "Quite frankly, SSE's alignment requirement is the most utterly retarded idea since eating your own shit.",
                    152:        "Holy verbose prom startup Batman.",
                    153:        "Do you think you are exempt from COMPILING BEFORE YOU COMMIT",
1.71      marco     154:        "I want to be REALLY COOL just like all the other developers!",
1.74      miod      155:        "I don't know what you are talking about.  Please tell me what you are talking about.",
                    156:        "I avoid helping people who refuse to learn how to help themselves.",
1.71      marco     157:        "Any day now, when we sell out.",
                    158:        "And there you have it.. the distinction between those people who are OpenBSD develepers and those who will never be able to be...",
1.74      miod      159:        "I don't mean this applies to everyone, but is there a high quantity of attention deficit disorder in our user community?  Or retards?",
1.71      marco     160:        "Have you been living in a cave, or are you just being a jerk?",
1.74      miod      161:        "If you want it, go do the stinking work yourself.",
1.73      henning   162:        "A burp means less gas later",
1.75      henning   163:        "optimism in man kind does not belong here",
1.76      henning   164:        "First user who tries to push this button, he pounds into the ground with a rant of death.",
1.77      marco     165:        "we did farts.  now we do sperm.  we are cutting edge.",
1.78      jolan     166:        "the default configuration is a mixture of piss, puke, shit, and bloody entrails.",
                    167:        "Stop wasting your time reading people's licenses.",
                    168:        "doing it with environment variables is OH SO SYSTEM FIVE LIKE OH MY GOD PASS ME THE SPOON",
1.79      jolan     169:        "Linux is fucking POO, not just bad, bad REALLY REALLY BAD",
1.80      henning   170:        "openbsd development is slow because lots of developers have shrunken balls",
                    171:        "penguins are not much more than chickens that swim.",
1.82      djm       172:        "i am a packet sniffing fool, let me wipe my face with my own poo",
1.83      jcs       173:        "they are manual pages, not tea time chit-chats",
1.84      todd      174:        "Whiners.  They scale really well.",
1.85      todd      175:        "in your world, you would have a checklist of 50 fucking workarounds just to make a coffee.",
1.86      henning   176:        "for once, I have nothing to say.",
1.87      jason     177:        "You have no idea how fucked we are",
1.88      reyk      178:        "You can call it fart if you want to.",
1.89      marco     179:        "wavelan is a battle field",
1.92    ! cloder    180:        "If you don't know what you are talking about, why are you talking?",
        !           181:        "You are in a maze of gpio pins, all alike, all undocumented, and a few are wired to bombs."
1.1       art       182: };
                    183:
1.3       mickey    184: static const int ntalk = sizeof(talk)/sizeof(talk[0]);
1.1       art       185:
1.91      kjell     186: /* ARGSUSED */
1.1       art       187: static int
                    188: theo_analyze(int f, int n)
                    189: {
1.81      db        190:        const char      *str;
                    191:        int              len;
1.1       art       192:
                    193:        str = talk[arc4random() % ntalk];
                    194:        len = strlen(str);
                    195:
                    196:        newline(FFRAND, 2);
                    197:
1.81      db        198:        while (len--)
1.1       art       199:                linsert(1, *str++);
                    200:
                    201:        newline(FFRAND, 2);
                    202:
1.81      db        203:        return (TRUE);
1.2       millert   204: }