]> granicus.if.org Git - sudo/commitdiff
converted to new scheme of insult "unions"
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 23 Jul 1995 23:35:14 +0000 (23:35 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 23 Jul 1995 23:35:14 +0000 (23:35 +0000)
end

ins_2001.h
ins_classic.h
ins_goons.h
insults.h

index aa9ed73ba97c101f7dc84c25bdcad7df7148def3..9fac31fdec85f0ad2c8fb6014a480a792be86608 100644 (file)
 #ifndef _SUDO_INS_2001_H
 #define _SUDO_INS_2001_H
 
-/*
- * HAL insults (paraphrased) from 2001.
- * To add insult to injury, just add to the following strings and
- * adjust NOFINSULTS accordingly.
- */
+    /*
+     * HAL insults (paraphrased) from 2001.
+     */
 
-char *insults[] = {
     "Just what do you think you're doing Dave?",
     "It can only be attributed to human error.",
     "That's something I cannot allow to happen.",
@@ -37,9 +34,6 @@ char *insults[] = {
     "Sorry about this, I know it's a bit silly.",
     "Take a stress pill and think things over.",
     "This mission is too important for me to allow you to jeopardize it.",
-    "I feel much better now."
-};
-
-#define NOFINSULTS 8   /* number of insults */
+    "I feel much better now.",
 
 #endif /* _SUDO_INS_2001_H */
index 842f53902929d71f203b7ef174e96e3249e794f5..44752c7102bd20624f643874c08c16ff0b2520ed 100644 (file)
 #ifndef _SUDO_INS_CLASSIC_H
 #define _SUDO_INS_CLASSIC_H
 
-/*
- * Insults from the original sudo(8).
- * To add insult to injury, just add to the following strings and
- * adjust NOFINSULTS accordingly.
- */
+    /*
+     * Insults from the original sudo(8).
+     */
 
-char *insults[] = {
     "Wrong!  You cheating scum!",
     "No soap, honkie-lips.",
     "Where did you learn to type?",
@@ -37,9 +34,6 @@ char *insults[] = {
     "My pet ferret can type better than you!",
     "You type like i drive.",
     "Do you think like you type?",
-    "Your mind just hasn't been the same since the electro-shock, has it?"
-};
-
-#define NOFINSULTS 8   /* number of insults */
+    "Your mind just hasn't been the same since the electro-shock, has it?",
 
 #endif /* _SUDO_INS_CLASSIC_H */
index cfb3c9cf10ad62c9eed64ccded1b532916edd069..9413c39d3f381670bd990d81273b6ff4e141ecb8 100644 (file)
 #ifndef _SUDO_INS_GOONS_H
 #define _SUDO_INS_GOONS_H
 
-/*
- * Insults from the "Goon Show."
- * To add insult to injury, just add to the following strings and
- * adjust NOFINSULTS accordingly.
- */
+    /*
+     * Insults from the "Goon Show."
+     */
 
-char *insults[] = {
     "You silly, twisted boy you.",
     "He has fallen in the water!",
     "We'll all be murdered in our beds!",
@@ -52,9 +49,6 @@ char *insults[] = {
     "You gotta go owwwww!",
     "I have been called worse.",
     "It's only your word against mine.",
-    "I think ... err ... I think ... I think I'll go home"
-};
-
-#define NOFINSULTS 23  /* number of insults */
+    "I think ... err ... I think ... I think I'll go home",
 
 #endif /* _SUDO_INS_GOONS_H */
index 51d4fc3b1ec7870f3c9017adf62000bbc8f48a57..d19d88b91c89c2337fc6250bdb3149d1f931d9c6 100644 (file)
--- a/insults.h
+++ b/insults.h
 
 #ifdef USE_INSULTS
 
+#if !defined(HAL_INSULTS) && !defined(GOONS_INSULTS) && !defined(CLASSIC_INSULTS)
+#  define CLASSIC_INSULTS
+#endif
+
 /*
- * Choose a set of insults, the default is to use the insults from
- * "sudo classic" (in the original edition of the Sys Admin book).
+ * Use one or more set of insults as defined in options.h.
  */
-#ifdef HAL
+
+char *insults[] = {
+
+# ifdef HAL_INSULTS
 #  include "ins_2001.h"
-#else
-#  ifdef GOONS
-#    include "ins_goons.h"
-#  else
-#    include "ins_classic.h"
-#  endif /* GOONS */
-#endif /* HAL */
+# endif
+
+# ifdef GOONS_INSULTS
+#  include "ins_goons.h"
+# endif
+
+# ifdef CLASSIC_INSULTS
+#  include "ins_classic.h"
+# endif
+
+    (char *) 0
+
+};
+
+/*
+ * How may I insult you?  Let me count the ways...
+ */
+#define NOFINSULTS (sizeof(insults) / sizeof(insults[0]) - 1)
 
 /*
  * return a pseudo-random insult.