File: dump

package info (click to toggle)
epic5 3.0.3-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: ansic: 75,810; makefile: 648; ruby: 227; python: 215; sh: 78; perl: 13
file content (124 lines) | stat: -rw-r--r-- 2,359 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
if (word(2 $loadinfo()) != 'pf') {
	load -pf $word(1 $loadinfo());
	return;
};

#	Copyright (c) 2007 EPIC Software Labs
#	Written by BlackJac@EFNet
#
#	Version: 1.1.2007.10.23.1
#
#	This script simulates the dump command of epic4 for epic5. The
#	behavior should be nearly identical to the original. Several
#	significant improvements have been made over the original epic4
#	implementation.

package dump;

alias dump (args default "all") {
	fe ($args) dd {
		switch ($dd) {
			(alias*) {
				dump.alias;
			};
			(all) {
				fe (alias hook variable) ee {
					dump.$ee;
				};
			};
			(array*) {
				dump.array;
			};
			(bind*) {
				dump.bind;
			};
			(channel*) {
				dump.channel;
			};
			(dcc*) {
				dump.dcc;
			};
			(hook*) (on*) {
				dump.hook;
			};
			(timer*) {
				dump.timer;
			};
			(var*) {
				dump.variable;
			};
			(win*) {
				dump.window;
			};
			(wipe) {
				fe (alias array bind channel dcc hook timer variable window) ee {
					dump.$ee;
				};
			};
			(*) {
				xecho -b -c -s Dump what? \('$toupper($choice)' is unrecognized\);
			};
		};
	};
};

alias dump.alias (void) {
	xecho -b -c -s Dumping your global aliases;
	fe ($filter(dump.* $symbolctl(pmatch alias *))) dd {
		^alias -$dd;
	};
	defer fe ($symbolctl(pmatch alias dump.*)) dd {
		^alias -$dd;
	};
};

alias dump.array (void) {
	xecho -b -c -s Dumping your arrays;
	fe ($getarrays(*)) dd {
		@ delarray($dd);
	};
};

alias dump.bind (void) {
	xecho -b -c -s Dumping your binds;
	^bind -defaults;
};

alias dump.channel (void) {
	xecho -b -c -s Dumping your channels;
	^join 0;
};

alias dump.dcc (void) {
	xecho -b -c -s Dumping your DCCs;
	^dcc closeall;
};

alias dump.hook (void) {
	xecho -b -c -s Dumping your ONs;
	fe ($hookctl(list hooks)) dd {
		@ hookctl(remove $dd);
	};		
};

alias dump.timer (void) {
	xecho -b -c -s Dumping your timers;
	fe ($timerctl(refnums)) dd {
		@ timerctl(delete $dd);
	};
};

alias dump.variable (void) {
	xecho -b -c -s Dumping your global variables;
	fe ($symbolctl(pmatch assign *)) dd {
		^assign -$dd;
	};
};

alias dump.window (void) {
	xecho -b -c -s Dumping your windows;
	fe ($remw($windowctl(get 0 refnum) $windowctl(refnums))) dd {
		^window refnum_or_swap $dd kill;
	};
	^window double off fixed off hold_mode off lastlog_level all level all name - notify off notify_level all number 1 skip off swappable on;
};