Skip to content

Instantly share code, notes, and snippets.

View nega0's full-sized avatar
🌴
I may be slow to respond.

nega nega0

🌴
I may be slow to respond.
View GitHub Profile
@nega0
nega0 / syslog.py
Last active June 3, 2022 02:55
a simple "syslog" lexer for pygments
## a simple "syslog" lexer for pygmentize
from pygments.lexer import RegexLexer, bygroups
from pygments.token import *
__all__ = ['SyslogLexer']
class SyslogLexer(RegexLexer):
name = 'Syslog'
aliases = ["syslog"]
--- pythia6416.f.orig 2008-03-14 09:37:15.000000000 +0100
+++ pythia6416.f 2011-02-03 20:03:16.622831025 +0100
@@ -70354,8 +70354,24 @@
C...PYR
C...Generates random numbers uniformly distributed between
C...0 and 1, excluding the endpoints.
+C...Calls back to an externally defined function EXT_PYR
FUNCTION PYR(IDUMMY)
+ DOUBLE PRECISION PYR, EXT_PYR
--- /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 */
--- /dev/null 2010-03-17 10:23:05.304266802 -0400
+++ main.c 2010-03-18 15:26:14.000000000 -0400
@@ -0,0 +1 @@
+void MAIN__() {}
--- /dev/null 2015-09-14 09:02:32.937677367 -0400
+++ Makefile 2015-09-18 12:14:24.000000000 -0400
@@ -0,0 +1,36 @@
+CC=gcc
+CFLAGS=$(FFLAGS)
+OSNAME=$(shell uname -s)
+
+all: lib-shared
+
+tpythia6_called_from_cc.o: