Created
November 19, 2013 22:10
-
-
Save nega0/7553483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /dev/null 2011-01-28 15:18:26.820752001 +0100 | |
+++ pythia6_rng_callback.c 2011-02-03 21:35:13.542831166 +0100 | |
@@ -0,0 +1,24 @@ | |
+/* forward decl, original Pythia impl */ | |
+extern double old_pyr_(int* idummy); | |
+ | |
+/* function pointer contating the current impl */ | |
+double (*pyr_callback)(int*) = 0; | |
+ | |
+/* setter for the pyr callback */ | |
+void set_pyr_callback(double (*new_callback)(int*) ) | |
+{ | |
+ pyr_callback = new_callback; | |
+} | |
+ | |
+/* call the current PYR implementation */ | |
+double ext_pyr_(int* idummy) | |
+{ | |
+ if (pyr_callback) | |
+ { | |
+ return (*pyr_callback)(idummy); | |
+ } | |
+ else | |
+ { | |
+ return old_pyr_(idummy); | |
+ } | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment