[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.134

1.134   ! tedu        1: /*     $OpenBSD: theo.c,v 1.133 2014/03/28 16:47:06 henning 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.97      deraadt    59:        struct buffer   *bp;
                     60:        struct 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:
1.109     kjell      70:        if ((wp = popbuf(bp, WNONE)) == NULL)
1.81      db         71:                return (FALSE);
1.1       art        72:
1.90      deraadt    73:        curbp = bp;
1.1       art        74:        curwp = wp;
1.122     lum        75:        onlywind(f, n);
                     76:
1.81      db         77:        return (TRUE);
1.1       art        78: }
                     79:
1.3       mickey     80: static const char *talk[] = {
1.1       art        81:        "Write more code.",
                     82:        "Make more commits.",
                     83:        "That's because you have been slacking.",
                     84:        "slacker!",
                     85:        "That's what happens when you're lazy.",
                     86:        "idler!",
                     87:        "slackass!",
                     88:        "lazy bum!",
1.2       millert    89:        "Stop slacking you lazy bum!",
1.4       mickey     90:        "slacker slacker lazy bum bum bum slacker!",
1.5       miod       91:        "I could search... but I'm a lazy bum ;)",
1.6       mickey     92:        "sshutup sshithead, ssharpsshooting susshi sshplats ssharking assholes.",
1.7       mickey     93:        "Lazy bums slacking on your asses.",
1.8       beck       94:        "35 commits an hour? That's pathetic!",
1.9       angelos    95:        "Fine software takes time to prepare.  Give a little slack.",
1.12      fgsch      96:        "I am just stating a fact",
1.16      beck       97:        "you bring new meaning to the terms slackass. I will have to invent a new term.",
                     98:        "if they cut you out, muddy their back yards",
1.17      beck       99:        "Make them want to start over, and play nice the next time.",
1.21      miod      100:        "It is clear that this has not been thought through.",
1.29      mickey    101:        "avoid using abort().  it is not nice.",
1.23      kjell     102:        "That's the most ridiculous thing I've heard in the last two or three minutes!",
1.24      aaron     103:        "I'm not just doing this for crowd response. I need to be right.",
1.26      kjell     104:        "I'd put a fan on my bomb.. And blinking lights...",
1.27      kjell     105:        "I love to fight",
1.29      mickey    106:        "No sane people allowed here.  Go home.",
1.30      henning   107:        "you have to stop peeing on your breakfast",
1.31      henning   108:        "feature requests come from idiots",
1.32      mickey    109:        "henning and darren / sitting in a tree / t o k i n g / a joint or three",
1.33      henning   110:        "KICK ASS. TIME FOR A JASON LOVE IN!  WE CAN ALL GET LOST IN HIS HAIR!",
1.34      henning   111:        "shame on you for following my rules.",
1.35      henning   112:        "altq's parser sucks dead whale farts through the finest chemistry pipette's",
1.36      pvalchev  113:        "screw this operating system shit, i just want to drive!",
1.38      miod      114:        "Search for fuck.  Anytime you see that word, you have a paragraph to write.",
1.40      henning   115:        "Yes, but the ports people are into S&M.",
1.43      mcbride   116:        "Buttons are for idiots.",
1.44      grange    117:        "We are not hackers. We are turd polishing craftsmen.",
1.47      grange    118:        "who cares.  style(9) can bite my ass",
1.49      mickey    119:        "It'd be one fucking happy planet if it wasn't for what's under this fucking sticker.",
1.50      drahn     120:        "I would explain, but I am too drunk.",
1.60      mickey    121:        "you slackers don't deserve pictures yet",
1.53      todd      122:        "Vegetarian my ass",
1.56      pvalchev  123:        "Wait a minute, that's a McNally's!",
1.62      jolan     124:        "don't they recognize their moral responsibility to entertain me?",
1.95      cloder    125:        "#ifdef is for emacs developers.",
1.74      miod      126:        "Many well known people become net-kooks in their later life, because they lose touch with reality.",
1.64      mcbride   127:        "You're not allowed to have an opinion.",
1.66      marco     128:        "tweep tweep tweep",
1.74      miod      129:        "Quite frankly, SSE's alignment requirement is the most utterly retarded idea since eating your own shit.",
                    130:        "Holy verbose prom startup Batman.",
1.71      marco     131:        "Any day now, when we sell out.",
1.75      henning   132:        "optimism in man kind does not belong here",
1.76      henning   133:        "First user who tries to push this button, he pounds into the ground with a rant of death.",
1.77      marco     134:        "we did farts.  now we do sperm.  we are cutting edge.",
1.78      jolan     135:        "the default configuration is a mixture of piss, puke, shit, and bloody entrails.",
                    136:        "Stop wasting your time reading people's licenses.",
                    137:        "doing it with environment variables is OH SO SYSTEM FIVE LIKE OH MY GOD PASS ME THE SPOON",
1.79      jolan     138:        "Linux is fucking POO, not just bad, bad REALLY REALLY BAD",
1.80      henning   139:        "penguins are not much more than chickens that swim.",
1.82      djm       140:        "i am a packet sniffing fool, let me wipe my face with my own poo",
1.84      todd      141:        "Whiners.  They scale really well.",
1.85      todd      142:        "in your world, you would have a checklist of 50 fucking workarounds just to make a coffee.",
1.86      henning   143:        "for once, I have nothing to say.",
1.87      jason     144:        "You have no idea how fucked we are",
1.88      reyk      145:        "You can call it fart if you want to.",
1.89      marco     146:        "wavelan is a battle field",
1.98      djm       147:        "You are in a maze of gpio pins, all alike, all undocumented, and a few are wired to bombs.",
1.99      kjell     148:        "And that is why humppa sucks... cause it has no cause.",
1.100     djm       149:        "cache aliasing is a problem that would have stopped in 1992 if someone had killed about 5 people who worked at Sun.",
                    150:        "Don't spread rumours about me being gentle.",
1.101     jasper    151:        "If municipal water filtering equipment was built by the gcc developers, the western world would be dead by now.",
1.103     beck      152:        "kettenis supported a new machine in my basement and all I got to do was fix a 1 character typo in his html page commit.",
1.104     henning   153:        "industry told us a lesson: when you're an asshole, they mail you hardware",
1.105     claudio   154:        "I was joking, really.  I think I am funny :-)",
1.107     djm       155:        "the kernel is a harsh mistress",
1.108     sthen     156:        "Have I ever been subtle? If my approach ever becomes subtle, shoot me.",
1.110     jasper    157:        "the acpi stabs you in the back.  the acpi stabs you in the back. you die ...",
1.111     henning   158:        "My cats are more observant than you.",
1.112     claudio   159:        "our kernels have no bugs",
1.113     oga       160:        "style(9) has all these fascist rules, and i have a problem with some of them because i didn't come up with them",
1.114     oga       161:        "I'm not very reliable",
1.115     schwarze  162:        "I don't like control",
1.118     jasper    163:        "You aren't being conservative -- you are trying to be a caveman.",
1.119     jasper    164:        "nfs loves everyone",
1.120     henning   165:        "basically, dung beetles fucking.  that's what kerberosV + openssl is like",
1.121     djm       166:        "I would rather run Windows than use vi.",
1.123     claudio   167:        "if you assign that responsibility to non-hikers I will walk over and cripple you now.",
1.124     mlarkin   168:        "i ojbect two yoru splelng of achlhlocis.",
1.125     florian   169:        "We have two kinds of developers - those that deal with their own shit and those that deal with other people's shit.",
1.126     sthen     170:        "If people keep adding such huge stuff, soon mg will be bigger than emacs.",
1.127     reyk      171:        "this change comes down to: This year, next year, 5 years from now, 10 years from now, or Oh fuck.",
1.128     blambert  172:        "backwards compatibility is king, and will remain king, until 2038.",
1.129     henning   173:        "I don't know if the Internet's safe yet.",
1.130     henning   174:        "Those who don't understand Unix are condemned to reinvent Multics in a browser",
1.131     florian   175:        "Don't tell anybody I said that.",
1.132     tedu      176:        "Complaint forms are handled in another department.",
                    177:        "You'd be safer using Windows than the code which was just deleted.",
1.134   ! tedu      178:        "Shit should not be shared.",
        !           179:        "the randomization in this entire codebase is a grand experiment in stupid",
1.1       art       180: };
                    181:
1.117     jasper    182: static const int ntalk = sizeof(talk)/sizeof(talk[0]);
1.1       art       183:
1.91      kjell     184: /* ARGSUSED */
1.1       art       185: static int
                    186: theo_analyze(int f, int n)
                    187: {
1.81      db        188:        const char      *str;
                    189:        int              len;
1.1       art       190:
1.102     djm       191:        str = talk[arc4random_uniform(ntalk)];
1.1       art       192:        len = strlen(str);
                    193:
                    194:        newline(FFRAND, 2);
                    195:
1.81      db        196:        while (len--)
1.1       art       197:                linsert(1, *str++);
                    198:
                    199:        newline(FFRAND, 2);
                    200:
1.81      db        201:        return (TRUE);
1.2       millert   202: }