|
0 |
Description: Sync with upstream SVN trunk revision 4008
|
|
1 |
From: Jonas Smedegaard <dr@jones.dk>
|
|
2 |
Forwarded: yes
|
|
3 |
Last-Update: 2010-05-07
|
|
4 |
--- a/ChangeLog
|
|
5 |
+++ b/ChangeLog
|
|
6 |
@@ -19,194 +19,243 @@
|
|
7 |
Florian Faber
|
|
8 |
Michael Voigt
|
|
9 |
Torben Hohn
|
|
10 |
-Paul Davis
|
|
11 |
-Peter L Jones
|
|
12 |
-Devin Anderson
|
|
13 |
-Josh Green
|
|
14 |
+Paul Davis
|
|
15 |
+Peter L Jones
|
|
16 |
+Devin Anderson
|
|
17 |
+Josh Green
|
|
18 |
Mario Lang
|
|
19 |
+Arnold Krille
|
|
20 |
|
|
21 |
---------------------------
|
|
22 |
Jackdmp changes log
|
|
23 |
----------------------------
|
|
24 |
-
|
|
25 |
+---------------------------
|
|
26 |
+
|
|
27 |
+2010-05-07 Stephane Letz <letz@grame.fr>
|
|
28 |
+
|
|
29 |
+ * Add tests to validate intclient.h API.
|
|
30 |
+ * On Linux, inter-process synchronization primitive switched to POSIX semaphore.
|
|
31 |
+
|
|
32 |
+2010-04-16 Stephane Letz <letz@grame.fr>
|
|
33 |
+
|
|
34 |
+ * Make jack_connect/jack_disconnect wait for effective port connection/disconnection.
|
|
35 |
+
|
|
36 |
+2010-04-07 Stephane Letz <letz@grame.fr>
|
|
37 |
+
|
|
38 |
+ * Remove call to exit in library code.
|
|
39 |
+
|
|
40 |
+2010-03-26 Stephane Letz <letz@grame.fr>
|
|
41 |
+
|
|
42 |
+ * ffado-portname-sync.patch from ticket #163 applied.
|
|
43 |
+
|
|
44 |
+2010-03-24 Stephane Letz <letz@grame.fr>
|
|
45 |
+
|
|
46 |
+ * On Windows, now use TRE library for regexp (BSD license instead of GPL license).
|
|
47 |
+
|
|
48 |
+2010-03-19 Stephane Letz <letz@grame.fr>
|
|
49 |
+
|
|
50 |
+ * Fix some file header to have library side code use LGPL.
|
|
51 |
+ * Apply srcfactor.diff patch for ticket #162.
|
|
52 |
+
|
|
53 |
+2010-03-06 Stephane Letz <letz@grame.fr>
|
|
54 |
+
|
|
55 |
+ * Arnold Krille firewire patch.
|
|
56 |
+ * Raise JACK_DRIVER_PARAM_STRING_MAX and JACK_PARAM_STRING_MAX to 127 otherwise some audio drivers cannot be loaded on OSX.
|
|
57 |
+
|
|
58 |
+2010-03-04 Stephane Letz <letz@grame.fr>
|
|
59 |
+
|
|
60 |
+ * Correct JackMachServerChannel::Execute : keep running even in error cases.
|
|
61 |
+ * Raise JACK_PROTOCOL_VERSION number.
|
|
62 |
+
|
|
63 |
+2010-03-03 Stephane Letz <letz@grame.fr>
|
|
64 |
+
|
|
65 |
+ * Correct JackGraphManager::DeactivatePort.
|
|
66 |
+
|
|
67 |
+2010-03-02 Stephane Letz <letz@grame.fr>
|
|
68 |
+
|
|
69 |
+ * Improve JackCoreAudioDriver and JackCoreAudioAdapter : when no devices are described, takes default input and output and aggregate them.
|
|
70 |
+
|
|
71 |
+2010-02-15 Stephane Letz <letz@grame.fr>
|
|
72 |
+
|
|
73 |
+ * Version 1.9.6 started.
|
|
74 |
+
|
|
75 |
2010-01-29 Gabriel M. Beddingfield <gabriel@teuton.org>
|
|
76 |
|
|
77 |
- * Change JackEngineProfiling and JackAudioAdapterInterface gnuplot scripts to output SVG instead of PDF.
|
|
78 |
-
|
|
79 |
+ * Change JackEngineProfiling and JackAudioAdapterInterface gnuplot scripts to output SVG instead of PDF.
|
|
80 |
+
|
|
81 |
2009-12-15 Stephane Letz <letz@grame.fr>
|
|
82 |
|
|
83 |
- * Shared memory manager was calling abort in case of fatal error, now return an error in caller.
|
|
84 |
-
|
|
85 |
+ * Shared memory manager was calling abort in case of fatal error, now return an error in caller.
|
|
86 |
+
|
|
87 |
2009-12-13 Stephane Letz <letz@grame.fr>
|
|
88 |
|
|
89 |
- * Mario Lang alsa_io time calculation overflow patch.
|
|
90 |
-
|
|
91 |
+ * Mario Lang alsa_io time calculation overflow patch.
|
|
92 |
+
|
|
93 |
2009-12-10 Stephane Letz <letz@grame.fr>
|
|
94 |
|
|
95 |
- * Use a QUIT notification to properly quit the server channel, the server channel thread can then be 'stopped' instead of 'canceled'.
|
|
96 |
-
|
|
97 |
+ * Use a QUIT notification to properly quit the server channel, the server channel thread can then be 'stopped' instead of 'canceled'.
|
|
98 |
+
|
|
99 |
2009-12-09 Stephane Letz <letz@grame.fr>
|
|
100 |
|
|
101 |
- * When threads are cancelled, the exception has to be rethrown.
|
|
102 |
-
|
|
103 |
+ * When threads are cancelled, the exception has to be rethrown.
|
|
104 |
+
|
|
105 |
2009-12-08 Stephane Letz <letz@grame.fr>
|
|
106 |
|
|
107 |
- * Josh Green ALSA driver capture only patch.
|
|
108 |
-
|
|
109 |
+ * Josh Green ALSA driver capture only patch.
|
|
110 |
+
|
|
111 |
2009-12-03 Stephane Letz <letz@grame.fr>
|
|
112 |
|
|
113 |
- * Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson).
|
|
114 |
-
|
|
115 |
+ * Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson).
|
|
116 |
+
|
|
117 |
2009-12-02 Stephane Letz <letz@grame.fr>
|
|
118 |
|
|
119 |
- * Special code in JackCoreAudio driver to handle completely buggy Digidesign CoreAudio user-land driver.
|
|
120 |
- * Ensure that client-side message buffer thread calls thread_init callback if/when it is set by the client (backport of JACK1 rev 3838).
|
|
121 |
- * Check dynamic port-max value.
|
|
122 |
-
|
|
123 |
+ * Special code in JackCoreAudio driver to handle completely buggy Digidesign CoreAudio user-land driver.
|
|
124 |
+ * Ensure that client-side message buffer thread calls thread_init callback if/when it is set by the client (backport of JACK1 rev 3838).
|
|
125 |
+ * Check dynamic port-max value.
|
|
126 |
+
|
|
127 |
2009-12-01 Stephane Letz <letz@grame.fr>
|
|
128 |
|
|
129 |
- * Fix port_rename callback : now both old name and new name are given as parameters.
|
|
130 |
-
|
|
131 |
+ * Fix port_rename callback : now both old name and new name are given as parameters.
|
|
132 |
+
|
|
133 |
2009-11-30 Stephane Letz <letz@grame.fr>
|
|
134 |
|
|
135 |
- * Devin Anderson patch for Jack FFADO driver issues with lost MIDI bytes between periods (and more).
|
|
136 |
-
|
|
137 |
+ * Devin Anderson patch for Jack FFADO driver issues with lost MIDI bytes between periods (and more).
|
|
138 |
+
|
|
139 |
2009-11-29 Stephane Letz <letz@grame.fr>
|
|
140 |
|
|
141 |
- * More robust sample rate change handling code in JackCoreAudioDriver.
|
|
142 |
-
|
|
143 |
+ * More robust sample rate change handling code in JackCoreAudioDriver.
|
|
144 |
+
|
|
145 |
2009-11-24 Stephane Letz <letz@grame.fr>
|
|
146 |
|
|
147 |
- * Dynamic choice of maximum port number.
|
|
148 |
-
|
|
149 |
+ * Dynamic choice of maximum port number.
|
|
150 |
+
|
|
151 |
2009-11-23 Stephane Letz <letz@grame.fr>
|
|
152 |
|
|
153 |
- * Peter L Jones patch for NetJack1 compilation on Windows.
|
|
154 |
-
|
|
155 |
+ * Peter L Jones patch for NetJack1 compilation on Windows.
|
|
156 |
+
|
|
157 |
2009-11-20 Stephane Letz <letz@grame.fr>
|
|
158 |
|
|
159 |
- * Version 1.9.5 started.
|
|
160 |
- * Client debugging code improved.
|
|
161 |
-
|
|
162 |
+ * Version 1.9.5 started.
|
|
163 |
+ * Client debugging code improved.
|
|
164 |
+
|
|
165 |
2009-11-18 Stephane Letz <letz@grame.fr>
|
|
166 |
|
|
167 |
- * Sync JackCoreAudioAdapter code with JackCoreAudioDriver.
|
|
168 |
-
|
|
169 |
+ * Sync JackCoreAudioAdapter code with JackCoreAudioDriver.
|
|
170 |
+
|
|
171 |
2009-11-17 Stephane Letz <letz@grame.fr>
|
|
172 |
|
|
173 |
- * In JackCoreAudio driver, clock drift compensation in aggregated devices working.
|
|
174 |
- * In JackCoreAudio driver, clock drift compensation semantic changed a bit : when on, does not activate if not needed (same clock domain).
|
|
175 |
-
|
|
176 |
+ * In JackCoreAudio driver, clock drift compensation in aggregated devices working.
|
|
177 |
+ * In JackCoreAudio driver, clock drift compensation semantic changed a bit : when on, does not activate if not needed (same clock domain).
|
|
178 |
+
|
|
179 |
2009-11-16 Stephane Letz <letz@grame.fr>
|
|
180 |
|
|
181 |
- * In JackCoreAudio driver, (possibly) clock drift compensation when needed in aggregated devices.
|
|
182 |
-
|
|
183 |
+ * In JackCoreAudio driver, (possibly) clock drift compensation when needed in aggregated devices.
|
|
184 |
+
|
|
185 |
2009-11-14 Stephane Letz <letz@grame.fr>
|
|
186 |
|
|
187 |
- * Sync with JACK1 : -r parameter now used for no-realtime, realtime (-R) is now default, usable backend given vie platform.
|
|
188 |
-
|
|
189 |
+ * Sync with JACK1 : -r parameter now used for no-realtime, realtime (-R) is now default, usable backend given vie platform.
|
|
190 |
+
|
|
191 |
2009-11-13 Stephane Letz <letz@grame.fr>
|
|
192 |
|
|
193 |
- * Better memory allocation error checking in ringbuffer.c, weak import improvements.
|
|
194 |
- * Memory allocation error checking for jack_client_new and jack_client_open (server and client side).
|
|
195 |
- * Memory allocation error checking in server for RPC.
|
|
196 |
- * Simplify server temporary mode : now use a JackTemporaryException.
|
|
197 |
- * Lock/Unlock shared memory segments (to test...).
|
|
198 |
-
|
|
199 |
+ * Better memory allocation error checking in ringbuffer.c, weak import improvements.
|
|
200 |
+ * Memory allocation error checking for jack_client_new and jack_client_open (server and client side).
|
|
201 |
+ * Memory allocation error checking in server for RPC.
|
|
202 |
+ * Simplify server temporary mode : now use a JackTemporaryException.
|
|
203 |
+ * Lock/Unlock shared memory segments (to test...).
|
|
204 |
+
|
|
205 |
2009-11-12 Stephane Letz <letz@grame.fr>
|
|
206 |
|
|
207 |
- * Better memory allocation error checking on client (library) side.
|
|
208 |
-
|
|
209 |
+ * Better memory allocation error checking on client (library) side.
|
|
210 |
+
|
|
211 |
2009-11-11 Stephane Letz <letz@grame.fr>
|
|
212 |
|
|
213 |
- * Correct JackCoreAudio driver when empty strings are given as -C, -P or -d parameter.
|
|
214 |
-
|
|
215 |
+ * Correct JackCoreAudio driver when empty strings are given as -C, -P or -d parameter.
|
|
216 |
+
|
|
217 |
2009-11-10 Stephane Letz <letz@grame.fr>
|
|
218 |
|
|
219 |
- * Correct JackInfoShutdownCallback prototype, two new JackClientProcessFailure and JackClientZombie JackStatus code.
|
|
220 |
-
|
|
221 |
+ * Correct JackInfoShutdownCallback prototype, two new JackClientProcessFailure and JackClientZombie JackStatus code.
|
|
222 |
+
|
|
223 |
2009-11-09 Stephane Letz <letz@grame.fr>
|
|
224 |
|
|
225 |
- * Correct JackGraphManager::GetBuffer for the "client loop with one connection" case : buffer must be copied.
|
|
226 |
-
|
|
227 |
+ * Correct JackGraphManager::GetBuffer for the "client loop with one connection" case : buffer must be copied.
|
|
228 |
+
|
|
229 |
2009-11-07 Stephane Letz <letz@grame.fr>
|
|
230 |
|
|
231 |
- * Fix AcquireRealTime and DropRealTime: now distinguish when called from another thread (AcquireRealTime/DropRealTime) and from the thread itself (AcquireSelfRealTime/DropSelfRealTime).
|
|
232 |
- * Correct JackPosixThread::StartImp : thread priority setting now done in the RT case only.
|
|
233 |
-
|
|
234 |
+ * Fix AcquireRealTime and DropRealTime: now distinguish when called from another thread (AcquireRealTime/DropRealTime) and from the thread itself (AcquireSelfRealTime/DropSelfRealTime).
|
|
235 |
+ * Correct JackPosixThread::StartImp : thread priority setting now done in the RT case only.
|
|
236 |
+
|
|
237 |
2009-11-06 Stephane Letz <letz@grame.fr>
|
|
238 |
|
|
239 |
- * Correctly save and restore RT mode state in freewheel mode.
|
|
240 |
- * Correct freewheel code on client side.
|
|
241 |
-
|
|
242 |
+ * Correctly save and restore RT mode state in freewheel mode.
|
|
243 |
+ * Correct freewheel code on client side.
|
|
244 |
+
|
|
245 |
2009-11-05 Stephane Letz <letz@grame.fr>
|
|
246 |
|
|
247 |
- * No reason to make jack_on_shutdown deprecated, so revert the incorrect change.
|
|
248 |
- * Thread AcquireRealTime and DropRealTime were (incorrectly) using fThread field. Use pthread_self()) (or GetCurrentThread() on Windows) to get the calling thread.
|
|
249 |
-
|
|
250 |
+ * No reason to make jack_on_shutdown deprecated, so revert the incorrect change.
|
|
251 |
+ * Thread AcquireRealTime and DropRealTime were (incorrectly) using fThread field. Use pthread_self()) (or GetCurrentThread() on Windows) to get the calling thread.
|
|
252 |
+
|
|
253 |
2009-10-30 Stephane Letz <letz@grame.fr>
|
|
254 |
|
|
255 |
- * In JackCoreAudioDriver, improve management of input/output channels: -1 is now used internally to indicate a wanted max value.
|
|
256 |
- * In JackCoreAudioDriver::OpenAUHAL, correct stream format setup and cleanup.
|
|
257 |
- * Correct crash bug in JackAudioAdapterInterface when not input is used in adapter (temporary fix...)
|
|
258 |
- * Sync JackCoreAudioAdapter code on JackCoreAudioDriver one.
|
|
259 |
- * JACK_SCHED_POLICY switched to SCHED_FIFO.
|
|
260 |
- * Now can aggregate device that are themselves AD.
|
|
261 |
-
|
|
262 |
+ * In JackCoreAudioDriver, improve management of input/output channels: -1 is now used internally to indicate a wanted max value.
|
|
263 |
+ * In JackCoreAudioDriver::OpenAUHAL, correct stream format setup and cleanup.
|
|
264 |
+ * Correct crash bug in JackAudioAdapterInterface when not input is used in adapter (temporary fix...)
|
|
265 |
+ * Sync JackCoreAudioAdapter code on JackCoreAudioDriver one.
|
|
266 |
+ * JACK_SCHED_POLICY switched to SCHED_FIFO.
|
|
267 |
+ * Now can aggregate device that are themselves AD.
|
|
268 |
+
|
|
269 |
2009-10-29 Stephane Letz <letz@grame.fr>
|
|
270 |
|
|
271 |
- * In JackCoreAudioDriver::Start, wait for the audio driver to effectively start (use the MeasureCallback).
|
|
272 |
-
|
|
273 |
+ * In JackCoreAudioDriver::Start, wait for the audio driver to effectively start (use the MeasureCallback).
|
|
274 |
+
|
|
275 |
2009-10-28 Stephane Letz <letz@grame.fr>
|
|
276 |
|
|
277 |
- * In JackCoreAudioDriver, force the SR value to the wanted one *before* creating aggregate device (otherwise creation will fail).
|
|
278 |
- * In JackCoreAudioDriver, better cleanup of AD when intermediate open failure.
|
|
279 |
-
|
|
280 |
+ * In JackCoreAudioDriver, force the SR value to the wanted one *before* creating aggregate device (otherwise creation will fail).
|
|
281 |
+ * In JackCoreAudioDriver, better cleanup of AD when intermediate open failure.
|
|
282 |
+
|
|
283 |
2009-10-27 Stephane Letz <letz@grame.fr>
|
|
284 |
|
|
285 |
- * Dynamic system version detection in JackCoreAudioDriver to either create public or private aggregate device.
|
|
286 |
-
|
|
287 |
+ * Dynamic system version detection in JackCoreAudioDriver to either create public or private aggregate device.
|
|
288 |
+
|
|
289 |
2009-10-26 Stephane Letz <letz@grame.fr>
|
|
290 |
|
|
291 |
- * Implement "hog mode" (exclusive access of the audio device) in JackCoreAudioDriver.
|
|
292 |
- * Fix jack_set_sample_rate_callback to have he same behavior as in JACK1.
|
|
293 |
-
|
|
294 |
+ * Implement "hog mode" (exclusive access of the audio device) in JackCoreAudioDriver.
|
|
295 |
+ * Fix jack_set_sample_rate_callback to have he same behavior as in JACK1.
|
|
296 |
+
|
|
297 |
2009-10-25 Stephane Letz <letz@grame.fr>
|
|
298 |
|
|
299 |
- * Improve aggregate device management in JackCoreAudioDriver : now a "private" device only and cleanup properly.
|
|
300 |
- * Aggregate device code added to JackCoreAudioAdapter.
|
|
301 |
-
|
|
302 |
+ * Improve aggregate device management in JackCoreAudioDriver : now a "private" device only and cleanup properly.
|
|
303 |
+ * Aggregate device code added to JackCoreAudioAdapter.
|
|
304 |
+
|
|
305 |
2009-10-23 Stephane Letz <letz@grame.fr>
|
|
306 |
|
|
307 |
- * Correct JackProcessSync::LockedTimedWait.
|
|
308 |
- * Correct JACK_MESSAGE_SIZE value, particularly in OSX RPC code.
|
|
309 |
- * Now start server channel thread only when backend has been started (so in JackServer::Start). Should solve race conditions at start time.
|
|
310 |
- * jack_verbose moved to JackGlobals class.
|
|
311 |
-
|
|
312 |
+ * Correct JackProcessSync::LockedTimedWait.
|
|
313 |
+ * Correct JACK_MESSAGE_SIZE value, particularly in OSX RPC code.
|
|
314 |
+ * Now start server channel thread only when backend has been started (so in JackServer::Start). Should solve race conditions at start time.
|
|
315 |
+ * jack_verbose moved to JackGlobals class.
|
|
316 |
+
|
|
317 |
2009-10-22 Stephane Letz <letz@grame.fr>
|
|
318 |
|
|
319 |
- * Correct jackdmp.cpp (failures case were not correct..). Improve JackCoreAudioDriver code. Raise default port number to 2048.
|
|
320 |
-
|
|
321 |
+ * Correct jackdmp.cpp (failures case were not correct..). Improve JackCoreAudioDriver code. Raise default port number to 2048.
|
|
322 |
+
|
|
323 |
2009-10-20 Stephane Letz <letz@grame.fr>
|
|
324 |
|
|
325 |
- * Add a string parameter to server ==> client notification, add a new JackInfoShutdownCallback type.
|
|
326 |
- * CoreAudio backend now issue a JackInfoShutdownCallback when an unrecoverable error is detected (sampling rate change, stream configuration change…)
|
|
327 |
+ * Add a string parameter to server ==> client notification, add a new JackInfoShutdownCallback type.
|
|
328 |
+ * CoreAudio backend now issue a JackInfoShutdownCallback when an unrecoverable error is detected (sampling rate change, stream configuration changed)
|
|
329 |
|
|
330 |
2009-10-17 Stephane Letz <letz@grame.fr>
|
|
331 |
|
|
332 |
- * Correct server temporary mode : now set a global and quit after server/client message handling is finished.
|
|
333 |
-
|
|
334 |
+ * Correct server temporary mode : now set a global and quit after server/client message handling is finished.
|
|
335 |
+
|
|
336 |
2009-10-15 Stephane Letz <letz@grame.fr>
|
|
337 |
|
|
338 |
- * Change CoreAudio notification thread setup for OSX Snow Leopard.
|
|
339 |
-
|
|
340 |
+ * Change CoreAudio notification thread setup for OSX Snow Leopard.
|
|
341 |
+
|
|
342 |
2009-09-18 Stephane Letz <letz@grame.fr>
|
|
343 |
|
|
344 |
- * Simplify transport in NetJack2: master only can control transport.
|
|
345 |
+ * Simplify transport in NetJack2: master only can control transport.
|
|
346 |
|
|
347 |
2009-09-15 Stephane Letz <letz@grame.fr>
|
|
348 |
|
|
349 |
- * Correct CPU timing in JackNetDriver, now take cycle begin time after Read.
|
|
350 |
+ * Correct CPU timing in JackNetDriver, now take cycle begin time after Read.
|
|
351 |
* Fix issues in JackNetDriver::DecodeTransportData and JackNetDriver::Initialize.
|
|
352 |
|
|
353 |
2009-08-28 Stephane Letz <letz@grame.fr>
|
|
354 |
@@ -557,7 +606,7 @@
|
|
355 |
2008-11-21 Stephane Letz <letz@grame.fr>
|
|
356 |
|
|
357 |
* Report ringbuffer.c fixes from JACK1.
|
|
358 |
- * Better isolation of server and clients system resources to allow starting the server in several user account at the same time.
|
|
359 |
+ * Better isolation of server and clients system resources to allow starting the server in several user account at the same time.
|
|
360 |
* Correct ressource cleanup in case of driver open failure.
|
|
361 |
|
|
362 |
2008-11-19 Stephane Letz <letz@grame.fr>
|
|
363 |
--- a/common/JackAtomicArrayState.h
|
|
364 |
+++ b/common/JackAtomicArrayState.h
|
|
365 |
@@ -1,21 +1,21 @@
|
|
366 |
/*
|
|
367 |
-Copyright (C) 2004-2006 Grame
|
|
368 |
-
|
|
369 |
-This program is free software; you can redistribute it and/or modify
|
|
370 |
-it under the terms of the GNU General Public License as published by
|
|
371 |
-the Free Software Foundation; either version 2 of the License, or
|
|
372 |
-(at your option) any later version.
|
|
373 |
-
|
|
374 |
-This program is distributed in the hope that it will be useful,
|
|
375 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
376 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
377 |
-GNU General Public License for more details.
|
|
378 |
-
|
|
379 |
-You should have received a copy of the GNU General Public License
|
|
380 |
-along with this program; if not, write to the Free Software
|
|
381 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
382 |
-
|
|
383 |
-*/
|
|
384 |
+ Copyright (C) 2004-2008 Grame
|
|
385 |
+
|
|
386 |
+ This program is free software; you can redistribute it and/or modify
|
|
387 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
388 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
389 |
+ (at your option) any later version.
|
|
390 |
+
|
|
391 |
+ This program is distributed in the hope that it will be useful,
|
|
392 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
393 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
394 |
+ GNU Lesser General Public License for more details.
|
|
395 |
+
|
|
396 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
397 |
+ along with this program; if not, write to the Free Software
|
|
398 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
399 |
+
|
|
400 |
+ */
|
|
401 |
|
|
402 |
#ifndef __JackAtomicArrayState__
|
|
403 |
#define __JackAtomicArrayState__
|
|
404 |
--- a/common/JackConstants.h
|
|
405 |
+++ b/common/JackConstants.h
|
|
406 |
@@ -24,7 +24,7 @@
|
|
407 |
#include "config.h"
|
|
408 |
#endif
|
|
409 |
|
|
410 |
-#define VERSION "1.9.5"
|
|
411 |
+#define VERSION "1.9.6"
|
|
412 |
|
|
413 |
#define BUFFER_SIZE_MAX 8192
|
|
414 |
|
|
415 |
@@ -59,36 +59,12 @@
|
|
416 |
|
|
417 |
#define JACK_DEFAULT_SERVER_NAME "default"
|
|
418 |
|
|
419 |
-#ifdef WIN32
|
|
420 |
-#define jack_server_dir "server"
|
|
421 |
-#define jack_client_dir "client"
|
|
422 |
-#define ADDON_DIR "jack"
|
|
423 |
-#endif
|
|
424 |
-
|
|
425 |
-#ifdef __APPLE__
|
|
426 |
-#define jack_server_dir "/tmp"
|
|
427 |
-#define jack_client_dir "/tmp"
|
|
428 |
-#define JACK_DEFAULT_DRIVER "coreaudio"
|
|
429 |
-#endif
|
|
430 |
-
|
|
431 |
-#ifdef __linux__
|
|
432 |
-#define jack_server_dir "/dev/shm"
|
|
433 |
-#define jack_client_dir "/dev/shm"
|
|
434 |
-#define JACK_DEFAULT_DRIVER "alsa"
|
|
435 |
-#endif
|
|
436 |
-
|
|
437 |
-#if defined(__sun__) || defined(sun)
|
|
438 |
-#define jack_server_dir "/tmp"
|
|
439 |
-#define jack_client_dir "/tmp"
|
|
440 |
-#define JACK_DEFAULT_DRIVER "oss"
|
|
441 |
-#endif
|
|
442 |
-
|
|
443 |
#define jack_server_entry "jackdmp_entry"
|
|
444 |
#define jack_client_entry "jack_client"
|
|
445 |
|
|
446 |
#define ALL_CLIENTS -1 // for notification
|
|
447 |
|
|
448 |
-#define JACK_PROTOCOL_VERSION 7
|
|
449 |
+#define JACK_PROTOCOL_VERSION 8
|
|
450 |
|
|
451 |
#define SOCKET_TIME_OUT 5 // in sec
|
|
452 |
#define DRIVER_OPEN_TIMEOUT 5 // in sec
|
|
453 |
--- a/common/JackControlAPI.h
|
|
454 |
+++ b/common/JackControlAPI.h
|
|
455 |
@@ -47,7 +47,7 @@
|
|
456 |
#define JACK_PARAM_MAX (JackParamBool + 1)
|
|
457 |
|
|
458 |
/** @brief Max length of string parameter value, excluding terminating nul char */
|
|
459 |
-#define JACK_PARAM_STRING_MAX 63
|
|
460 |
+#define JACK_PARAM_STRING_MAX 127
|
|
461 |
|
|
462 |
/** @brief Type for parameter value */
|
|
463 |
/* intentionally similar to jack_driver_param_value_t */
|
|
464 |
--- a/common/JackError.cpp
|
|
465 |
+++ b/common/JackError.cpp
|
|
466 |
@@ -1,23 +1,23 @@
|
|
467 |
/*
|
|
468 |
- Copyright (C) 2001 Paul Davis
|
|
469 |
- Copyright (C) 2004-2008 Grame
|
|
470 |
- Copyright (C) 2008 Nedko Arnaudov
|
|
471 |
-
|
|
472 |
- This program is free software; you can redistribute it and/or modify
|
|
473 |
- it under the terms of the GNU General Public License as published by
|
|
474 |
- the Free Software Foundation; either version 2 of the License, or
|
|
475 |
- (at your option) any later version.
|
|
476 |
-
|
|
477 |
- This program is distributed in the hope that it will be useful,
|
|
478 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
479 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
480 |
- GNU General Public License for more details.
|
|
481 |
-
|
|
482 |
- You should have received a copy of the GNU General Public License
|
|
483 |
- along with this program; if not, write to the Free Software
|
|
484 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
485 |
-
|
|
486 |
-*/
|
|
487 |
+ Copyright (C) 2001 Paul Davis
|
|
488 |
+ Copyright (C) 2004-2008 Grame
|
|
489 |
+ Copyright (C) 2008 Nedko Arnaudov
|
|
490 |
+
|
|
491 |
+ This program is free software; you can redistribute it and/or modify
|
|
492 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
493 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
494 |
+ (at your option) any later version.
|
|
495 |
+
|
|
496 |
+ This program is distributed in the hope that it will be useful,
|
|
497 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
498 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
499 |
+ GNU Lesser General Public License for more details.
|
|
500 |
+
|
|
501 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
502 |
+ along with this program; if not, write to the Free Software
|
|
503 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
504 |
+
|
|
505 |
+ */
|
|
506 |
|
|
507 |
#include <stdarg.h>
|
|
508 |
#include <stdio.h>
|
|
509 |
--- a/common/JackError.h
|
|
510 |
+++ b/common/JackError.h
|
|
511 |
@@ -1,22 +1,21 @@
|
|
512 |
/*
|
|
513 |
-Copyright (C) 2001 Paul Davis
|
|
514 |
-Copyright (C) 2004-2008 Grame
|
|
515 |
-Copyright (C) 2008 Nedko Arnaudov
|
|
516 |
-
|
|
517 |
-This program is free software; you can redistribute it and/or modify
|
|
518 |
-it under the terms of the GNU General Public License as published by
|
|
519 |
-the Free Software Foundation; either version 2 of the License, or
|
|
520 |
-(at your option) any later version.
|
|
521 |
-
|
|
522 |
-This program is distributed in the hope that it will be useful,
|
|
523 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
524 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
525 |
-GNU General Public License for more details.
|
|
526 |
-
|
|
527 |
-You should have received a copy of the GNU General Public License
|
|
528 |
-along with this program; if not, write to the Free Software
|
|
529 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
530 |
-
|
|
531 |
+ Copyright (C) 2001 Paul Davis
|
|
532 |
+ Copyright (C) 2004-2008 Grame
|
|
533 |
+ Copyright (C) 2008 Nedko Arnaudov
|
|
534 |
+
|
|
535 |
+ This program is free software; you can redistribute it and/or modify
|
|
536 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
537 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
538 |
+ (at your option) any later version.
|
|
539 |
+
|
|
540 |
+ This program is distributed in the hope that it will be useful,
|
|
541 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
542 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
543 |
+ GNU Lesser General Public License for more details.
|
|
544 |
+
|
|
545 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
546 |
+ along with this program; if not, write to the Free Software
|
|
547 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
548 |
|
|
549 |
*/
|
|
550 |
|
|
551 |
--- a/common/JackGraphManager.cpp
|
|
552 |
+++ b/common/JackGraphManager.cpp
|
|
553 |
@@ -385,7 +385,7 @@
|
|
554 |
void JackGraphManager::DeactivatePort(jack_port_id_t port_index)
|
|
555 |
{
|
|
556 |
JackPort* port = GetPort(port_index);
|
|
557 |
- port->fFlags = (JackPortFlags)(port->fFlags | ~JackPortIsActive);
|
|
558 |
+ port->fFlags = (JackPortFlags)(port->fFlags & ~JackPortIsActive);
|
|
559 |
}
|
|
560 |
|
|
561 |
void JackGraphManager::GetInputPorts(int refnum, jack_int_t* res)
|
|
562 |
--- a/common/JackNetTool.cpp
|
|
563 |
+++ b/common/JackNetTool.cpp
|
|
564 |
@@ -283,7 +283,7 @@
|
|
565 |
jack_info ( "Sample rate : %u frames per second", params->fSampleRate );
|
|
566 |
jack_info ( "Period size : %u frames per period", params->fPeriodSize );
|
|
567 |
jack_info ( "Frames per packet : %u", params->fFramesPerPacket );
|
|
568 |
- jack_info ( "Packet per period : %u", params->fPeriodSize / params->fFramesPerPacket );
|
|
569 |
+ jack_info ( "Packet per period : %u", (params->fFramesPerPacket != 0) ? params->fPeriodSize / params->fFramesPerPacket : 0);
|
|
570 |
jack_info ( "Bitdepth : %s", bitdepth );
|
|
571 |
jack_info ( "Slave mode : %s", ( params->fSlaveSyncMode ) ? "sync" : "async" );
|
|
572 |
jack_info ( "Network mode : %s", mode );
|
|
573 |
--- a/common/JackShmMem.cpp
|
|
574 |
+++ b/common/JackShmMem.cpp
|
|
575 |
@@ -1,22 +1,21 @@
|
|
576 |
/*
|
|
577 |
-Copyright (C) 2001 Paul Davis
|
|
578 |
-Copyright (C) 2004-2009 Grame
|
|
579 |
-
|
|
580 |
-This program is free software; you can redistribute it and/or modify
|
|
581 |
-it under the terms of the GNU General Public License as published by
|
|
582 |
-the Free Software Foundation; either version 2 of the License, or
|
|
583 |
-(at your option) any later version.
|
|
584 |
-
|
|
585 |
-This program is distributed in the hope that it will be useful,
|
|
586 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
587 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
588 |
-GNU General Public License for more details.
|
|
589 |
-
|
|
590 |
-You should have received a copy of the GNU General Public License
|
|
591 |
-along with this program; if not, write to the Free Software
|
|
592 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
593 |
-
|
|
594 |
-*/
|
|
595 |
+ Copyright (C) 2004-2008 Grame
|
|
596 |
+
|
|
597 |
+ This program is free software; you can redistribute it and/or modify
|
|
598 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
599 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
600 |
+ (at your option) any later version.
|
|
601 |
+
|
|
602 |
+ This program is distributed in the hope that it will be useful,
|
|
603 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
604 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
605 |
+ GNU Lesser General Public License for more details.
|
|
606 |
+
|
|
607 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
608 |
+ along with this program; if not, write to the Free Software
|
|
609 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
610 |
+
|
|
611 |
+ */
|
|
612 |
|
|
613 |
#include "JackError.h"
|
|
614 |
#include "JackShmMem.h"
|
|
615 |
--- a/common/JackShmMem.h
|
|
616 |
+++ b/common/JackShmMem.h
|
|
617 |
@@ -1,22 +1,21 @@
|
|
618 |
/*
|
|
619 |
-Copyright (C) 2001 Paul Davis
|
|
620 |
-Copyright (C) 2004-2009 Grame
|
|
621 |
-
|
|
622 |
-This program is free software; you can redistribute it and/or modify
|
|
623 |
-it under the terms of the GNU General Public License as published by
|
|
624 |
-the Free Software Foundation; either version 2 of the License, or
|
|
625 |
-(at your option) any later version.
|
|
626 |
-
|
|
627 |
-This program is distributed in the hope that it will be useful,
|
|
628 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
629 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
630 |
-GNU General Public License for more details.
|
|
631 |
-
|
|
632 |
-You should have received a copy of the GNU General Public License
|
|
633 |
-along with this program; if not, write to the Free Software
|
|
634 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
635 |
-
|
|
636 |
-*/
|
|
637 |
+ Copyright (C) 2004-2008 Grame
|
|
638 |
+
|
|
639 |
+ This program is free software; you can redistribute it and/or modify
|
|
640 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
641 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
642 |
+ (at your option) any later version.
|
|
643 |
+
|
|
644 |
+ This program is distributed in the hope that it will be useful,
|
|
645 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
646 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
647 |
+ GNU Lesser General Public License for more details.
|
|
648 |
+
|
|
649 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
650 |
+ along with this program; if not, write to the Free Software
|
|
651 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
652 |
+
|
|
653 |
+ */
|
|
654 |
|
|
655 |
#ifndef __JackShmMem__
|
|
656 |
#define __JackShmMem__
|
|
657 |
--- a/common/JackTools.cpp
|
|
658 |
+++ b/common/JackTools.cpp
|
|
659 |
@@ -194,7 +194,7 @@
|
|
660 |
}
|
|
661 |
|
|
662 |
if (fgets(buf, sizeof(buf), in) == NULL) {
|
|
663 |
- fclose(in);
|
|
664 |
+ pclose(in);
|
|
665 |
return -1;
|
|
666 |
}
|
|
667 |
|
|
668 |
@@ -202,7 +202,7 @@
|
|
669 |
|
|
670 |
if (buf[len - 1] != '\n') {
|
|
671 |
/* didn't get a whole line */
|
|
672 |
- fclose(in);
|
|
673 |
+ pclose(in);
|
|
674 |
return -1;
|
|
675 |
}
|
|
676 |
|
|
677 |
@@ -210,7 +210,7 @@
|
|
678 |
memcpy(jack_tmpdir, buf, len - 1);
|
|
679 |
jack_tmpdir[len - 1] = '\0';
|
|
680 |
|
|
681 |
- fclose(in);
|
|
682 |
+ pclose(in);
|
|
683 |
return 0;
|
|
684 |
}
|
|
685 |
#endif
|
|
686 |
--- a/common/JackWeakAPI.cpp
|
|
687 |
+++ b/common/JackWeakAPI.cpp
|
|
688 |
@@ -1,33 +1,36 @@
|
|
689 |
-/*
|
|
690 |
-Copyright (C) 2009 Grame
|
|
691 |
-
|
|
692 |
-This program is free software; you can redistribute it and/or modify
|
|
693 |
-it under the terms of the GNU Lesser General Public License as published by
|
|
694 |
-the Free Software Foundation; either version 2.1 of the License, or
|
|
695 |
-(at your option) any later version.
|
|
696 |
-
|
|
697 |
-This program is distributed in the hope that it will be useful,
|
|
698 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
699 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
700 |
-GNU Lesser General Public License for more details.
|
|
701 |
-
|
|
702 |
-You should have received a copy of the GNU Lesser General Public License
|
|
703 |
-along with this program; if not, write to the Free Software
|
|
704 |
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
705 |
+//=============================================================================
|
|
706 |
+// MuseScore
|
|
707 |
+// Linux Music Score Editor
|
|
708 |
+// $Id:
|
|
709 |
+//
|
|
710 |
+// jackWeakAPI based on code from Stéphane Letz (Grame)
|
|
711 |
+// partly based on Julien Pommier (PianoTeq : http://www.pianoteq.com/) code.
|
|
712 |
+//
|
|
713 |
+// Copyright (C) 2002-2007 Werner Schweer and others
|
|
714 |
+// Copyright (C) 2009 Grame
|
|
715 |
|
|
716 |
-*/
|
|
717 |
-
|
|
718 |
-/*
|
|
719 |
- Completed from Julien Pommier (PianoTeq : http://www.pianoteq.com/) code.
|
|
720 |
-*/
|
|
721 |
+// This program is free software; you can redistribute it and/or modify
|
|
722 |
+// it under the terms of the GNU Lesser General Public License as published by
|
|
723 |
+// the Free Software Foundation; either version 2.1 of the License, or
|
|
724 |
+// (at your option) any later version.
|
|
725 |
+
|
|
726 |
+// This program is distributed in the hope that it will be useful,
|
|
727 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
728 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
729 |
+// GNU Lesser General Public License for more details.
|
|
730 |
+
|
|
731 |
+// You should have received a copy of the GNU Lesser General Public License
|
|
732 |
+// along with this program; if not, write to the Free Software
|
|
733 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
734 |
|
|
735 |
#include <jack/jack.h>
|
|
736 |
#include <jack/thread.h>
|
|
737 |
#include <jack/midiport.h>
|
|
738 |
#include <math.h>
|
|
739 |
+#ifndef WIN32
|
|
740 |
#include <dlfcn.h>
|
|
741 |
+#endif
|
|
742 |
#include <stdlib.h>
|
|
743 |
-#include <cassert>
|
|
744 |
#include <iostream>
|
|
745 |
|
|
746 |
/* dynamically load libjack and forward all registered calls to libjack
|
|
747 |
@@ -40,13 +43,21 @@
|
|
748 |
using std::cerr;
|
|
749 |
|
|
750 |
int libjack_is_present = 0; // public symbol, similar to what relaytool does.
|
|
751 |
+
|
|
752 |
+#ifdef WIN32
|
|
753 |
+HMODULE libjack_handle = 0;
|
|
754 |
+#else
|
|
755 |
static void *libjack_handle = 0;
|
|
756 |
+#endif
|
|
757 |
+
|
|
758 |
|
|
759 |
static void __attribute__((constructor)) tryload_libjack()
|
|
760 |
{
|
|
761 |
if (getenv("SKIP_LIBJACK") == 0) { // just in case libjack is causing troubles..
|
|
762 |
#ifdef __APPLE__
|
|
763 |
libjack_handle = dlopen("libjack.0.dylib", RTLD_LAZY);
|
|
764 |
+ #elif defined(WIN32)
|
|
765 |
+ libjack_handle = LoadLibrary("libjack.dll");
|
|
766 |
#else
|
|
767 |
libjack_handle = dlopen("libjack.so.0", RTLD_LAZY);
|
|
768 |
#endif
|
|
769 |
@@ -59,12 +70,22 @@
|
|
770 |
{
|
|
771 |
void *fn = 0;
|
|
772 |
if (!libjack_handle) {
|
|
773 |
- std::cerr << "libjack not found, so do not try to load " << fn_name << " ffs !\n";
|
|
774 |
+ fprintf (stderr, "libjack not found, so do not try to load %s ffs !\n", fn_name);
|
|
775 |
return 0;
|
|
776 |
}
|
|
777 |
+#ifdef WIN32
|
|
778 |
+ fn = (void*)GetProcAddress(libjack_handle, fn_name);
|
|
779 |
+#else
|
|
780 |
fn = dlsym(libjack_handle, fn_name);
|
|
781 |
+#endif
|
|
782 |
if (!fn) {
|
|
783 |
- std::cerr << "could not dlsym(" << libjack_handle << "), " << dlerror() << "\n";
|
|
784 |
+#ifdef WIN32
|
|
785 |
+ char* lpMsgBuf;
|
|
786 |
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(LPTSTR) &lpMsgBuf,0,NULL );
|
|
787 |
+ fprintf (stderr, "could not GetProcAddress( %s ), %s \n", fn_name, lpMsgBuf) ;
|
|
788 |
+#else
|
|
789 |
+ fprintf (stderr, "could not dlsym( %s ), %s \n", fn_name, dlerror()) ;
|
|
790 |
+#endif
|
|
791 |
}
|
|
792 |
return fn;
|
|
793 |
}
|
|
794 |
@@ -78,6 +99,15 @@
|
|
795 |
else return (return_type)-1; \
|
|
796 |
}
|
|
797 |
|
|
798 |
+#define DECL_FUNCTION_NULL(return_type, fn_name, arguments_types, arguments) \
|
|
799 |
+ typedef return_type (*fn_name##_ptr_t)arguments_types; \
|
|
800 |
+ return_type fn_name arguments_types { \
|
|
801 |
+ static fn_name##_ptr_t fn = 0; \
|
|
802 |
+ if (fn == 0) { fn = (fn_name##_ptr_t)load_jack_function(#fn_name); } \
|
|
803 |
+ if (fn) return (*fn)arguments; \
|
|
804 |
+ else return (return_type)0; \
|
|
805 |
+ }
|
|
806 |
+
|
|
807 |
#define DECL_VOID_FUNCTION(fn_name, arguments_types, arguments) \
|
|
808 |
typedef void (*fn_name##_ptr_t)arguments_types; \
|
|
809 |
void fn_name arguments_types { \
|
|
810 |
@@ -86,14 +116,15 @@
|
|
811 |
if (fn) (*fn)arguments; \
|
|
812 |
}
|
|
813 |
|
|
814 |
+
|
|
815 |
DECL_VOID_FUNCTION(jack_get_version, (int *major_ptr, int *minor_ptr, int *micro_ptr, int *proto_ptr), (major_ptr, minor_ptr, micro_ptr, proto_ptr));
|
|
816 |
-DECL_FUNCTION(const char *, jack_get_version_string, (), ());
|
|
817 |
-DECL_FUNCTION(jack_client_t *, jack_client_open, (const char *client_name, jack_options_t options, jack_status_t *status, ...),
|
|
818 |
+DECL_FUNCTION_NULL(const char *, jack_get_version_string, (), ());
|
|
819 |
+DECL_FUNCTION_NULL(jack_client_t *, jack_client_open, (const char *client_name, jack_options_t options, jack_status_t *status, ...),
|
|
820 |
(client_name, options, status));
|
|
821 |
DECL_FUNCTION(int, jack_client_close, (jack_client_t *client), (client));
|
|
822 |
-DECL_FUNCTION(jack_client_t *, jack_client_new, (const char *client_name), (client_name));
|
|
823 |
+DECL_FUNCTION_NULL(jack_client_t *, jack_client_new, (const char *client_name), (client_name));
|
|
824 |
DECL_FUNCTION(int, jack_client_name_size, (), ());
|
|
825 |
-DECL_FUNCTION(char*, jack_get_client_name, (jack_client_t *client), (client));
|
|
826 |
+DECL_FUNCTION_NULL(char*, jack_get_client_name, (jack_client_t *client), (client));
|
|
827 |
DECL_FUNCTION(int, jack_internal_client_new, (const char *client_name,
|
|
828 |
const char *load_name,
|
|
829 |
const char *load_init), (client_name, load_name, load_init));
|
|
830 |
@@ -146,21 +177,21 @@
|
|
831 |
void *arg), (client, xrun_callback, arg));
|
|
832 |
DECL_FUNCTION(int, jack_activate, (jack_client_t *client), (client));
|
|
833 |
DECL_FUNCTION(int, jack_deactivate, (jack_client_t *client), (client));
|
|
834 |
-DECL_FUNCTION(jack_port_t *, jack_port_register, (jack_client_t *client, const char *port_name, const char *port_type,
|
|
835 |
+DECL_FUNCTION_NULL(jack_port_t *, jack_port_register, (jack_client_t *client, const char *port_name, const char *port_type,
|
|
836 |
unsigned long flags, unsigned long buffer_size),
|
|
837 |
(client, port_name, port_type, flags, buffer_size));
|
|
838 |
DECL_FUNCTION(int, jack_port_unregister, (jack_client_t *client, jack_port_t* port), (client, port));
|
|
839 |
-DECL_FUNCTION(void *, jack_port_get_buffer, (jack_port_t *port, jack_nframes_t nframes), (port, nframes));
|
|
840 |
-DECL_FUNCTION(const char*, jack_port_name, (const jack_port_t *port), (port));
|
|
841 |
-DECL_FUNCTION(const char*, jack_port_short_name, (const jack_port_t *port), (port));
|
|
842 |
+DECL_FUNCTION_NULL(void *, jack_port_get_buffer, (jack_port_t *port, jack_nframes_t nframes), (port, nframes));
|
|
843 |
+DECL_FUNCTION_NULL(const char*, jack_port_name, (const jack_port_t *port), (port));
|
|
844 |
+DECL_FUNCTION_NULL(const char*, jack_port_short_name, (const jack_port_t *port), (port));
|
|
845 |
DECL_FUNCTION(int, jack_port_flags, (const jack_port_t *port), (port));
|
|
846 |
-DECL_FUNCTION(const char*, jack_port_type, (const jack_port_t *port), (port));
|
|
847 |
+DECL_FUNCTION_NULL(const char*, jack_port_type, (const jack_port_t *port), (port));
|
|
848 |
DECL_FUNCTION(jack_port_type_id_t, jack_port_type_id, (const jack_port_t *port), (port));
|
|
849 |
DECL_FUNCTION(int, jack_port_is_mine, (const jack_client_t *client, const jack_port_t* port), (client, port));
|
|
850 |
DECL_FUNCTION(int, jack_port_connected, (const jack_port_t *port), (port));
|
|
851 |
DECL_FUNCTION(int, jack_port_connected_to, (const jack_port_t *port, const char *port_name), (port, port_name));
|
|
852 |
-DECL_FUNCTION(const char**, jack_port_get_connections, (const jack_port_t *port), (port));
|
|
853 |
-DECL_FUNCTION(const char**, jack_port_get_all_connections, (const jack_client_t *client,const jack_port_t *port), (client, port));
|
|
854 |
+DECL_FUNCTION_NULL(const char**, jack_port_get_connections, (const jack_port_t *port), (port));
|
|
855 |
+DECL_FUNCTION_NULL(const char**, jack_port_get_all_connections, (const jack_client_t *client,const jack_port_t *port), (client, port));
|
|
856 |
DECL_FUNCTION(int, jack_port_tie, (jack_port_t *src, jack_port_t *dst), (src, dst));
|
|
857 |
DECL_FUNCTION(int, jack_port_untie, (jack_port_t *port), (port));
|
|
858 |
DECL_FUNCTION(jack_nframes_t, jack_port_get_latency, (jack_port_t *port), (port));
|
|
859 |
@@ -185,10 +216,10 @@
|
|
860 |
|
|
861 |
DECL_FUNCTION(jack_nframes_t, jack_get_sample_rate, (jack_client_t *client), (client));
|
|
862 |
DECL_FUNCTION(jack_nframes_t, jack_get_buffer_size, (jack_client_t *client), (client));
|
|
863 |
-DECL_FUNCTION(const char**, jack_get_ports, (jack_client_t *client, const char *port_name_pattern, const char * type_name_pattern,
|
|
864 |
+DECL_FUNCTION_NULL(const char**, jack_get_ports, (jack_client_t *client, const char *port_name_pattern, const char * type_name_pattern,
|
|
865 |
unsigned long flags), (client, port_name_pattern, type_name_pattern, flags));
|
|
866 |
-DECL_FUNCTION(jack_port_t *, jack_port_by_name, (jack_client_t * client, const char *port_name), (client, port_name));
|
|
867 |
-DECL_FUNCTION(jack_port_t *, jack_port_by_id, (jack_client_t *client, jack_port_id_t port_id), (client, port_id));
|
|
868 |
+DECL_FUNCTION_NULL(jack_port_t *, jack_port_by_name, (jack_client_t * client, const char *port_name), (client, port_name));
|
|
869 |
+DECL_FUNCTION_NULL(jack_port_t *, jack_port_by_id, (jack_client_t *client, jack_port_id_t port_id), (client, port_id));
|
|
870 |
|
|
871 |
DECL_FUNCTION(int, jack_engine_takeover_timebase, (jack_client_t * client), (client));
|
|
872 |
DECL_FUNCTION(jack_nframes_t, jack_frames_since_cycle_start, (const jack_client_t * client), (client));
|
|
873 |
@@ -198,7 +229,7 @@
|
|
874 |
DECL_FUNCTION(jack_nframes_t, jack_frame_time, (const jack_client_t *client), (client));
|
|
875 |
DECL_FUNCTION(jack_nframes_t, jack_last_frame_time, (const jack_client_t *client), (client));
|
|
876 |
DECL_FUNCTION(float, jack_cpu_load, (jack_client_t *client), (client));
|
|
877 |
-DECL_FUNCTION(pthread_t, jack_client_thread_id, (jack_client_t *client), (client));
|
|
878 |
+DECL_FUNCTION_NULL(pthread_t, jack_client_thread_id, (jack_client_t *client), (client));
|
|
879 |
DECL_VOID_FUNCTION(jack_set_error_function, (print_function fun), (fun));
|
|
880 |
DECL_VOID_FUNCTION(jack_set_info_function, (print_function fun), (fun));
|
|
881 |
|
|
882 |
@@ -256,6 +287,6 @@
|
|
883 |
DECL_FUNCTION(int, jack_midi_event_get, (jack_midi_event_t* event, void* port_buffer, jack_nframes_t event_index), (event, port_buffer, event_index)) ;
|
|
884 |
DECL_VOID_FUNCTION(jack_midi_clear_buffer, (void* port_buffer), (port_buffer));
|
|
885 |
DECL_FUNCTION(size_t, jack_midi_max_event_size, (void* port_buffer), (port_buffer));
|
|
886 |
-DECL_FUNCTION(jack_midi_data_t*, jack_midi_event_reserve, (void* port_buffer, jack_nframes_t time, size_t data_size), (port_buffer, time, data_size));
|
|
887 |
+DECL_FUNCTION_NULL(jack_midi_data_t*, jack_midi_event_reserve, (void* port_buffer, jack_nframes_t time, size_t data_size), (port_buffer, time, data_size));
|
|
888 |
DECL_FUNCTION(int, jack_midi_event_write, (void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, size_t data_size), (port_buffer, time, data, data_size));
|
|
889 |
DECL_FUNCTION(jack_nframes_t, jack_midi_get_lost_event_count, (void* port_buffer), (port_buffer));
|
|
890 |
--- a/common/driver_interface.h
|
|
891 |
+++ b/common/driver_interface.h
|
|
892 |
@@ -33,7 +33,7 @@
|
|
893 |
|
|
894 |
#define JACK_DRIVER_NAME_MAX 15
|
|
895 |
#define JACK_DRIVER_PARAM_NAME_MAX 15
|
|
896 |
-#define JACK_DRIVER_PARAM_STRING_MAX 63
|
|
897 |
+#define JACK_DRIVER_PARAM_STRING_MAX 127
|
|
898 |
#define JACK_DRIVER_PARAM_DESC 255
|
|
899 |
#define JACK_PATH_MAX 511
|
|
900 |
|
|
901 |
--- a/common/jack/control.h
|
|
902 |
+++ b/common/jack/control.h
|
|
903 |
@@ -48,8 +48,8 @@
|
|
904 |
/** @brief Max value that jackctl_param_type_t type can have */
|
|
905 |
#define JACK_PARAM_MAX (JackParamBool + 1)
|
|
906 |
|
|
907 |
-/** @brief Max length of string parameter value, excluding terminating nul char */
|
|
908 |
-#define JACK_PARAM_STRING_MAX 63
|
|
909 |
+/** @brief Max length of string parameter value, excluding terminating null char */
|
|
910 |
+#define JACK_PARAM_STRING_MAX 127
|
|
911 |
|
|
912 |
/** @brief Type for parameter value */
|
|
913 |
/* intentionally similar to jack_driver_param_value_t */
|
|
914 |
--- a/common/shm.c
|
|
915 |
+++ b/common/shm.c
|
|
916 |
@@ -1,24 +1,3 @@
|
|
917 |
-/*
|
|
918 |
- * Copyright (C) 2003 Paul Davis
|
|
919 |
- * Copyright (C) 2004 Jack O'Quin
|
|
920 |
- * Copyright (C) 2006-2007 Grame
|
|
921 |
- *
|
|
922 |
- * This program is free software; you can redistribute it and/or modify
|
|
923 |
- * it under the terms of the GNU General Public License as published by
|
|
924 |
- * the Free Software Foundation; either version 2 of the License, or
|
|
925 |
- * (at your option) any later version.
|
|
926 |
- *
|
|
927 |
- * This program is distributed in the hope that it will be useful,
|
|
928 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
929 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
930 |
- * GNU General Public License for more details.
|
|
931 |
- *
|
|
932 |
- * You should have received a copy of the GNU General Public License
|
|
933 |
- * along with this program; if not, write to the Free Software
|
|
934 |
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
935 |
- *
|
|
936 |
- */
|
|
937 |
-
|
|
938 |
/* This module provides a set of abstract shared memory interfaces
|
|
939 |
* with support using both System V and POSIX shared memory
|
|
940 |
* implementations. The code is divided into three sections:
|
|
941 |
@@ -31,6 +10,25 @@
|
|
942 |
* set in the ./configure step.
|
|
943 |
*/
|
|
944 |
|
|
945 |
+/*
|
|
946 |
+ Copyright (C) 2001-2003 Paul Davis
|
|
947 |
+
|
|
948 |
+ This program is free software; you can redistribute it and/or modify
|
|
949 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
950 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
951 |
+ (at your option) any later version.
|
|
952 |
+
|
|
953 |
+ This program is distributed in the hope that it will be useful,
|
|
954 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
955 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
956 |
+ GNU Lesser General Public License for more details.
|
|
957 |
+
|
|
958 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
959 |
+ along with this program; if not, write to the Free Software
|
|
960 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
961 |
+
|
|
962 |
+ */
|
|
963 |
+
|
|
964 |
#include "JackConstants.h"
|
|
965 |
|
|
966 |
#ifdef WIN32
|
|
967 |
@@ -148,7 +146,7 @@
|
|
968 |
static int
|
|
969 |
semaphore_init () {return 0;}
|
|
970 |
|
|
971 |
-static int
|
|
972 |
+static int
|
|
973 |
semaphore_add (int value) {return 0;}
|
|
974 |
|
|
975 |
#else
|
|
976 |
@@ -534,7 +532,7 @@
|
|
977 |
}
|
|
978 |
}
|
|
979 |
|
|
980 |
- jack_shm_unlock_registry ();
|
|
981 |
+ jack_shm_unlock_registry ();
|
|
982 |
return 0;
|
|
983 |
}
|
|
984 |
|
|
985 |
--- a/dbus/controller_iface_control.c
|
|
986 |
+++ b/dbus/controller_iface_control.c
|
|
987 |
@@ -87,34 +87,31 @@
|
|
988 |
{
|
|
989 |
if (!jack_controller_start_server(controller_ptr, call))
|
|
990 |
{
|
|
991 |
- jack_error ("Failed to start server");
|
|
992 |
- }
|
|
993 |
- else
|
|
994 |
- {
|
|
995 |
- jack_controller_control_send_signal_server_started();
|
|
996 |
+ jack_dbus_error(call, JACK_DBUS_ERROR_GENERIC, "Failed to start server");
|
|
997 |
+ return true;
|
|
998 |
}
|
|
999 |
+
|
|
1000 |
+ jack_controller_control_send_signal_server_started();
|
|
1001 |
}
|
|
1002 |
else if (strcmp (call->method_name, "StopServer") == 0)
|
|
1003 |
{
|
|
1004 |
if (!jack_controller_stop_server(controller_ptr, call))
|
|
1005 |
{
|
|
1006 |
- jack_error ("Failed to stop server");
|
|
1007 |
- }
|
|
1008 |
- else
|
|
1009 |
- {
|
|
1010 |
- jack_controller_control_send_signal_server_stopped();
|
|
1011 |
+ jack_dbus_error(call, JACK_DBUS_ERROR_GENERIC, "Failed to stop server");
|
|
1012 |
+ return true;
|
|
1013 |
}
|
|
1014 |
+
|
|
1015 |
+ jack_controller_control_send_signal_server_stopped();
|
|
1016 |
}
|
|
1017 |
else if (strcmp (call->method_name, "SwitchMaster") == 0)
|
|
1018 |
{
|
|
1019 |
if (!jack_controller_switch_master(controller_ptr, call))
|
|
1020 |
{
|
|
1021 |
- jack_error ("Failed to switch master");
|
|
1022 |
- }
|
|
1023 |
- else
|
|
1024 |
- {
|
|
1025 |
- jack_controller_control_send_signal_server_stopped();
|
|
1026 |
+ jack_dbus_error(call, JACK_DBUS_ERROR_GENERIC, "Failed to switch master");
|
|
1027 |
+ return true;
|
|
1028 |
}
|
|
1029 |
+
|
|
1030 |
+ jack_controller_control_send_signal_server_stopped();
|
|
1031 |
}
|
|
1032 |
else if (strcmp (call->method_name, "GetLoad") == 0)
|
|
1033 |
{
|
|
1034 |
--- a/doxyfile
|
|
1035 |
+++ b/doxyfile
|
|
1036 |
@@ -23,7 +23,7 @@
|
|
1037 |
# This could be handy for archiving the generated documentation or
|
|
1038 |
# if some version control system is used.
|
|
1039 |
|
|
1040 |
-PROJECT_NUMBER = 1.9.5
|
|
1041 |
+PROJECT_NUMBER = 1.9.6
|
|
1042 |
|
|
1043 |
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
|
1044 |
# base path where the generated documentation will be put.
|
|
1045 |
--- a/example-clients/alsa_in.c
|
|
1046 |
+++ b/example-clients/alsa_in.c
|
|
1047 |
@@ -38,6 +38,8 @@
|
|
1048 |
int quit = 0;
|
|
1049 |
double resample_mean = 1.0;
|
|
1050 |
double static_resample_factor = 1.0;
|
|
1051 |
+double resample_lower_limit = 0.25;
|
|
1052 |
+double resample_upper_limit = 4.0;
|
|
1053 |
|
|
1054 |
double *offset_array;
|
|
1055 |
double *window_array;
|
|
1056 |
@@ -388,8 +390,8 @@
|
|
1057 |
output_offset = (float) offset;
|
|
1058 |
|
|
1059 |
// Clamp a bit.
|
|
1060 |
- if( current_resample_factor < 0.25 ) current_resample_factor = 0.25;
|
|
1061 |
- if( current_resample_factor > 4 ) current_resample_factor = 4;
|
|
1062 |
+ if( current_resample_factor < resample_lower_limit ) current_resample_factor = resample_lower_limit;
|
|
1063 |
+ if( current_resample_factor > resample_upper_limit ) current_resample_factor = resample_upper_limit;
|
|
1064 |
|
|
1065 |
// Now Calculate how many samples we need.
|
|
1066 |
rlen = ceil( ((double)nframes) / current_resample_factor )+2;
|
|
1067 |
@@ -675,6 +677,8 @@
|
|
1068 |
printf( "selected sample format: %s\n", formats[format].name );
|
|
1069 |
|
|
1070 |
static_resample_factor = (double) jack_sample_rate / (double) sample_rate;
|
|
1071 |
+ resample_lower_limit = static_resample_factor * 0.25;
|
|
1072 |
+ resample_upper_limit = static_resample_factor * 4.0;
|
|
1073 |
resample_mean = static_resample_factor;
|
|
1074 |
|
|
1075 |
offset_array = malloc( sizeof(double) * smooth_size );
|
|
1076 |
--- a/example-clients/alsa_out.c
|
|
1077 |
+++ b/example-clients/alsa_out.c
|
|
1078 |
@@ -37,6 +37,8 @@
|
|
1079 |
|
|
1080 |
double resample_mean = 1.0;
|
|
1081 |
double static_resample_factor = 1.0;
|
|
1082 |
+double resample_lower_limit = 0.25;
|
|
1083 |
+double resample_upper_limit = 4.0;
|
|
1084 |
|
|
1085 |
double *offset_array;
|
|
1086 |
double *window_array;
|
|
1087 |
@@ -395,8 +397,8 @@
|
|
1088 |
output_offset = (float) offset;
|
|
1089 |
|
|
1090 |
// Clamp a bit.
|
|
1091 |
- if( current_resample_factor < 0.25 ) current_resample_factor = 0.25;
|
|
1092 |
- if( current_resample_factor > 4 ) current_resample_factor = 4;
|
|
1093 |
+ if( current_resample_factor < resample_lower_limit ) current_resample_factor = resample_lower_limit;
|
|
1094 |
+ if( current_resample_factor > resample_upper_limit ) current_resample_factor = resample_upper_limit;
|
|
1095 |
|
|
1096 |
// Now Calculate how many samples we need.
|
|
1097 |
rlen = ceil( ((double)nframes) * current_resample_factor )+2;
|
|
1098 |
@@ -666,6 +668,8 @@
|
|
1099 |
sample_rate = jack_sample_rate;
|
|
1100 |
|
|
1101 |
static_resample_factor = (double) sample_rate / (double) jack_sample_rate;
|
|
1102 |
+ resample_lower_limit = static_resample_factor * 0.25;
|
|
1103 |
+ resample_upper_limit = static_resample_factor * 4.0;
|
|
1104 |
resample_mean = static_resample_factor;
|
|
1105 |
|
|
1106 |
offset_array = malloc( sizeof(double) * smooth_size );
|
|
1107 |
--- a/example-clients/internal_metro.cpp
|
|
1108 |
+++ b/example-clients/internal_metro.cpp
|
|
1109 |
@@ -46,7 +46,6 @@
|
|
1110 |
{
|
|
1111 |
sample_t scale;
|
|
1112 |
int i, attack_length, decay_length;
|
|
1113 |
- double *amp;
|
|
1114 |
int attack_percent = 1, decay_percent = 10;
|
|
1115 |
const char *bpm_string = "bpm";
|
|
1116 |
|
|
1117 |
@@ -59,7 +58,7 @@
|
|
1118 |
}
|
|
1119 |
if ((client = jack_client_open (client_name, JackNullOption, NULL)) == 0) {
|
|
1120 |
fprintf (stderr, "jack server not running?\n");
|
|
1121 |
- return ;
|
|
1122 |
+ return;
|
|
1123 |
}
|
|
1124 |
|
|
1125 |
jack_set_process_callback (client, process_audio, this);
|
|
1126 |
@@ -81,11 +80,11 @@
|
|
1127 |
", wave length = %" PRIu32 "\n", tone_length,
|
|
1128 |
wave_length);
|
|
1129 |
*/
|
|
1130 |
- return ;
|
|
1131 |
+ return;
|
|
1132 |
}
|
|
1133 |
if (attack_length + decay_length > (int)tone_length) {
|
|
1134 |
fprintf (stderr, "invalid attack/decay\n");
|
|
1135 |
- return ;
|
|
1136 |
+ return;
|
|
1137 |
}
|
|
1138 |
|
|
1139 |
/* Build the wave table */
|
|
1140 |
@@ -110,7 +109,6 @@
|
|
1141 |
|
|
1142 |
if (jack_activate (client)) {
|
|
1143 |
fprintf(stderr, "cannot activate client");
|
|
1144 |
- return;
|
|
1145 |
}
|
|
1146 |
}
|
|
1147 |
|
|
1148 |
@@ -120,4 +118,6 @@
|
|
1149 |
jack_port_unregister(client, input_port);
|
|
1150 |
jack_port_unregister(client, output_port);
|
|
1151 |
jack_client_close(client);
|
|
1152 |
+ free(amp);
|
|
1153 |
+ free(wave);
|
|
1154 |
}
|
|
1155 |
--- a/example-clients/internal_metro.h
|
|
1156 |
+++ b/example-clients/internal_metro.h
|
|
1157 |
@@ -53,6 +53,7 @@
|
|
1158 |
int bpm;
|
|
1159 |
jack_nframes_t tone_length, wave_length;
|
|
1160 |
sample_t *wave;
|
|
1161 |
+ double *amp;
|
|
1162 |
long offset ;
|
|
1163 |
|
|
1164 |
InternalMetro(int freq, double max_amp, int dur_arg, int bpm, char* client_name);
|
|
1165 |
--- a/example-clients/metro.c
|
|
1166 |
+++ b/example-clients/metro.c
|
|
1167 |
@@ -257,7 +257,7 @@
|
|
1168 |
|
|
1169 |
if (jack_activate (client)) {
|
|
1170 |
fprintf (stderr, "cannot activate client\n");
|
|
1171 |
- return 1;
|
|
1172 |
+ goto error;
|
|
1173 |
}
|
|
1174 |
|
|
1175 |
/* install a signal handler to properly quits jack client */
|
|
1176 |
@@ -282,5 +282,9 @@
|
|
1177 |
};
|
|
1178 |
|
|
1179 |
jack_client_close(client);
|
|
1180 |
+
|
|
1181 |
+error:
|
|
1182 |
+ free(amp);
|
|
1183 |
+ free(wave);
|
|
1184 |
exit (0);
|
|
1185 |
}
|
|
1186 |
--- a/linux/firewire/JackFFADODriver.cpp
|
|
1187 |
+++ b/linux/firewire/JackFFADODriver.cpp
|
|
1188 |
@@ -429,7 +429,7 @@
|
|
1189 |
|
|
1190 |
driver->capture_channels[chn].stream_type = ffado_streaming_get_capture_stream_type(driver->dev, chn);
|
|
1191 |
if (driver->capture_channels[chn].stream_type == ffado_stream_type_audio) {
|
|
1192 |
- snprintf(buf, sizeof(buf) - 1, "%s:%s", fClientControl.fName, portname);
|
|
1193 |
+ snprintf(buf, sizeof(buf) - 1, "firewire_pcm:%s_in", portname);
|
|
1194 |
printMessage ("Registering audio capture port %s", buf);
|
|
1195 |
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
|
|
1196 |
JACK_DEFAULT_AUDIO_TYPE,
|
|
1197 |
@@ -455,7 +455,7 @@
|
|
1198 |
fCaptureChannels++;
|
|
1199 |
|
|
1200 |
} else if (driver->capture_channels[chn].stream_type == ffado_stream_type_midi) {
|
|
1201 |
- snprintf(buf, sizeof(buf) - 1, "%s:%s", fClientControl.fName, portname);
|
|
1202 |
+ snprintf(buf, sizeof(buf) - 1, "firewire_pcm:%s_in", portname);
|
|
1203 |
printMessage ("Registering midi capture port %s", buf);
|
|
1204 |
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
|
|
1205 |
JACK_DEFAULT_MIDI_TYPE,
|
|
1206 |
@@ -502,7 +502,7 @@
|
|
1207 |
driver->playback_channels[chn].stream_type = ffado_streaming_get_playback_stream_type(driver->dev, chn);
|
|
1208 |
|
|
1209 |
if (driver->playback_channels[chn].stream_type == ffado_stream_type_audio) {
|
|
1210 |
- snprintf(buf, sizeof(buf) - 1, "%s:%s", fClientControl.fName, portname);
|
|
1211 |
+ snprintf(buf, sizeof(buf) - 1, "firewire_pcm:%s_out", portname);
|
|
1212 |
printMessage ("Registering audio playback port %s", buf);
|
|
1213 |
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
|
|
1214 |
JACK_DEFAULT_AUDIO_TYPE,
|
|
1215 |
@@ -530,7 +530,7 @@
|
|
1216 |
jack_log("JackFFADODriver::Attach fPlaybackPortList[i] %ld ", port_index);
|
|
1217 |
fPlaybackChannels++;
|
|
1218 |
} else if (driver->playback_channels[chn].stream_type == ffado_stream_type_midi) {
|
|
1219 |
- snprintf(buf, sizeof(buf) - 1, "%s:%s", fClientControl.fName, portname);
|
|
1220 |
+ snprintf(buf, sizeof(buf) - 1, "firewire_pcm:%s_out", portname);
|
|
1221 |
printMessage ("Registering midi playback port %s", buf);
|
|
1222 |
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
|
|
1223 |
JACK_DEFAULT_MIDI_TYPE,
|
|
1224 |
@@ -753,12 +753,20 @@
|
|
1225 |
strcpy (desc->name, "firewire"); // size MUST be less then JACK_DRIVER_NAME_MAX + 1
|
|
1226 |
strcpy(desc->desc, "Linux FFADO API based audio backend"); // size MUST be less then JACK_DRIVER_PARAM_DESC + 1
|
|
1227 |
|
|
1228 |
- desc->nparams = 11;
|
|
1229 |
+ desc->nparams = 12;
|
|
1230 |
|
|
1231 |
params = (jack_driver_param_desc_t *)calloc (desc->nparams, sizeof (jack_driver_param_desc_t));
|
|
1232 |
desc->params = params;
|
|
1233 |
|
|
1234 |
i = 0;
|
|
1235 |
+ strcpy (params[i].name, "device");
|
|
1236 |
+ params[i].character = 'd';
|
|
1237 |
+ params[i].type = JackDriverParamString;
|
|
1238 |
+ strcpy (params[i].value.str, "hw:0");
|
|
1239 |
+ strcpy (params[i].short_desc, "The FireWire device to use.");
|
|
1240 |
+ strcpy (params[i].long_desc, "The FireWire device to use. Please consult the FFADO documentation for more info.");
|
|
1241 |
+
|
|
1242 |
+ i++;
|
|
1243 |
strcpy (params[i].name, "period");
|
|
1244 |
params[i].character = 'p';
|
|
1245 |
params[i].type = JackDriverParamUInt;
|
|
1246 |
@@ -881,7 +889,7 @@
|
|
1247 |
|
|
1248 |
switch (param->character) {
|
|
1249 |
case 'd':
|
|
1250 |
- device_name = strdup (param->value.str);
|
|
1251 |
+ device_name = const_cast<char*>(param->value.str);
|
|
1252 |
break;
|
|
1253 |
case 'p':
|
|
1254 |
cmlparams.period_size = param->value.ui;
|
|
1255 |
--- a/macosx/Jack-Info.plist
|
|
1256 |
+++ b/macosx/Jack-Info.plist
|
|
1257 |
@@ -7,7 +7,7 @@
|
|
1258 |
<key>CFBundleExecutable</key>
|
|
1259 |
<string>Jackservermp</string>
|
|
1260 |
<key>CFBundleGetInfoString</key>
|
|
1261 |
- <string>Jackdmp 1.9.5, @03-09 Paul Davis, Grame</string>
|
|
1262 |
+ <string>Jackdmp 1.9.6, @03-10 Paul Davis, Grame</string>
|
|
1263 |
<key>CFBundleIdentifier</key>
|
|
1264 |
<string>com.grame.Jackmp</string>
|
|
1265 |
<key>CFBundleInfoDictionaryVersion</key>
|
|
1266 |
@@ -19,6 +19,6 @@
|
|
1267 |
<key>CFBundleSignature</key>
|
|
1268 |
<string>????</string>
|
|
1269 |
<key>CFBundleVersion</key>
|
|
1270 |
- <string>1.9.5</string>
|
|
1271 |
+ <string>1.9.6</string>
|
|
1272 |
</dict>
|
|
1273 |
</plist>
|
|
1274 |
--- a/macosx/JackMachServerChannel.cpp
|
|
1275 |
+++ b/macosx/JackMachServerChannel.cpp
|
|
1276 |
@@ -159,7 +159,7 @@
|
|
1277 |
kern_return_t res;
|
|
1278 |
if ((res = mach_msg_server(MessageHandler, 1024, fServerPort.GetPortSet(), 0)) != KERN_SUCCESS) {
|
|
1279 |
jack_log("JackMachServerChannel::Execute: err = %s", mach_error_string(res));
|
|
1280 |
- return false;
|
|
1281 |
+ // A recoverable error, so keep running...
|
|
1282 |
}
|
|
1283 |
return true;
|
|
1284 |
|
|
1285 |
--- a/macosx/Jackdmp.xcodeproj/project.pbxproj
|
|
1286 |
+++ b/macosx/Jackdmp.xcodeproj/project.pbxproj
|
|
1287 |
@@ -106,7 +106,6 @@
|
|
1288 |
4B19B3140E2362E800DD4A82 /* JackAudioAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3070E2362E700DD4A82 /* JackAudioAdapter.h */; };
|
|
1289 |
4B19B3150E2362E800DD4A82 /* JackAudioAdapterInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3080E2362E700DD4A82 /* JackAudioAdapterInterface.cpp */; };
|
|
1290 |
4B19B3160E2362E800DD4A82 /* JackAudioAdapterInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3090E2362E700DD4A82 /* JackAudioAdapterInterface.h */; };
|
|
1291 |
- 4B19B3190E2362E800DD4A82 /* JackException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30C0E2362E700DD4A82 /* JackException.h */; };
|
|
1292 |
4B19B31B0E2362E800DD4A82 /* JackLibSampleRateResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B30E0E2362E700DD4A82 /* JackLibSampleRateResampler.cpp */; };
|
|
1293 |
4B19B31C0E2362E800DD4A82 /* JackLibSampleRateResampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30F0E2362E700DD4A82 /* JackLibSampleRateResampler.h */; };
|
|
1294 |
4B19B31F0E2362E800DD4A82 /* JackResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3120E2362E700DD4A82 /* JackResampler.cpp */; };
|
|
1295 |
@@ -423,15 +422,12 @@
|
|
1296 |
4B5DB9830CD2429A00EBA5EE /* JackDebugClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B98AE000931D30C0091932A /* JackDebugClient.cpp */; };
|
|
1297 |
4B5DB9840CD2429B00EBA5EE /* JackDebugClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B98AE010931D30C0091932A /* JackDebugClient.h */; };
|
|
1298 |
4B5E08C30E5B66EE00BEE4E0 /* JackAudioAdapterInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3090E2362E700DD4A82 /* JackAudioAdapterInterface.h */; };
|
|
1299 |
- 4B5E08C40E5B66EE00BEE4E0 /* JackException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30C0E2362E700DD4A82 /* JackException.h */; };
|
|
1300 |
4B5E08C60E5B66EE00BEE4E0 /* JackLibSampleRateResampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30F0E2362E700DD4A82 /* JackLibSampleRateResampler.h */; };
|
|
1301 |
4B5E08CC0E5B66EE00BEE4E0 /* JackAudioAdapterInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3080E2362E700DD4A82 /* JackAudioAdapterInterface.cpp */; };
|
|
1302 |
4B5E08CD0E5B66EE00BEE4E0 /* JackLibSampleRateResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B30E0E2362E700DD4A82 /* JackLibSampleRateResampler.cpp */; };
|
|
1303 |
4B5E08CE0E5B66EE00BEE4E0 /* JackResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3120E2362E700DD4A82 /* JackResampler.cpp */; };
|
|
1304 |
4B5E08E10E5B676C00BEE4E0 /* JackNetAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B5E08DF0E5B676C00BEE4E0 /* JackNetAdapter.cpp */; };
|
|
1305 |
4B5E08E20E5B676D00BEE4E0 /* JackNetAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5E08E00E5B676C00BEE4E0 /* JackNetAdapter.h */; };
|
|
1306 |
- 4B5E08EB0E5B67EA00BEE4E0 /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1307 |
- 4B5E08EC0E5B67EB00BEE4E0 /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1308 |
4B5E08EE0E5B680200BEE4E0 /* JackAudioAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3060E2362E700DD4A82 /* JackAudioAdapter.cpp */; };
|
|
1309 |
4B5E08EF0E5B680200BEE4E0 /* JackAudioAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3070E2362E700DD4A82 /* JackAudioAdapter.h */; };
|
|
1310 |
4B5F253E0DEE9B8F0041E486 /* JackLockedEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5F253D0DEE9B8F0041E486 /* JackLockedEngine.h */; };
|
|
1311 |
@@ -570,16 +566,24 @@
|
|
1312 |
4B6C738A0CC60A85001AFFD4 /* thread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6C737D0CC60A6D001AFFD4 /* thread.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1313 |
4B6C738B0CC60A86001AFFD4 /* transport.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6C737E0CC60A6D001AFFD4 /* transport.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1314 |
4B6F7AEE0CD0CDBD00F48A9D /* JackEngineControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6F7AEC0CD0CDBD00F48A9D /* JackEngineControl.cpp */; };
|
|
1315 |
- 4B76C76A0E5AB2DB00E2AC21 /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1316 |
- 4B76C76B0E5AB2DB00E2AC21 /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1317 |
- 4B76C76C0E5AB2DB00E2AC21 /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1318 |
- 4B76C76D0E5AB2DB00E2AC21 /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1319 |
4B80D7E80BA0D17400F035BB /* JackMidiPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B80D7E50BA0D17400F035BB /* JackMidiPort.h */; };
|
|
1320 |
4B80D7E90BA0D17400F035BB /* JackMidiPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B80D7E60BA0D17400F035BB /* JackMidiPort.cpp */; };
|
|
1321 |
4B80D7EA0BA0D17400F035BB /* JackMidiAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B80D7E70BA0D17400F035BB /* JackMidiAPI.cpp */; };
|
|
1322 |
4B80D7EB0BA0D17400F035BB /* JackMidiPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B80D7E50BA0D17400F035BB /* JackMidiPort.h */; };
|
|
1323 |
4B80D7EC0BA0D17400F035BB /* JackMidiPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B80D7E60BA0D17400F035BB /* JackMidiPort.cpp */; };
|
|
1324 |
4B80D7ED0BA0D17400F035BB /* JackMidiAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B80D7E70BA0D17400F035BB /* JackMidiAPI.cpp */; };
|
|
1325 |
+ 4B88D03B11298BEE007A87C1 /* weakjack.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03911298BEE007A87C1 /* weakjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1326 |
+ 4B88D03C11298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1327 |
+ 4B88D03D11298BEE007A87C1 /* weakjack.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03911298BEE007A87C1 /* weakjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1328 |
+ 4B88D03E11298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1329 |
+ 4B88D03F11298BEE007A87C1 /* weakjack.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03911298BEE007A87C1 /* weakjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1330 |
+ 4B88D04011298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1331 |
+ 4B88D04111298BEE007A87C1 /* weakjack.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03911298BEE007A87C1 /* weakjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1332 |
+ 4B88D04211298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1333 |
+ 4B88D04311298BEE007A87C1 /* weakjack.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03911298BEE007A87C1 /* weakjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1334 |
+ 4B88D04411298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1335 |
+ 4B88D04511298BEE007A87C1 /* weakjack.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03911298BEE007A87C1 /* weakjack.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1336 |
+ 4B88D04611298BEE007A87C1 /* weakmacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B88D03A11298BEE007A87C1 /* weakmacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1337 |
4B93F1990E87992100E4ECCD /* JackPosixThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6A20E703B2E0066E42F /* JackPosixThread.cpp */; };
|
|
1338 |
4B93F19A0E87992200E4ECCD /* JackPosixThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6A30E703B2E0066E42F /* JackPosixThread.h */; };
|
|
1339 |
4B93F19C0E87998200E4ECCD /* JackPosixServerLaunch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5FBBA0E878B9C003D2374 /* JackPosixServerLaunch.cpp */; };
|
|
1340 |
@@ -743,16 +747,22 @@
|
|
1341 |
4BC216850A444BAD00BDA09F /* JackServerAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8D1F50834EFB000C94B91 /* JackServerAPI.cpp */; };
|
|
1342 |
4BC216890A444BDE00BDA09F /* JackServerGlobals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC216880A444BDE00BDA09F /* JackServerGlobals.cpp */; };
|
|
1343 |
4BC2168E0A444BED00BDA09F /* JackServerGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC2168D0A444BED00BDA09F /* JackServerGlobals.h */; };
|
|
1344 |
+ 4BC2CA55113C6C930076717C /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1345 |
+ 4BC2CA56113C6C940076717C /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1346 |
+ 4BC2CA57113C6C9B0076717C /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1347 |
+ 4BC2CA58113C6C9C0076717C /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1348 |
+ 4BC2CA59113C6CB60076717C /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1349 |
+ 4BC2CA5A113C6CB80076717C /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1350 |
+ 4BC2CA5B113C6CBE0076717C /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1351 |
+ 4BC2CA5C113C6CC00076717C /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1352 |
+ 4BC2CA5D113C6CC90076717C /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1353 |
+ 4BC2CA5E113C6CCA0076717C /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1354 |
+ 4BC2CA5F113C6CD10076717C /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1355 |
+ 4BC2CA60113C6CD20076717C /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1356 |
4BC3B6A40E703B2E0066E42F /* JackPosixThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6A20E703B2E0066E42F /* JackPosixThread.cpp */; };
|
|
1357 |
4BC3B6A50E703B2E0066E42F /* JackPosixThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6A30E703B2E0066E42F /* JackPosixThread.h */; };
|
|
1358 |
4BC3B6A60E703B2E0066E42F /* JackPosixThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6A20E703B2E0066E42F /* JackPosixThread.cpp */; };
|
|
1359 |
4BC3B6A70E703B2E0066E42F /* JackPosixThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6A30E703B2E0066E42F /* JackPosixThread.h */; };
|
|
1360 |
- 4BC3B6BB0E703BCC0066E42F /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1361 |
- 4BC3B6BC0E703BCC0066E42F /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1362 |
- 4BC3B6BD0E703BCC0066E42F /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1363 |
- 4BC3B6BE0E703BCC0066E42F /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1364 |
- 4BC3B6BF0E703BCC0066E42F /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1365 |
- 4BC3B6C00E703BCC0066E42F /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1366 |
4BCBCE5D10C4FE3F00450FFE /* JackPhysicalMidiInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BCBCE5910C4FE3F00450FFE /* JackPhysicalMidiInput.cpp */; };
|
|
1367 |
4BCBCE5E10C4FE3F00450FFE /* JackPhysicalMidiInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BCBCE5A10C4FE3F00450FFE /* JackPhysicalMidiInput.h */; };
|
|
1368 |
4BCBCE5F10C4FE3F00450FFE /* JackPhysicalMidiOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BCBCE5B10C4FE3F00450FFE /* JackPhysicalMidiOutput.cpp */; };
|
|
1369 |
@@ -775,25 +785,13 @@
|
|
1370 |
4BDCDB951001FB9C00B15929 /* JackCoreMidiDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF339140F8B86DC0080FB5B /* JackCoreMidiDriver.h */; };
|
|
1371 |
4BDCDB971001FB9C00B15929 /* JackCoreMidiDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF339150F8B86DC0080FB5B /* JackCoreMidiDriver.cpp */; };
|
|
1372 |
4BDCDBB91001FCC000B15929 /* JackNetDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = BA222ADD0DC882A5001A17F4 /* JackNetDriver.h */; };
|
|
1373 |
- 4BDCDBBA1001FCC000B15929 /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1374 |
- 4BDCDBBB1001FCC000B15929 /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1375 |
4BDCDBBD1001FCC000B15929 /* JackNetDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA222ADC0DC882A5001A17F4 /* JackNetDriver.cpp */; };
|
|
1376 |
- 4BDCDBBE1001FCC000B15929 /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1377 |
- 4BDCDBBF1001FCC000B15929 /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1378 |
4BDCDBD11001FD0100B15929 /* JackWaitThreadedDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBC93B80DF9736C002DF220 /* JackWaitThreadedDriver.cpp */; };
|
|
1379 |
4BDCDBD21001FD0200B15929 /* JackWaitThreadedDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBC93B90DF9736C002DF220 /* JackWaitThreadedDriver.h */; };
|
|
1380 |
4BDCDBD91001FD2D00B15929 /* JackNetManager.h in Headers */ = {isa = PBXBuildFile; fileRef = BA222AEC0DC883B3001A17F4 /* JackNetManager.h */; };
|
|
1381 |
- 4BDCDBDA1001FD2D00B15929 /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1382 |
- 4BDCDBDB1001FD2D00B15929 /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1383 |
- 4BDCDBDC1001FD2D00B15929 /* JackArgParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF284170F31B4BC00B05BE3 /* JackArgParser.h */; };
|
|
1384 |
4BDCDBDE1001FD2D00B15929 /* JackNetManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA222AEB0DC883B3001A17F4 /* JackNetManager.cpp */; };
|
|
1385 |
- 4BDCDBDF1001FD2D00B15929 /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1386 |
- 4BDCDBE01001FD2D00B15929 /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1387 |
- 4BDCDBE11001FD2D00B15929 /* JackMachTime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5FBC80E878D24003D2374 /* JackMachTime.c */; };
|
|
1388 |
- 4BDCDBE21001FD2D00B15929 /* JackArgParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF284160F31B4BC00B05BE3 /* JackArgParser.cpp */; };
|
|
1389 |
4BDCDBEE1001FD7300B15929 /* JackAudioAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3070E2362E700DD4A82 /* JackAudioAdapter.h */; };
|
|
1390 |
4BDCDBEF1001FD7300B15929 /* JackAudioAdapterInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3090E2362E700DD4A82 /* JackAudioAdapterInterface.h */; };
|
|
1391 |
- 4BDCDBF01001FD7300B15929 /* JackException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30C0E2362E700DD4A82 /* JackException.h */; };
|
|
1392 |
4BDCDBF11001FD7300B15929 /* JackLibSampleRateResampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30F0E2362E700DD4A82 /* JackLibSampleRateResampler.h */; };
|
|
1393 |
4BDCDBF21001FD7300B15929 /* JackCoreAudioAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BE5FED00E725C320020B576 /* JackCoreAudioAdapter.h */; };
|
|
1394 |
4BDCDBF41001FD7300B15929 /* JackAudioAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3060E2362E700DD4A82 /* JackAudioAdapter.cpp */; };
|
|
1395 |
@@ -805,19 +803,14 @@
|
|
1396 |
4BDCDC091001FDA800B15929 /* JackArgParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF284160F31B4BC00B05BE3 /* JackArgParser.cpp */; };
|
|
1397 |
4BDCDC0A1001FDA800B15929 /* JackArgParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF284170F31B4BC00B05BE3 /* JackArgParser.h */; };
|
|
1398 |
4BDCDC111001FDE300B15929 /* JackAudioAdapterInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3090E2362E700DD4A82 /* JackAudioAdapterInterface.h */; };
|
|
1399 |
- 4BDCDC121001FDE300B15929 /* JackException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30C0E2362E700DD4A82 /* JackException.h */; };
|
|
1400 |
4BDCDC131001FDE300B15929 /* JackLibSampleRateResampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B30F0E2362E700DD4A82 /* JackLibSampleRateResampler.h */; };
|
|
1401 |
4BDCDC141001FDE300B15929 /* JackNetAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5E08E00E5B676C00BEE4E0 /* JackNetAdapter.h */; };
|
|
1402 |
- 4BDCDC151001FDE300B15929 /* JackNetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B76C7690E5AB2DB00E2AC21 /* JackNetInterface.h */; };
|
|
1403 |
4BDCDC161001FDE300B15929 /* JackAudioAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19B3070E2362E700DD4A82 /* JackAudioAdapter.h */; };
|
|
1404 |
- 4BDCDC171001FDE300B15929 /* JackNetUnixSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC3B6BA0E703BCC0066E42F /* JackNetUnixSocket.h */; };
|
|
1405 |
4BDCDC191001FDE300B15929 /* JackAudioAdapterInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3080E2362E700DD4A82 /* JackAudioAdapterInterface.cpp */; };
|
|
1406 |
4BDCDC1A1001FDE300B15929 /* JackLibSampleRateResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B30E0E2362E700DD4A82 /* JackLibSampleRateResampler.cpp */; };
|
|
1407 |
4BDCDC1B1001FDE300B15929 /* JackResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3120E2362E700DD4A82 /* JackResampler.cpp */; };
|
|
1408 |
4BDCDC1C1001FDE300B15929 /* JackNetAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B5E08DF0E5B676C00BEE4E0 /* JackNetAdapter.cpp */; };
|
|
1409 |
- 4BDCDC1D1001FDE300B15929 /* JackNetInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B76C7680E5AB2DB00E2AC21 /* JackNetInterface.cpp */; };
|
|
1410 |
4BDCDC1E1001FDE300B15929 /* JackAudioAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B19B3060E2362E700DD4A82 /* JackAudioAdapter.cpp */; };
|
|
1411 |
- 4BDCDC1F1001FDE300B15929 /* JackNetUnixSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BC3B6B90E703BCC0066E42F /* JackNetUnixSocket.cpp */; };
|
|
1412 |
4BE3225A0CC611EF00AFA640 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6C737F0CC60A6D001AFFD4 /* types.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1413 |
4BE3225B0CC611F500AFA640 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6C737F0CC60A6D001AFFD4 /* types.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
1414 |
4BE4CC010CDA153400CCF5BB /* JackTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE4CBFF0CDA153400CCF5BB /* JackTools.cpp */; };
|
|
1415 |
@@ -837,8 +830,6 @@
|
|
1416 |
4BECB2FA0F4451C10091B70A /* JackProcessSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BECB2F40F4451C10091B70A /* JackProcessSync.h */; };
|
|
1417 |
4BECB2FB0F4451C10091B70A /* JackProcessSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BECB2F30F4451C10091B70A /* JackProcessSync.cpp */; };
|
|
1418 |
4BECB2FC0F4451C10091B70A /* JackProcessSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BECB2F40F4451C10091B70A /* JackProcessSync.h */; };
|
|
1419 |
- 4BF284180F31B4BC00B05BE3 /* JackArgParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF284160F31B4BC00B05BE3 /* JackArgParser.cpp */; };
|
|
1420 |
- 4BF284190F31B4BC00B05BE3 /* JackArgParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF284170F31B4BC00B05BE3 /* JackArgParser.h */; };
|
|
1421 |
4BF2841A0F31B4BC00B05BE3 /* JackArgParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF284160F31B4BC00B05BE3 /* JackArgParser.cpp */; };
|
|
1422 |
4BF2841B0F31B4BC00B05BE3 /* JackArgParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF284170F31B4BC00B05BE3 /* JackArgParser.h */; };
|
|
1423 |
4BF3391A0F8B86DC0080FB5B /* JackCoreMidiDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF339140F8B86DC0080FB5B /* JackCoreMidiDriver.h */; };
|
|
1424 |
@@ -853,7 +844,6 @@
|
|
1425 |
4BF520590CB8D1010037470E /* timestamps.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF520580CB8D1010037470E /* timestamps.h */; settings = {ATTRIBUTES = (); }; };
|
|
1426 |
4BF5205A0CB8D1010037470E /* timestamps.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF520580CB8D1010037470E /* timestamps.h */; settings = {ATTRIBUTES = (); }; };
|
|
1427 |
4BF5FBBC0E878B9C003D2374 /* JackPosixServerLaunch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5FBBA0E878B9C003D2374 /* JackPosixServerLaunch.cpp */; };
|
|
1428 |
- 4BF5FBC90E878D24003D2374 /* JackMachTime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5FBC80E878D24003D2374 /* JackMachTime.c */; };
|
|
1429 |
4BF5FBCA0E878D24003D2374 /* JackMachTime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5FBC80E878D24003D2374 /* JackMachTime.c */; };
|
|
1430 |
4BF5FBCB0E878D24003D2374 /* JackMachTime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5FBC80E878D24003D2374 /* JackMachTime.c */; };
|
|
1431 |
4BFA5E9F0DEC4DD900FA4CDB /* testMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFA5E9E0DEC4DD900FA4CDB /* testMutex.cpp */; };
|
|
1432 |
@@ -1567,6 +1557,8 @@
|
|
1433 |
4B869B3D08C8D21C001CF041 /* driver_interface.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = driver_interface.h; path = ../common/driver_interface.h; sourceTree = SOURCE_ROOT; };
|
|
1434 |
4B869B4208C8D22F001CF041 /* JackDriverLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JackDriverLoader.h; path = ../common/JackDriverLoader.h; sourceTree = SOURCE_ROOT; };
|
|
1435 |
4B869D7F08C9CB00001CF041 /* JackDriverLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = JackDriverLoader.cpp; path = ../common/JackDriverLoader.cpp; sourceTree = SOURCE_ROOT; };
|
|
1436 |
+ 4B88D03911298BEE007A87C1 /* weakjack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = weakjack.h; path = ../common/jack/weakjack.h; sourceTree = SOURCE_ROOT; };
|
|
1437 |
+ 4B88D03A11298BEE007A87C1 /* weakmacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = weakmacros.h; path = ../common/jack/weakmacros.h; sourceTree = SOURCE_ROOT; };
|
|
1438 |
4B89B759076B731100D170DE /* JackRPCClientUser.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = JackRPCClientUser.c; path = RPC/JackRPCClientUser.c; sourceTree = SOURCE_ROOT; };
|
|
1439 |
4B89B769076B74D200D170DE /* JackRPCEngineUser.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = JackRPCEngineUser.c; path = RPC/JackRPCEngineUser.c; sourceTree = SOURCE_ROOT; };
|
|
1440 |
4B940B9B06DDDE5B00D77F60 /* AudioHardware.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AudioHardware.h; path = /System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers/AudioHardware.h; sourceTree = "<absolute>"; };
|
|
1441 |
@@ -2711,6 +2703,8 @@
|
|
1442 |
4B6C737D0CC60A6D001AFFD4 /* thread.h */,
|
|
1443 |
4B6C737E0CC60A6D001AFFD4 /* transport.h */,
|
|
1444 |
4B6C737F0CC60A6D001AFFD4 /* types.h */,
|
|
1445 |
+ 4B88D03911298BEE007A87C1 /* weakjack.h */,
|
|
1446 |
+ 4B88D03A11298BEE007A87C1 /* weakmacros.h */,
|
|
1447 |
);
|
|
1448 |
name = jack;
|
|
1449 |
path = ../common/jack;
|
|
1450 |
@@ -3061,7 +3055,6 @@
|
|
1451 |
files = (
|
|
1452 |
4B19B3140E2362E800DD4A82 /* JackAudioAdapter.h in Headers */,
|
|
1453 |
4B19B3160E2362E800DD4A82 /* JackAudioAdapterInterface.h in Headers */,
|
|
1454 |
- 4B19B3190E2362E800DD4A82 /* JackException.h in Headers */,
|
|
1455 |
4B19B31C0E2362E800DD4A82 /* JackLibSampleRateResampler.h in Headers */,
|
|
1456 |
4BE5FED20E725C320020B576 /* JackCoreAudioAdapter.h in Headers */,
|
|
1457 |
);
|
|
1458 |
@@ -3159,6 +3152,8 @@
|
|
1459 |
4B4F9C910DC20C0400706CB0 /* JackMessageBuffer.h in Headers */,
|
|
1460 |
4B93F19E0E87998400E4ECCD /* JackPosixThread.h in Headers */,
|
|
1461 |
4BECB2FA0F4451C10091B70A /* JackProcessSync.h in Headers */,
|
|
1462 |
+ 4B88D03F11298BEE007A87C1 /* weakjack.h in Headers */,
|
|
1463 |
+ 4B88D04011298BEE007A87C1 /* weakmacros.h in Headers */,
|
|
1464 |
);
|
|
1465 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1466 |
};
|
|
1467 |
@@ -3227,6 +3222,10 @@
|
|
1468 |
4BDCDC0A1001FDA800B15929 /* JackArgParser.h in Headers */,
|
|
1469 |
4BCBCE6210C4FE3F00450FFE /* JackPhysicalMidiInput.h in Headers */,
|
|
1470 |
4BCBCE6410C4FE3F00450FFE /* JackPhysicalMidiOutput.h in Headers */,
|
|
1471 |
+ 4B88D04311298BEE007A87C1 /* weakjack.h in Headers */,
|
|
1472 |
+ 4B88D04411298BEE007A87C1 /* weakmacros.h in Headers */,
|
|
1473 |
+ 4BC2CA5A113C6CB80076717C /* JackNetInterface.h in Headers */,
|
|
1474 |
+ 4BC2CA5C113C6CC00076717C /* JackNetUnixSocket.h in Headers */,
|
|
1475 |
);
|
|
1476 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1477 |
};
|
|
1478 |
@@ -3507,6 +3506,8 @@
|
|
1479 |
4B47ACA910B5890100469C67 /* JackMessageBuffer.h in Headers */,
|
|
1480 |
4B47ACAA10B5890100469C67 /* JackPosixThread.h in Headers */,
|
|
1481 |
4B47ACAB10B5890100469C67 /* JackProcessSync.h in Headers */,
|
|
1482 |
+ 4B88D04111298BEE007A87C1 /* weakjack.h in Headers */,
|
|
1483 |
+ 4B88D04211298BEE007A87C1 /* weakmacros.h in Headers */,
|
|
1484 |
);
|
|
1485 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1486 |
};
|
|
1487 |
@@ -3529,12 +3530,9 @@
|
|
1488 |
buildActionMask = 2147483647;
|
|
1489 |
files = (
|
|
1490 |
4B5E08C30E5B66EE00BEE4E0 /* JackAudioAdapterInterface.h in Headers */,
|
|
1491 |
- 4B5E08C40E5B66EE00BEE4E0 /* JackException.h in Headers */,
|
|
1492 |
4B5E08C60E5B66EE00BEE4E0 /* JackLibSampleRateResampler.h in Headers */,
|
|
1493 |
4B5E08E20E5B676D00BEE4E0 /* JackNetAdapter.h in Headers */,
|
|
1494 |
- 4B5E08EC0E5B67EB00BEE4E0 /* JackNetInterface.h in Headers */,
|
|
1495 |
4B5E08EF0E5B680200BEE4E0 /* JackAudioAdapter.h in Headers */,
|
|
1496 |
- 4BC3B6C00E703BCC0066E42F /* JackNetUnixSocket.h in Headers */,
|
|
1497 |
);
|
|
1498 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1499 |
};
|
|
1500 |
@@ -3592,6 +3590,8 @@
|
|
1501 |
4BC3B6A50E703B2E0066E42F /* JackPosixThread.h in Headers */,
|
|
1502 |
4BECB2F80F4451C10091B70A /* JackProcessSync.h in Headers */,
|
|
1503 |
4B94334A10A5E666002A187F /* systemdeps.h in Headers */,
|
|
1504 |
+ 4B88D03B11298BEE007A87C1 /* weakjack.h in Headers */,
|
|
1505 |
+ 4B88D03C11298BEE007A87C1 /* weakmacros.h in Headers */,
|
|
1506 |
);
|
|
1507 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1508 |
};
|
|
1509 |
@@ -3664,6 +3664,10 @@
|
|
1510 |
4B94334B10A5E666002A187F /* systemdeps.h in Headers */,
|
|
1511 |
4BCBCE5E10C4FE3F00450FFE /* JackPhysicalMidiInput.h in Headers */,
|
|
1512 |
4BCBCE6010C4FE3F00450FFE /* JackPhysicalMidiOutput.h in Headers */,
|
|
1513 |
+ 4B88D03D11298BEE007A87C1 /* weakjack.h in Headers */,
|
|
1514 |
+ 4B88D03E11298BEE007A87C1 /* weakmacros.h in Headers */,
|
|
1515 |
+ 4BC2CA56113C6C940076717C /* JackNetInterface.h in Headers */,
|
|
1516 |
+ 4BC2CA58113C6C9C0076717C /* JackNetUnixSocket.h in Headers */,
|
|
1517 |
);
|
|
1518 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1519 |
};
|
|
1520 |
@@ -3841,6 +3845,10 @@
|
|
1521 |
4BA3396F10B2E36800190E3B /* JackArgParser.h in Headers */,
|
|
1522 |
4BCBCE6610C4FE3F00450FFE /* JackPhysicalMidiInput.h in Headers */,
|
|
1523 |
4BCBCE6810C4FE3F00450FFE /* JackPhysicalMidiOutput.h in Headers */,
|
|
1524 |
+ 4B88D04511298BEE007A87C1 /* weakjack.h in Headers */,
|
|
1525 |
+ 4B88D04611298BEE007A87C1 /* weakmacros.h in Headers */,
|
|
1526 |
+ 4BC2CA5E113C6CCA0076717C /* JackNetInterface.h in Headers */,
|
|
1527 |
+ 4BC2CA60113C6CD20076717C /* JackNetUnixSocket.h in Headers */,
|
|
1528 |
);
|
|
1529 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1530 |
};
|
|
1531 |
@@ -3885,8 +3893,6 @@
|
|
1532 |
buildActionMask = 2147483647;
|
|
1533 |
files = (
|
|
1534 |
4BDCDBB91001FCC000B15929 /* JackNetDriver.h in Headers */,
|
|
1535 |
- 4BDCDBBA1001FCC000B15929 /* JackNetInterface.h in Headers */,
|
|
1536 |
- 4BDCDBBB1001FCC000B15929 /* JackNetUnixSocket.h in Headers */,
|
|
1537 |
);
|
|
1538 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1539 |
};
|
|
1540 |
@@ -3895,9 +3901,6 @@
|
|
1541 |
buildActionMask = 2147483647;
|
|
1542 |
files = (
|
|
1543 |
4BDCDBD91001FD2D00B15929 /* JackNetManager.h in Headers */,
|
|
1544 |
- 4BDCDBDA1001FD2D00B15929 /* JackNetInterface.h in Headers */,
|
|
1545 |
- 4BDCDBDB1001FD2D00B15929 /* JackNetUnixSocket.h in Headers */,
|
|
1546 |
- 4BDCDBDC1001FD2D00B15929 /* JackArgParser.h in Headers */,
|
|
1547 |
);
|
|
1548 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1549 |
};
|
|
1550 |
@@ -3907,7 +3910,6 @@
|
|
1551 |
files = (
|
|
1552 |
4BDCDBEE1001FD7300B15929 /* JackAudioAdapter.h in Headers */,
|
|
1553 |
4BDCDBEF1001FD7300B15929 /* JackAudioAdapterInterface.h in Headers */,
|
|
1554 |
- 4BDCDBF01001FD7300B15929 /* JackException.h in Headers */,
|
|
1555 |
4BDCDBF11001FD7300B15929 /* JackLibSampleRateResampler.h in Headers */,
|
|
1556 |
4BDCDBF21001FD7300B15929 /* JackCoreAudioAdapter.h in Headers */,
|
|
1557 |
);
|
|
1558 |
@@ -3918,12 +3920,9 @@
|
|
1559 |
buildActionMask = 2147483647;
|
|
1560 |
files = (
|
|
1561 |
4BDCDC111001FDE300B15929 /* JackAudioAdapterInterface.h in Headers */,
|
|
1562 |
- 4BDCDC121001FDE300B15929 /* JackException.h in Headers */,
|
|
1563 |
4BDCDC131001FDE300B15929 /* JackLibSampleRateResampler.h in Headers */,
|
|
1564 |
4BDCDC141001FDE300B15929 /* JackNetAdapter.h in Headers */,
|
|
1565 |
- 4BDCDC151001FDE300B15929 /* JackNetInterface.h in Headers */,
|
|
1566 |
4BDCDC161001FDE300B15929 /* JackAudioAdapter.h in Headers */,
|
|
1567 |
- 4BDCDC171001FDE300B15929 /* JackNetUnixSocket.h in Headers */,
|
|
1568 |
);
|
|
1569 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1570 |
};
|
|
1571 |
@@ -4010,8 +4009,6 @@
|
|
1572 |
buildActionMask = 2147483647;
|
|
1573 |
files = (
|
|
1574 |
BA222ADF0DC882A5001A17F4 /* JackNetDriver.h in Headers */,
|
|
1575 |
- 4B76C76B0E5AB2DB00E2AC21 /* JackNetInterface.h in Headers */,
|
|
1576 |
- 4BC3B6BC0E703BCC0066E42F /* JackNetUnixSocket.h in Headers */,
|
|
1577 |
);
|
|
1578 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1579 |
};
|
|
1580 |
@@ -4020,9 +4017,6 @@
|
|
1581 |
buildActionMask = 2147483647;
|
|
1582 |
files = (
|
|
1583 |
BA222AEE0DC883B3001A17F4 /* JackNetManager.h in Headers */,
|
|
1584 |
- 4B76C76D0E5AB2DB00E2AC21 /* JackNetInterface.h in Headers */,
|
|
1585 |
- 4BC3B6BE0E703BCC0066E42F /* JackNetUnixSocket.h in Headers */,
|
|
1586 |
- 4BF284190F31B4BC00B05BE3 /* JackArgParser.h in Headers */,
|
|
1587 |
);
|
|
1588 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1589 |
};
|
|
1590 |
@@ -6425,6 +6419,8 @@
|
|
1591 |
4BDCDC091001FDA800B15929 /* JackArgParser.cpp in Sources */,
|
|
1592 |
4BCBCE6110C4FE3F00450FFE /* JackPhysicalMidiInput.cpp in Sources */,
|
|
1593 |
4BCBCE6310C4FE3F00450FFE /* JackPhysicalMidiOutput.cpp in Sources */,
|
|
1594 |
+ 4BC2CA59113C6CB60076717C /* JackNetInterface.cpp in Sources */,
|
|
1595 |
+ 4BC2CA5B113C6CBE0076717C /* JackNetUnixSocket.cpp in Sources */,
|
|
1596 |
);
|
|
1597 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1598 |
};
|
|
1599 |
@@ -6751,9 +6747,7 @@
|
|
1600 |
4B5E08CD0E5B66EE00BEE4E0 /* JackLibSampleRateResampler.cpp in Sources */,
|
|
1601 |
4B5E08CE0E5B66EE00BEE4E0 /* JackResampler.cpp in Sources */,
|
|
1602 |
4B5E08E10E5B676C00BEE4E0 /* JackNetAdapter.cpp in Sources */,
|
|
1603 |
- 4B5E08EB0E5B67EA00BEE4E0 /* JackNetInterface.cpp in Sources */,
|
|
1604 |
4B5E08EE0E5B680200BEE4E0 /* JackAudioAdapter.cpp in Sources */,
|
|
1605 |
- 4BC3B6BF0E703BCC0066E42F /* JackNetUnixSocket.cpp in Sources */,
|
|
1606 |
);
|
|
1607 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1608 |
};
|
|
1609 |
@@ -6863,6 +6857,8 @@
|
|
1610 |
4BF339230F8B873E0080FB5B /* JackMidiDriver.cpp in Sources */,
|
|
1611 |
4BCBCE5D10C4FE3F00450FFE /* JackPhysicalMidiInput.cpp in Sources */,
|
|
1612 |
4BCBCE5F10C4FE3F00450FFE /* JackPhysicalMidiOutput.cpp in Sources */,
|
|
1613 |
+ 4BC2CA55113C6C930076717C /* JackNetInterface.cpp in Sources */,
|
|
1614 |
+ 4BC2CA57113C6C9B0076717C /* JackNetUnixSocket.cpp in Sources */,
|
|
1615 |
);
|
|
1616 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1617 |
};
|
|
1618 |
@@ -7043,6 +7039,8 @@
|
|
1619 |
4BA339A410B2E36800190E3B /* JackArgParser.cpp in Sources */,
|
|
1620 |
4BCBCE6510C4FE3F00450FFE /* JackPhysicalMidiInput.cpp in Sources */,
|
|
1621 |
4BCBCE6710C4FE3F00450FFE /* JackPhysicalMidiOutput.cpp in Sources */,
|
|
1622 |
+ 4BC2CA5D113C6CC90076717C /* JackNetInterface.cpp in Sources */,
|
|
1623 |
+ 4BC2CA5F113C6CD10076717C /* JackNetUnixSocket.cpp in Sources */,
|
|
1624 |
);
|
|
1625 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1626 |
};
|
|
1627 |
@@ -7091,8 +7089,6 @@
|
|
1628 |
buildActionMask = 2147483647;
|
|
1629 |
files = (
|
|
1630 |
4BDCDBBD1001FCC000B15929 /* JackNetDriver.cpp in Sources */,
|
|
1631 |
- 4BDCDBBE1001FCC000B15929 /* JackNetInterface.cpp in Sources */,
|
|
1632 |
- 4BDCDBBF1001FCC000B15929 /* JackNetUnixSocket.cpp in Sources */,
|
|
1633 |
);
|
|
1634 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1635 |
};
|
|
1636 |
@@ -7101,10 +7097,6 @@
|
|
1637 |
buildActionMask = 2147483647;
|
|
1638 |
files = (
|
|
1639 |
4BDCDBDE1001FD2D00B15929 /* JackNetManager.cpp in Sources */,
|
|
1640 |
- 4BDCDBDF1001FD2D00B15929 /* JackNetInterface.cpp in Sources */,
|
|
1641 |
- 4BDCDBE01001FD2D00B15929 /* JackNetUnixSocket.cpp in Sources */,
|
|
1642 |
- 4BDCDBE11001FD2D00B15929 /* JackMachTime.c in Sources */,
|
|
1643 |
- 4BDCDBE21001FD2D00B15929 /* JackArgParser.cpp in Sources */,
|
|
1644 |
);
|
|
1645 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1646 |
};
|
|
1647 |
@@ -7129,9 +7121,7 @@
|
|
1648 |
4BDCDC1A1001FDE300B15929 /* JackLibSampleRateResampler.cpp in Sources */,
|
|
1649 |
4BDCDC1B1001FDE300B15929 /* JackResampler.cpp in Sources */,
|
|
1650 |
4BDCDC1C1001FDE300B15929 /* JackNetAdapter.cpp in Sources */,
|
|
1651 |
- 4BDCDC1D1001FDE300B15929 /* JackNetInterface.cpp in Sources */,
|
|
1652 |
4BDCDC1E1001FDE300B15929 /* JackAudioAdapter.cpp in Sources */,
|
|
1653 |
- 4BDCDC1F1001FDE300B15929 /* JackNetUnixSocket.cpp in Sources */,
|
|
1654 |
);
|
|
1655 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1656 |
};
|
|
1657 |
@@ -7228,8 +7218,6 @@
|
|
1658 |
buildActionMask = 2147483647;
|
|
1659 |
files = (
|
|
1660 |
BA222ADE0DC882A5001A17F4 /* JackNetDriver.cpp in Sources */,
|
|
1661 |
- 4B76C76A0E5AB2DB00E2AC21 /* JackNetInterface.cpp in Sources */,
|
|
1662 |
- 4BC3B6BB0E703BCC0066E42F /* JackNetUnixSocket.cpp in Sources */,
|
|
1663 |
);
|
|
1664 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1665 |
};
|
|
1666 |
@@ -7238,10 +7226,6 @@
|
|
1667 |
buildActionMask = 2147483647;
|
|
1668 |
files = (
|
|
1669 |
BA222AED0DC883B3001A17F4 /* JackNetManager.cpp in Sources */,
|
|
1670 |
- 4B76C76C0E5AB2DB00E2AC21 /* JackNetInterface.cpp in Sources */,
|
|
1671 |
- 4BC3B6BD0E703BCC0066E42F /* JackNetUnixSocket.cpp in Sources */,
|
|
1672 |
- 4BF5FBC90E878D24003D2374 /* JackMachTime.c in Sources */,
|
|
1673 |
- 4BF284180F31B4BC00B05BE3 /* JackArgParser.cpp in Sources */,
|
|
1674 |
);
|
|
1675 |
runOnlyForDeploymentPostprocessing = 0;
|
|
1676 |
};
|
|
1677 |
@@ -7966,16 +7950,17 @@
|
|
1678 |
LIBRARY_STYLE = DYNAMIC;
|
|
1679 |
MACH_O_TYPE = mh_dylib;
|
|
1680 |
OTHER_CFLAGS = "";
|
|
1681 |
- OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA";
|
|
1682 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1683 |
+ "-DHAVE_CELT_API_0_7",
|
|
1684 |
+ "-DHAVE_CELT",
|
|
1685 |
+ "-DMACH_RPC_MACH_SEMA",
|
|
1686 |
+ );
|
|
1687 |
OTHER_LDFLAGS = (
|
|
1688 |
+ libcelt.a,
|
|
1689 |
"-framework",
|
|
1690 |
Jackservermp,
|
|
1691 |
"-framework",
|
|
1692 |
- CoreAudio,
|
|
1693 |
- "-framework",
|
|
1694 |
CoreServices,
|
|
1695 |
- "-framework",
|
|
1696 |
- AudioUnit,
|
|
1697 |
);
|
|
1698 |
OTHER_REZFLAGS = "";
|
|
1699 |
PREBINDING = NO;
|
|
1700 |
@@ -8016,8 +8001,13 @@
|
|
1701 |
MACH_O_TYPE = mh_dylib;
|
|
1702 |
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
|
1703 |
OTHER_CFLAGS = "";
|
|
1704 |
- OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA";
|
|
1705 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1706 |
+ "-DHAVE_CELT_API_0_7",
|
|
1707 |
+ "-DHAVE_CELT",
|
|
1708 |
+ "-DMACH_RPC_MACH_SEMA",
|
|
1709 |
+ );
|
|
1710 |
OTHER_LDFLAGS = (
|
|
1711 |
+ libcelt.a,
|
|
1712 |
"-framework",
|
|
1713 |
Jackservermp,
|
|
1714 |
"-framework",
|
|
1715 |
@@ -8053,7 +8043,11 @@
|
|
1716 |
LIBRARY_STYLE = DYNAMIC;
|
|
1717 |
MACH_O_TYPE = mh_dylib;
|
|
1718 |
OTHER_CFLAGS = "";
|
|
1719 |
- OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA";
|
|
1720 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1721 |
+ "-DHAVE_CELT_API_0_7",
|
|
1722 |
+ "-DHAVE_CELT",
|
|
1723 |
+ "-DMACH_RPC_MACH_SEMA",
|
|
1724 |
+ );
|
|
1725 |
OTHER_LDFLAGS = (
|
|
1726 |
"-framework",
|
|
1727 |
Jackdmp,
|
|
1728 |
@@ -8103,17 +8097,19 @@
|
|
1729 |
INSTALL_PATH = /usr/local/lib;
|
|
1730 |
LIBRARY_STYLE = DYNAMIC;
|
|
1731 |
MACH_O_TYPE = mh_dylib;
|
|
1732 |
- OTHER_CFLAGS = "";
|
|
1733 |
- OTHER_CPLUSPLUSFLAGS = "-DMACH_RPC_MACH_SEMA";
|
|
1734 |
+ OTHER_CFLAGS = "-DJACK_32_64";
|
|
1735 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1736 |
+ "-DJACK_32_64",
|
|
1737 |
+ "-DHAVE_CELT",
|
|
1738 |
+ "-DHAVE_CELT_API_0_7",
|
|
1739 |
+ "-DMACH_RPC_MACH_SEMA",
|
|
1740 |
+ );
|
|
1741 |
OTHER_LDFLAGS = (
|
|
1742 |
+ libcelt.a,
|
|
1743 |
"-framework",
|
|
1744 |
Jackservermp,
|
|
1745 |
"-framework",
|
|
1746 |
- CoreAudio,
|
|
1747 |
- "-framework",
|
|
1748 |
CoreServices,
|
|
1749 |
- "-framework",
|
|
1750 |
- AudioUnit,
|
|
1751 |
);
|
|
1752 |
OTHER_REZFLAGS = "";
|
|
1753 |
PREBINDING = NO;
|
|
1754 |
@@ -8153,10 +8149,13 @@
|
|
1755 |
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
|
1756 |
OTHER_CFLAGS = "-DJACK_32_64";
|
|
1757 |
OTHER_CPLUSPLUSFLAGS = (
|
|
1758 |
+ "-DHAVE_CELT",
|
|
1759 |
+ "-DHAVE_CELT_API_0_7",
|
|
1760 |
"-DMACH_RPC_MACH_SEMA",
|
|
1761 |
"-DJACK_32_64",
|
|
1762 |
);
|
|
1763 |
OTHER_LDFLAGS = (
|
|
1764 |
+ libcelt.a,
|
|
1765 |
"-framework",
|
|
1766 |
Jackservermp,
|
|
1767 |
"-framework",
|
|
1768 |
@@ -8232,8 +8231,17 @@
|
|
1769 |
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
|
1770 |
GCC_OPTIMIZATION_LEVEL = 0;
|
|
1771 |
HEADER_SEARCH_PATHS = ../common;
|
|
1772 |
- OTHER_CFLAGS = "";
|
|
1773 |
+ OTHER_CFLAGS = (
|
|
1774 |
+ "-DHAVE_CELT",
|
|
1775 |
+ "-DHAVE_CELT_API_0_7",
|
|
1776 |
+ );
|
|
1777 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1778 |
+ "-DHAVE_CELT",
|
|
1779 |
+ "-DHAVE_CELT_API_0_7",
|
|
1780 |
+ "$(OTHER_CFLAGS)",
|
|
1781 |
+ );
|
|
1782 |
OTHER_LDFLAGS = (
|
|
1783 |
+ libcelt.a,
|
|
1784 |
"-framework",
|
|
1785 |
Jackmp,
|
|
1786 |
"-framework",
|
|
1787 |
@@ -8265,8 +8273,17 @@
|
|
1788 |
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
|
1789 |
HEADER_SEARCH_PATHS = ../common;
|
|
1790 |
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
|
1791 |
- OTHER_CFLAGS = "";
|
|
1792 |
+ OTHER_CFLAGS = (
|
|
1793 |
+ "-DHAVE_CELT",
|
|
1794 |
+ "-DHAVE_CELT_API_0_7",
|
|
1795 |
+ );
|
|
1796 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1797 |
+ "-DHAVE_CELT",
|
|
1798 |
+ "-DHAVE_CELT_API_0_7",
|
|
1799 |
+ "$(OTHER_CFLAGS)",
|
|
1800 |
+ );
|
|
1801 |
OTHER_LDFLAGS = (
|
|
1802 |
+ libcelt.a,
|
|
1803 |
"-framework",
|
|
1804 |
Jackmp,
|
|
1805 |
"-framework",
|
|
1806 |
@@ -8296,6 +8313,11 @@
|
|
1807 |
FRAMEWORK_SEARCH_PATHS = "";
|
|
1808 |
HEADER_SEARCH_PATHS = ../common;
|
|
1809 |
OTHER_CFLAGS = "";
|
|
1810 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1811 |
+ "-DHAVE_CELT",
|
|
1812 |
+ "-DHAVE_CELT_API_0_7",
|
|
1813 |
+ "$(OTHER_CFLAGS)",
|
|
1814 |
+ );
|
|
1815 |
OTHER_LDFLAGS = (
|
|
1816 |
"-framework",
|
|
1817 |
Jackmp,
|
|
1818 |
@@ -8327,8 +8349,13 @@
|
|
1819 |
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
|
1820 |
GCC_OPTIMIZATION_LEVEL = 0;
|
|
1821 |
HEADER_SEARCH_PATHS = ../common;
|
|
1822 |
- OTHER_CFLAGS = "";
|
|
1823 |
+ OTHER_CFLAGS = (
|
|
1824 |
+ "-DHAVE_CELT",
|
|
1825 |
+ "-DHAVE_CELT_API_0_7",
|
|
1826 |
+ );
|
|
1827 |
+ OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
|
|
1828 |
OTHER_LDFLAGS = (
|
|
1829 |
+ libcelt.a,
|
|
1830 |
"-framework",
|
|
1831 |
Jackmp,
|
|
1832 |
"-framework",
|
|
1833 |
@@ -8358,8 +8385,13 @@
|
|
1834 |
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
|
1835 |
HEADER_SEARCH_PATHS = ../common;
|
|
1836 |
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
|
1837 |
- OTHER_CFLAGS = "";
|
|
1838 |
+ OTHER_CFLAGS = (
|
|
1839 |
+ "-DHAVE_CELT",
|
|
1840 |
+ "-DHAVE_CELT_API_0_7",
|
|
1841 |
+ );
|
|
1842 |
+ OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
|
|
1843 |
OTHER_LDFLAGS = (
|
|
1844 |
+ libcelt.a,
|
|
1845 |
"-framework",
|
|
1846 |
Jackmp,
|
|
1847 |
"-framework",
|
|
1848 |
@@ -8388,7 +8420,15 @@
|
|
1849 |
);
|
|
1850 |
FRAMEWORK_SEARCH_PATHS = "";
|
|
1851 |
HEADER_SEARCH_PATHS = ../common;
|
|
1852 |
- OTHER_CFLAGS = "";
|
|
1853 |
+ OTHER_CFLAGS = (
|
|
1854 |
+ "-DHAVE_CELT",
|
|
1855 |
+ "-DHAVE_CELT_API_0_7",
|
|
1856 |
+ );
|
|
1857 |
+ OTHER_CPLUSPLUSFLAGS = (
|
|
1858 |
+ "-DHAVE_CELT",
|
|
1859 |
+ "-DHAVE_CELT_API_0_7",
|
|
1860 |
+ "$(OTHER_CFLAGS)",
|
|
1861 |
+ );
|
|
1862 |
OTHER_LDFLAGS = (
|
|
1863 |
"-framework",
|
|
1864 |
Jackmp,
|
|
1865 |
--- a/macosx/coreaudio/JackCoreAudioAdapter.cpp
|
|
1866 |
+++ b/macosx/coreaudio/JackCoreAudioAdapter.cpp
|
|
1867 |
@@ -545,10 +545,23 @@
|
|
1868 |
|
|
1869 |
// Creates aggregate device
|
|
1870 |
AudioDeviceID captureID, playbackID;
|
|
1871 |
- if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr)
|
|
1872 |
- return -1;
|
|
1873 |
- if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr)
|
|
1874 |
- return -1;
|
|
1875 |
+
|
|
1876 |
+ if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr) {
|
|
1877 |
+ jack_log("Will take default input");
|
|
1878 |
+ if (GetDefaultInputDevice(&captureID) != noErr) {
|
|
1879 |
+ jack_error("Cannot open default input device");
|
|
1880 |
+ return -1;
|
|
1881 |
+ }
|
|
1882 |
+ }
|
|
1883 |
+
|
|
1884 |
+ if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr) {
|
|
1885 |
+ jack_log("Will take default output");
|
|
1886 |
+ if (GetDefaultOutputDevice(&playbackID) != noErr) {
|
|
1887 |
+ jack_error("Cannot open default output device");
|
|
1888 |
+ return -1;
|
|
1889 |
+ }
|
|
1890 |
+ }
|
|
1891 |
+
|
|
1892 |
if (CreateAggregateDevice(captureID, playbackID, samplerate, &fDeviceID) != noErr)
|
|
1893 |
return -1;
|
|
1894 |
}
|
|
1895 |
@@ -558,7 +571,7 @@
|
|
1896 |
jack_log("JackCoreAudioAdapter::Open capture only");
|
|
1897 |
if (GetDeviceIDFromUID(capture_driver_uid, &fDeviceID) != noErr) {
|
|
1898 |
if (GetDefaultInputDevice(&fDeviceID) != noErr) {
|
|
1899 |
- jack_error("Cannot open default device");
|
|
1900 |
+ jack_error("Cannot open default input device");
|
|
1901 |
return -1;
|
|
1902 |
}
|
|
1903 |
}
|
|
1904 |
@@ -572,7 +585,7 @@
|
|
1905 |
jack_log("JackCoreAudioAdapter::Open playback only");
|
|
1906 |
if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
|
|
1907 |
if (GetDefaultOutputDevice(&fDeviceID) != noErr) {
|
|
1908 |
- jack_error("Cannot open default device");
|
|
1909 |
+ jack_error("Cannot open default output device");
|
|
1910 |
return -1;
|
|
1911 |
}
|
|
1912 |
}
|
|
1913 |
@@ -583,14 +596,31 @@
|
|
1914 |
|
|
1915 |
// Use default driver in duplex mode
|
|
1916 |
} else {
|
|
1917 |
- jack_log("JackCoreAudioAdapter::Open default driver");
|
|
1918 |
+ jack_log("JackCoreAudioDriver::Open default driver");
|
|
1919 |
if (GetDefaultDevice(&fDeviceID) != noErr) {
|
|
1920 |
- jack_error("Cannot open default device");
|
|
1921 |
- return -1;
|
|
1922 |
- }
|
|
1923 |
- if (GetDeviceNameFromID(fDeviceID, capture_driver_name) != noErr || GetDeviceNameFromID(fDeviceID, playback_driver_name) != noErr) {
|
|
1924 |
- jack_error("Cannot get device name from device ID");
|
|
1925 |
- return -1;
|
|
1926 |
+ jack_error("Cannot open default device in duplex mode, so aggregate default input and default output");
|
|
1927 |
+
|
|
1928 |
+ // Creates aggregate device
|
|
1929 |
+ AudioDeviceID captureID, playbackID;
|
|
1930 |
+
|
|
1931 |
+ if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr) {
|
|
1932 |
+ jack_log("Will take default input");
|
|
1933 |
+ if (GetDefaultInputDevice(&captureID) != noErr) {
|
|
1934 |
+ jack_error("Cannot open default input device");
|
|
1935 |
+ return -1;
|
|
1936 |
+ }
|
|
1937 |
+ }
|
|
1938 |
+
|
|
1939 |
+ if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr) {
|
|
1940 |
+ jack_log("Will take default output");
|
|
1941 |
+ if (GetDefaultOutputDevice(&playbackID) != noErr) {
|
|
1942 |
+ jack_error("Cannot open default output device");
|
|
1943 |
+ return -1;
|
|
1944 |
+ }
|
|
1945 |
+ }
|
|
1946 |
+
|
|
1947 |
+ if (CreateAggregateDevice(captureID, playbackID, samplerate, &fDeviceID) != noErr)
|
|
1948 |
+ return -1;
|
|
1949 |
}
|
|
1950 |
}
|
|
1951 |
|
|
1952 |
--- a/macosx/coreaudio/JackCoreAudioDriver.cpp
|
|
1953 |
+++ b/macosx/coreaudio/JackCoreAudioDriver.cpp
|
|
1954 |
@@ -922,7 +922,7 @@
|
|
1955 |
if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr) {
|
|
1956 |
jack_log("Will take default input");
|
|
1957 |
if (GetDefaultInputDevice(&captureID) != noErr) {
|
|
1958 |
- jack_error("Cannot open default device");
|
|
1959 |
+ jack_error("Cannot open default input device");
|
|
1960 |
return -1;
|
|
1961 |
}
|
|
1962 |
}
|
|
1963 |
@@ -930,7 +930,7 @@
|
|
1964 |
if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr) {
|
|
1965 |
jack_log("Will take default output");
|
|
1966 |
if (GetDefaultOutputDevice(&playbackID) != noErr) {
|
|
1967 |
- jack_error("Cannot open default device");
|
|
1968 |
+ jack_error("Cannot open default output device");
|
|
1969 |
return -1;
|
|
1970 |
}
|
|
1971 |
}
|
|
1972 |
@@ -945,7 +945,7 @@
|
|
1973 |
if (GetDeviceIDFromUID(capture_driver_uid, &fDeviceID) != noErr) {
|
|
1974 |
jack_log("Will take default input");
|
|
1975 |
if (GetDefaultInputDevice(&fDeviceID) != noErr) {
|
|
1976 |
- jack_error("Cannot open default device");
|
|
1977 |
+ jack_error("Cannot open default input device");
|
|
1978 |
return -1;
|
|
1979 |
}
|
|
1980 |
}
|
|
1981 |
@@ -960,7 +960,7 @@
|
|
1982 |
if (GetDeviceIDFromUID(playback_driver_uid, &fDeviceID) != noErr) {
|
|
1983 |
jack_log("Will take default output");
|
|
1984 |
if (GetDefaultOutputDevice(&fDeviceID) != noErr) {
|
|
1985 |
- jack_error("Cannot open default device");
|
|
1986 |
+ jack_error("Cannot open default output device");
|
|
1987 |
return -1;
|
|
1988 |
}
|
|
1989 |
}
|
|
1990 |
@@ -973,12 +973,29 @@
|
|
1991 |
} else {
|
|
1992 |
jack_log("JackCoreAudioDriver::Open default driver");
|
|
1993 |
if (GetDefaultDevice(&fDeviceID) != noErr) {
|
|
1994 |
- jack_error("Cannot open default device");
|
|
1995 |
- return -1;
|
|
1996 |
- }
|
|
1997 |
- if (GetDeviceNameFromID(fDeviceID, capture_driver_name) != noErr || GetDeviceNameFromID(fDeviceID, playback_driver_name) != noErr) {
|
|
1998 |
- jack_error("Cannot get device name from device ID");
|
|
1999 |
- return -1;
|
|
2000 |
+ jack_error("Cannot open default device in duplex mode, so aggregate default input and default output");
|
|
2001 |
+
|
|
2002 |
+ // Creates aggregate device
|
|
2003 |
+ AudioDeviceID captureID, playbackID;
|
|
2004 |
+
|
|
2005 |
+ if (GetDeviceIDFromUID(capture_driver_uid, &captureID) != noErr) {
|
|
2006 |
+ jack_log("Will take default input");
|
|
2007 |
+ if (GetDefaultInputDevice(&captureID) != noErr) {
|
|
2008 |
+ jack_error("Cannot open default input device");
|
|
2009 |
+ return -1;
|
|
2010 |
+ }
|
|
2011 |
+ }
|
|
2012 |
+
|
|
2013 |
+ if (GetDeviceIDFromUID(playback_driver_uid, &playbackID) != noErr) {
|
|
2014 |
+ jack_log("Will take default output");
|
|
2015 |
+ if (GetDefaultOutputDevice(&playbackID) != noErr) {
|
|
2016 |
+ jack_error("Cannot open default output device");
|
|
2017 |
+ return -1;
|
|
2018 |
+ }
|
|
2019 |
+ }
|
|
2020 |
+
|
|
2021 |
+ if (CreateAggregateDevice(captureID, playbackID, samplerate, &fDeviceID) != noErr)
|
|
2022 |
+ return -1;
|
|
2023 |
}
|
|
2024 |
}
|
|
2025 |
|
|
2026 |
@@ -1985,8 +2002,8 @@
|
|
2027 |
switch (param->character) {
|
|
2028 |
|
|
2029 |
case 'd':
|
|
2030 |
- capture_driver_uid = strdup(param->value.str);
|
|
2031 |
- playback_driver_uid = strdup(param->value.str);
|
|
2032 |
+ capture_driver_uid = param->value.str;
|
|
2033 |
+ playback_driver_uid = param->value.str;
|
|
2034 |
break;
|
|
2035 |
|
|
2036 |
case 'D':
|
|
2037 |
@@ -2009,14 +2026,14 @@
|
|
2038 |
case 'C':
|
|
2039 |
capture = true;
|
|
2040 |
if (strcmp(param->value.str, "none") != 0) {
|
|
2041 |
- capture_driver_uid = strdup(param->value.str);
|
|
2042 |
+ capture_driver_uid = param->value.str;
|
|
2043 |
}
|
|
2044 |
break;
|
|
2045 |
|
|
2046 |
case 'P':
|
|
2047 |
playback = true;
|
|
2048 |
if (strcmp(param->value.str, "none") != 0) {
|
|
2049 |
- playback_driver_uid = strdup(param->value.str);
|
|
2050 |
+ playback_driver_uid = param->value.str;
|
|
2051 |
}
|
|
2052 |
break;
|
|
2053 |
|
|
2054 |
--- a/posix/JackNetUnixSocket.cpp
|
|
2055 |
+++ b/posix/JackNetUnixSocket.cpp
|
|
2056 |
@@ -99,6 +99,13 @@
|
|
2057 |
Reset();
|
|
2058 |
}
|
|
2059 |
fSockfd = socket ( AF_INET, SOCK_DGRAM, 0 );
|
|
2060 |
+
|
|
2061 |
+ /* Enable address reuse */
|
|
2062 |
+ int res, on = 1;
|
|
2063 |
+ if ((res = setsockopt( fSockfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))) < 0) {
|
|
2064 |
+ StrError(NET_ERROR_CODE);
|
|
2065 |
+ }
|
|
2066 |
+
|
|
2067 |
return fSockfd;
|
|
2068 |
}
|
|
2069 |
|
|
2070 |
--- a/solaris/oss/JackBoomerDriver.cpp
|
|
2071 |
+++ b/solaris/oss/JackBoomerDriver.cpp
|
|
2072 |
@@ -985,20 +985,20 @@
|
|
2073 |
case 'C':
|
|
2074 |
capture = true;
|
|
2075 |
if (strcmp(param->value.str, "none") != 0) {
|
|
2076 |
- capture_pcm_name = strdup(param->value.str);
|
|
2077 |
+ capture_pcm_name = param->value.str;
|
|
2078 |
}
|
|
2079 |
break;
|
|
2080 |
|
|
2081 |
case 'P':
|
|
2082 |
playback = true;
|
|
2083 |
if (strcmp(param->value.str, "none") != 0) {
|
|
2084 |
- playback_pcm_name = strdup(param->value.str);
|
|
2085 |
+ playback_pcm_name = param->value.str;
|
|
2086 |
}
|
|
2087 |
break;
|
|
2088 |
|
|
2089 |
case 'd':
|
|
2090 |
- playback_pcm_name = strdup (param->value.str);
|
|
2091 |
- capture_pcm_name = strdup (param->value.str);
|
|
2092 |
+ playback_pcm_name = param->value.str;
|
|
2093 |
+ capture_pcm_name = param->value.str;
|
|
2094 |
break;
|
|
2095 |
|
|
2096 |
case 'e':
|
|
2097 |
--- a/solaris/oss/JackOSSDriver.cpp
|
|
2098 |
+++ b/solaris/oss/JackOSSDriver.cpp
|
|
2099 |
@@ -904,20 +904,20 @@
|
|
2100 |
case 'C':
|
|
2101 |
capture = true;
|
|
2102 |
if (strcmp(param->value.str, "none") != 0) {
|
|
2103 |
- capture_pcm_name = strdup(param->value.str);
|
|
2104 |
+ capture_pcm_name = param->value.str;
|
|
2105 |
}
|
|
2106 |
break;
|
|
2107 |
|
|
2108 |
case 'P':
|
|
2109 |
playback = true;
|
|
2110 |
if (strcmp(param->value.str, "none") != 0) {
|
|
2111 |
- playback_pcm_name = strdup(param->value.str);
|
|
2112 |
+ playback_pcm_name = param->value.str;
|
|
2113 |
}
|
|
2114 |
break;
|
|
2115 |
|
|
2116 |
case 'd':
|
|
2117 |
- playback_pcm_name = strdup (param->value.str);
|
|
2118 |
- capture_pcm_name = strdup (param->value.str);
|
|
2119 |
+ playback_pcm_name = param->value.str;
|
|
2120 |
+ capture_pcm_name = param->value.str;
|
|
2121 |
break;
|
|
2122 |
|
|
2123 |
case 'b':
|
|
2124 |
--- a/tests/external_metro.cpp
|
|
2125 |
+++ b/tests/external_metro.cpp
|
|
2126 |
@@ -60,7 +60,6 @@
|
|
2127 |
{
|
|
2128 |
sample_t scale;
|
|
2129 |
int i, attack_length, decay_length;
|
|
2130 |
- double *amp;
|
|
2131 |
int attack_percent = 1, decay_percent = 10;
|
|
2132 |
const char *bpm_string = "bpm";
|
|
2133 |
jack_options_t options = JackNullOption;
|
|
2134 |
@@ -131,6 +130,8 @@
|
|
2135 |
jack_port_unregister(client, input_port);
|
|
2136 |
jack_port_unregister(client, output_port);
|
|
2137 |
jack_client_close(client);
|
|
2138 |
+ free(amp);
|
|
2139 |
+ free(wave);
|
|
2140 |
}
|
|
2141 |
|
|
2142 |
int main (int argc, char *argv[])
|
|
2143 |
--- a/tests/external_metro.h
|
|
2144 |
+++ b/tests/external_metro.h
|
|
2145 |
@@ -53,6 +53,7 @@
|
|
2146 |
int bpm;
|
|
2147 |
jack_nframes_t tone_length, wave_length;
|
|
2148 |
sample_t *wave;
|
|
2149 |
+ double *amp;
|
|
2150 |
long offset ;
|
|
2151 |
|
|
2152 |
ExternalMetro(int freq, double max_amp, int dur_arg, int bpm, const char* client_name = "metro");
|
|
2153 |
--- a/windows/JackCompilerDeps_os.h
|
|
2154 |
+++ b/windows/JackCompilerDeps_os.h
|
|
2155 |
@@ -1,21 +1,22 @@
|
|
2156 |
/*
|
|
2157 |
-Copyright (C) 2004-2005 Grame
|
|
2158 |
+ Copyright (C) 2004-2008 Grame
|
|
2159 |
+
|
|
2160 |
+ This program is free software; you can redistribute it and/or modify
|
|
2161 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2162 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2163 |
+ (at your option) any later version.
|
|
2164 |
+
|
|
2165 |
+ This program is distributed in the hope that it will be useful,
|
|
2166 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2167 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2168 |
+ GNU Lesser General Public License for more details.
|
|
2169 |
+
|
|
2170 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2171 |
+ along with this program; if not, write to the Free Software
|
|
2172 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2173 |
+
|
|
2174 |
+ */
|
|
2175 |
|
|
2176 |
-This program is free software; you can redistribute it and/or modify
|
|
2177 |
-it under the terms of the GNU General Public License as published by
|
|
2178 |
-the Free Software Foundation; either version 2 of the License, or
|
|
2179 |
-(at your option) any later version.
|
|
2180 |
-
|
|
2181 |
-This program is distributed in the hope that it will be useful,
|
|
2182 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2183 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2184 |
-GNU General Public License for more details.
|
|
2185 |
-
|
|
2186 |
-You should have received a copy of the GNU General Public License
|
|
2187 |
-along with this program; if not, write to the Free Software
|
|
2188 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2189 |
-
|
|
2190 |
-*/
|
|
2191 |
|
|
2192 |
#ifndef __JackCompilerDeps_WIN32__
|
|
2193 |
#define __JackCompilerDeps_WIN32__
|
|
2194 |
--- a/windows/JackNetWinSocket.cpp
|
|
2195 |
+++ b/windows/JackNetWinSocket.cpp
|
|
2196 |
@@ -1,21 +1,22 @@
|
|
2197 |
/*
|
|
2198 |
-Copyright (C) 2008 Romain Moret at Grame
|
|
2199 |
+ Copyright (C) 2004-2008 Grame
|
|
2200 |
+
|
|
2201 |
+ This program is free software; you can redistribute it and/or modify
|
|
2202 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2203 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2204 |
+ (at your option) any later version.
|
|
2205 |
+
|
|
2206 |
+ This program is distributed in the hope that it will be useful,
|
|
2207 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2208 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2209 |
+ GNU Lesser General Public License for more details.
|
|
2210 |
+
|
|
2211 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2212 |
+ along with this program; if not, write to the Free Software
|
|
2213 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2214 |
+
|
|
2215 |
+ */
|
|
2216 |
|
|
2217 |
-This program is free software; you can redistribute it and/or modify
|
|
2218 |
-it under the terms of the GNU General Public License as published by
|
|
2219 |
-the Free Software Foundation; either version 2 of the License, or
|
|
2220 |
-(at your option) any later version.
|
|
2221 |
-
|
|
2222 |
-This program is distributed in the hope that it will be useful,
|
|
2223 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2224 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2225 |
-GNU General Public License for more details.
|
|
2226 |
-
|
|
2227 |
-You should have received a copy of the GNU General Public License
|
|
2228 |
-along with this program; if not, write to the Free Software
|
|
2229 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2230 |
-
|
|
2231 |
-*/
|
|
2232 |
|
|
2233 |
#include "JackNetWinSocket.h"
|
|
2234 |
|
|
2235 |
--- a/windows/JackNetWinSocket.h
|
|
2236 |
+++ b/windows/JackNetWinSocket.h
|
|
2237 |
@@ -1,21 +1,21 @@
|
|
2238 |
/*
|
|
2239 |
-Copyright (C) 2008 Romain Moret at Grame
|
|
2240 |
-
|
|
2241 |
-This program is free software; you can redistribute it and/or modify
|
|
2242 |
-it under the terms of the GNU General Public License as published by
|
|
2243 |
-the Free Software Foundation; either version 2 of the License, or
|
|
2244 |
-(at your option) any later version.
|
|
2245 |
-
|
|
2246 |
-This program is distributed in the hope that it will be useful,
|
|
2247 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2248 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2249 |
-GNU General Public License for more details.
|
|
2250 |
-
|
|
2251 |
-You should have received a copy of the GNU General Public License
|
|
2252 |
-along with this program; if not, write to the Free Software
|
|
2253 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2254 |
-
|
|
2255 |
-*/
|
|
2256 |
+ Copyright (C) 2004-2008 Grame
|
|
2257 |
+
|
|
2258 |
+ This program is free software; you can redistribute it and/or modify
|
|
2259 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2260 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2261 |
+ (at your option) any later version.
|
|
2262 |
+
|
|
2263 |
+ This program is distributed in the hope that it will be useful,
|
|
2264 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2265 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2266 |
+ GNU Lesser General Public License for more details.
|
|
2267 |
+
|
|
2268 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2269 |
+ along with this program; if not, write to the Free Software
|
|
2270 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2271 |
+
|
|
2272 |
+ */
|
|
2273 |
|
|
2274 |
#ifndef __JackNetWinSocket__
|
|
2275 |
#define __JackNetWinSocket__
|
|
2276 |
--- a/windows/JackPlatformPlug_os.h
|
|
2277 |
+++ b/windows/JackPlatformPlug_os.h
|
|
2278 |
@@ -1,25 +1,30 @@
|
|
2279 |
/*
|
|
2280 |
-Copyright (C) 2004-2008 Grame
|
|
2281 |
+ Copyright (C) 2004-2008 Grame
|
|
2282 |
+
|
|
2283 |
+ This program is free software; you can redistribute it and/or modify
|
|
2284 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2285 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2286 |
+ (at your option) any later version.
|
|
2287 |
+
|
|
2288 |
+ This program is distributed in the hope that it will be useful,
|
|
2289 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2290 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2291 |
+ GNU Lesser General Public License for more details.
|
|
2292 |
+
|
|
2293 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2294 |
+ along with this program; if not, write to the Free Software
|
|
2295 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2296 |
+
|
|
2297 |
+ */
|
|
2298 |
|
|
2299 |
-This program is free software; you can redistribute it and/or modify
|
|
2300 |
-it under the terms of the GNU Lesser General Public License as published by
|
|
2301 |
-the Free Software Foundation; either version 2.1 of the License, or
|
|
2302 |
-(at your option) any later version.
|
|
2303 |
-
|
|
2304 |
-This program is distributed in the hope that it will be useful,
|
|
2305 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2306 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2307 |
-GNU Lesser General Public License for more details.
|
|
2308 |
-
|
|
2309 |
-You should have received a copy of the GNU Lesser General Public License
|
|
2310 |
-along with this program; if not, write to the Free Software
|
|
2311 |
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2312 |
-
|
|
2313 |
-*/
|
|
2314 |
|
|
2315 |
#ifndef __JackPlatformPlug_WIN32__
|
|
2316 |
#define __JackPlatformPlug_WIN32__
|
|
2317 |
|
|
2318 |
+#define jack_server_dir "server"
|
|
2319 |
+#define jack_client_dir "client"
|
|
2320 |
+#define ADDON_DIR "jack"
|
|
2321 |
+
|
|
2322 |
namespace Jack
|
|
2323 |
{
|
|
2324 |
struct JackRequest;
|
|
2325 |
--- a/windows/JackShmMem_os.h
|
|
2326 |
+++ b/windows/JackShmMem_os.h
|
|
2327 |
@@ -1,28 +1,28 @@
|
|
2328 |
/*
|
|
2329 |
-Copyright (C) 2001 Paul Davis
|
|
2330 |
-Copyright (C) 2004-2008 Grame
|
|
2331 |
+ Copyright (C) 2004-2008 Grame
|
|
2332 |
+
|
|
2333 |
+ This program is free software; you can redistribute it and/or modify
|
|
2334 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2335 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2336 |
+ (at your option) any later version.
|
|
2337 |
+
|
|
2338 |
+ This program is distributed in the hope that it will be useful,
|
|
2339 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2340 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2341 |
+ GNU Lesser General Public License for more details.
|
|
2342 |
+
|
|
2343 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2344 |
+ along with this program; if not, write to the Free Software
|
|
2345 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2346 |
+
|
|
2347 |
+ */
|
|
2348 |
|
|
2349 |
-This program is free software; you can redistribute it and/or modify
|
|
2350 |
-it under the terms of the GNU General Public License as published by
|
|
2351 |
-the Free Software Foundation; either version 2 of the License, or
|
|
2352 |
-(at your option) any later version.
|
|
2353 |
-
|
|
2354 |
-This program is distributed in the hope that it will be useful,
|
|
2355 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2356 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2357 |
-GNU General Public License for more details.
|
|
2358 |
-
|
|
2359 |
-You should have received a copy of the GNU General Public License
|
|
2360 |
-along with this program; if not, write to the Free Software
|
|
2361 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2362 |
-
|
|
2363 |
-*/
|
|
2364 |
|
|
2365 |
#ifndef __JackShmMem_WIN32__
|
|
2366 |
#define __JackShmMem_WIN32__
|
|
2367 |
|
|
2368 |
-#include <windows.h>
|
|
2369 |
-
|
|
2370 |
+#include <windows.h>
|
|
2371 |
+
|
|
2372 |
// See GetProcessWorkingSetSize and SetProcessWorkingSetSize
|
|
2373 |
|
|
2374 |
#define CHECK_MLOCK(ptr, size) (VirtualLock((ptr), (size)) != 0)
|
|
2375 |
--- a/windows/JackSystemDeps_os.h
|
|
2376 |
+++ b/windows/JackSystemDeps_os.h
|
|
2377 |
@@ -1,21 +1,22 @@
|
|
2378 |
/*
|
|
2379 |
-Copyright (C) 2004-2006 Grame
|
|
2380 |
+ Copyright (C) 2004-2008 Grame
|
|
2381 |
+
|
|
2382 |
+ This program is free software; you can redistribute it and/or modify
|
|
2383 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2384 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2385 |
+ (at your option) any later version.
|
|
2386 |
+
|
|
2387 |
+ This program is distributed in the hope that it will be useful,
|
|
2388 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2389 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2390 |
+ GNU Lesser General Public License for more details.
|
|
2391 |
+
|
|
2392 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2393 |
+ along with this program; if not, write to the Free Software
|
|
2394 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2395 |
+
|
|
2396 |
+ */
|
|
2397 |
|
|
2398 |
-This program is free software; you can redistribute it and/or modify
|
|
2399 |
-it under the terms of the GNU General Public License as published by
|
|
2400 |
-the Free Software Foundation; either version 2 of the License, or
|
|
2401 |
-(at your option) any later version.
|
|
2402 |
-
|
|
2403 |
-This program is distributed in the hope that it will be useful,
|
|
2404 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2405 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2406 |
-GNU General Public License for more details.
|
|
2407 |
-
|
|
2408 |
-You should have received a copy of the GNU General Public License
|
|
2409 |
-along with this program; if not, write to the Free Software
|
|
2410 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2411 |
-
|
|
2412 |
-*/
|
|
2413 |
|
|
2414 |
#ifndef __JackSystemDeps_WIN32__
|
|
2415 |
#define __JackSystemDeps_WIN32__
|
|
2416 |
--- a/windows/JackTypes_os.h
|
|
2417 |
+++ b/windows/JackTypes_os.h
|
|
2418 |
@@ -1,21 +1,22 @@
|
|
2419 |
/*
|
|
2420 |
- Copyright (C) 2001 Paul Davis
|
|
2421 |
+ Copyright (C) 2004-2008 Grame
|
|
2422 |
+
|
|
2423 |
+ This program is free software; you can redistribute it and/or modify
|
|
2424 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2425 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2426 |
+ (at your option) any later version.
|
|
2427 |
+
|
|
2428 |
+ This program is distributed in the hope that it will be useful,
|
|
2429 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2430 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2431 |
+ GNU Lesser General Public License for more details.
|
|
2432 |
+
|
|
2433 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2434 |
+ along with this program; if not, write to the Free Software
|
|
2435 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2436 |
+
|
|
2437 |
+ */
|
|
2438 |
|
|
2439 |
- This program is free software; you can redistribute it and/or modify
|
|
2440 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2441 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2442 |
- (at your option) any later version.
|
|
2443 |
-
|
|
2444 |
- This program is distributed in the hope that it will be useful,
|
|
2445 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2446 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2447 |
- GNU Lesser General Public License for more details.
|
|
2448 |
-
|
|
2449 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2450 |
- along with this program; if not, write to the Free Software
|
|
2451 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2452 |
-
|
|
2453 |
-*/
|
|
2454 |
|
|
2455 |
#ifndef __JackTypes_WIN32__
|
|
2456 |
#define __JackTypes_WIN32__
|
|
2457 |
--- a/windows/JackWinEvent.cpp
|
|
2458 |
+++ b/windows/JackWinEvent.cpp
|
|
2459 |
@@ -1,21 +1,22 @@
|
|
2460 |
/*
|
|
2461 |
-Copyright (C) 2004-2005 Grame
|
|
2462 |
+ Copyright (C) 2004-2008 Grame
|
|
2463 |
+
|
|
2464 |
+ This program is free software; you can redistribute it and/or modify
|
|
2465 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2466 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2467 |
+ (at your option) any later version.
|
|
2468 |
+
|
|
2469 |
+ This program is distributed in the hope that it will be useful,
|
|
2470 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2471 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2472 |
+ GNU Lesser General Public License for more details.
|
|
2473 |
+
|
|
2474 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2475 |
+ along with this program; if not, write to the Free Software
|
|
2476 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2477 |
+
|
|
2478 |
+ */
|
|
2479 |
|
|
2480 |
-This program is free software; you can redistribute it and/or modify
|
|
2481 |
- it under the terms of the GNU General Public License as published by
|
|
2482 |
- the Free Software Foundation; either version 2 of the License, or
|
|
2483 |
- (at your option) any later version.
|
|
2484 |
-
|
|
2485 |
- This program is distributed in the hope that it will be useful,
|
|
2486 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2487 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2488 |
- GNU General Public License for more details.
|
|
2489 |
-
|
|
2490 |
- You should have received a copy of the GNU General Public License
|
|
2491 |
- along with this program; if not, write to the Free Software
|
|
2492 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2493 |
-
|
|
2494 |
-*/
|
|
2495 |
|
|
2496 |
#include "JackWinEvent.h"
|
|
2497 |
#include "JackTools.h"
|
|
2498 |
--- a/windows/JackWinEvent.h
|
|
2499 |
+++ b/windows/JackWinEvent.h
|
|
2500 |
@@ -1,21 +1,21 @@
|
|
2501 |
/*
|
|
2502 |
-Copyright (C) 2004-2005 Grame
|
|
2503 |
-
|
|
2504 |
-This program is free software; you can redistribute it and/or modify
|
|
2505 |
- it under the terms of the GNU General Public License as published by
|
|
2506 |
- the Free Software Foundation; either version 2 of the License, or
|
|
2507 |
- (at your option) any later version.
|
|
2508 |
-
|
|
2509 |
- This program is distributed in the hope that it will be useful,
|
|
2510 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2511 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2512 |
- GNU General Public License for more details.
|
|
2513 |
-
|
|
2514 |
- You should have received a copy of the GNU General Public License
|
|
2515 |
- along with this program; if not, write to the Free Software
|
|
2516 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2517 |
-
|
|
2518 |
-*/
|
|
2519 |
+ Copyright (C) 2004-2008 Grame
|
|
2520 |
+
|
|
2521 |
+ This program is free software; you can redistribute it and/or modify
|
|
2522 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2523 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2524 |
+ (at your option) any later version.
|
|
2525 |
+
|
|
2526 |
+ This program is distributed in the hope that it will be useful,
|
|
2527 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2528 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2529 |
+ GNU Lesser General Public License for more details.
|
|
2530 |
+
|
|
2531 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2532 |
+ along with this program; if not, write to the Free Software
|
|
2533 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2534 |
+
|
|
2535 |
+ */
|
|
2536 |
|
|
2537 |
#ifndef __JackWinEvent__
|
|
2538 |
#define __JackWinEvent__
|
|
2539 |
--- a/windows/JackWinMutex.h
|
|
2540 |
+++ b/windows/JackWinMutex.h
|
|
2541 |
@@ -1,23 +1,22 @@
|
|
2542 |
/*
|
|
2543 |
- Copyright (C) 2006 Grame
|
|
2544 |
-
|
|
2545 |
- This library is free software; you can redistribute it and/or
|
|
2546 |
- modify it under the terms of the GNU Lesser General Public
|
|
2547 |
- License as published by the Free Software Foundation; either
|
|
2548 |
- version 2.1 of the License, or (at your option) any later version.
|
|
2549 |
-
|
|
2550 |
- This library is distributed in the hope that it will be useful,
|
|
2551 |
+ Copyright (C) 2004-2008 Grame
|
|
2552 |
+
|
|
2553 |
+ This program is free software; you can redistribute it and/or modify
|
|
2554 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2555 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2556 |
+ (at your option) any later version.
|
|
2557 |
+
|
|
2558 |
+ This program is distributed in the hope that it will be useful,
|
|
2559 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2560 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
2561 |
- Lesser General Public License for more details.
|
|
2562 |
-
|
|
2563 |
- You should have received a copy of the GNU Lesser General Public
|
|
2564 |
- License along with this library; if not, write to the Free Software
|
|
2565 |
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
2566 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2567 |
+ GNU Lesser General Public License for more details.
|
|
2568 |
+
|
|
2569 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2570 |
+ along with this program; if not, write to the Free Software
|
|
2571 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2572 |
+
|
|
2573 |
+ */
|
|
2574 |
|
|
2575 |
- Grame Research Laboratory, 9 rue du Garet, 69001 Lyon - France
|
|
2576 |
- grame@grame.fr
|
|
2577 |
-*/
|
|
2578 |
|
|
2579 |
#ifndef __JackWinMutex__
|
|
2580 |
#define __JackWinMutex__
|
|
2581 |
--- a/windows/JackWinNamedPipe.cpp
|
|
2582 |
+++ b/windows/JackWinNamedPipe.cpp
|
|
2583 |
@@ -1,21 +1,22 @@
|
|
2584 |
/*
|
|
2585 |
-Copyright (C) 2004-2006 Grame
|
|
2586 |
+ Copyright (C) 2004-2008 Grame
|
|
2587 |
+
|
|
2588 |
+ This program is free software; you can redistribute it and/or modify
|
|
2589 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2590 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2591 |
+ (at your option) any later version.
|
|
2592 |
+
|
|
2593 |
+ This program is distributed in the hope that it will be useful,
|
|
2594 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2595 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2596 |
+ GNU Lesser General Public License for more details.
|
|
2597 |
+
|
|
2598 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2599 |
+ along with this program; if not, write to the Free Software
|
|
2600 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2601 |
+
|
|
2602 |
+ */
|
|
2603 |
|
|
2604 |
-This program is free software; you can redistribute it and/or modify
|
|
2605 |
- it under the terms of the GNU General Public License as published by
|
|
2606 |
- the Free Software Foundation; either version 2 of the License, or
|
|
2607 |
- (at your option) any later version.
|
|
2608 |
-
|
|
2609 |
- This program is distributed in the hope that it will be useful,
|
|
2610 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2611 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2612 |
- GNU General Public License for more details.
|
|
2613 |
-
|
|
2614 |
- You should have received a copy of the GNU General Public License
|
|
2615 |
- along with this program; if not, write to the Free Software
|
|
2616 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2617 |
-
|
|
2618 |
-*/
|
|
2619 |
|
|
2620 |
#include "JackWinNamedPipe.h"
|
|
2621 |
#include "JackError.h"
|
|
2622 |
--- a/windows/JackWinNamedPipe.h
|
|
2623 |
+++ b/windows/JackWinNamedPipe.h
|
|
2624 |
@@ -1,21 +1,22 @@
|
|
2625 |
/*
|
|
2626 |
-Copyright (C) 2004-2006 Grame
|
|
2627 |
+ Copyright (C) 2004-2008 Grame
|
|
2628 |
+
|
|
2629 |
+ This program is free software; you can redistribute it and/or modify
|
|
2630 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2631 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2632 |
+ (at your option) any later version.
|
|
2633 |
+
|
|
2634 |
+ This program is distributed in the hope that it will be useful,
|
|
2635 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2636 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2637 |
+ GNU Lesser General Public License for more details.
|
|
2638 |
+
|
|
2639 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2640 |
+ along with this program; if not, write to the Free Software
|
|
2641 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2642 |
+
|
|
2643 |
+ */
|
|
2644 |
|
|
2645 |
-This program is free software; you can redistribute it and/or modify
|
|
2646 |
- it under the terms of the GNU General Public License as published by
|
|
2647 |
- the Free Software Foundation; either version 2 of the License, or
|
|
2648 |
- (at your option) any later version.
|
|
2649 |
-
|
|
2650 |
- This program is distributed in the hope that it will be useful,
|
|
2651 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2652 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2653 |
- GNU General Public License for more details.
|
|
2654 |
-
|
|
2655 |
- You should have received a copy of the GNU General Public License
|
|
2656 |
- along with this program; if not, write to the Free Software
|
|
2657 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2658 |
-
|
|
2659 |
-*/
|
|
2660 |
|
|
2661 |
#ifndef __JackWinNamedPipe__
|
|
2662 |
#define __JackWinNamedPipe__
|
|
2663 |
--- a/windows/JackWinNamedPipeClientChannel.cpp
|
|
2664 |
+++ b/windows/JackWinNamedPipeClientChannel.cpp
|
|
2665 |
@@ -1,21 +1,22 @@
|
|
2666 |
/*
|
|
2667 |
-Copyright (C) 2004-2006 Grame
|
|
2668 |
+ Copyright (C) 2004-2008 Grame
|
|
2669 |
+
|
|
2670 |
+ This program is free software; you can redistribute it and/or modify
|
|
2671 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2672 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2673 |
+ (at your option) any later version.
|
|
2674 |
+
|
|
2675 |
+ This program is distributed in the hope that it will be useful,
|
|
2676 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2677 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2678 |
+ GNU Lesser General Public License for more details.
|
|
2679 |
+
|
|
2680 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2681 |
+ along with this program; if not, write to the Free Software
|
|
2682 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2683 |
+
|
|
2684 |
+ */
|
|
2685 |
|
|
2686 |
- This program is free software; you can redistribute it and/or modify
|
|
2687 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2688 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2689 |
- (at your option) any later version.
|
|
2690 |
-
|
|
2691 |
- This program is distributed in the hope that it will be useful,
|
|
2692 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2693 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2694 |
- GNU Lesser General Public License for more details.
|
|
2695 |
-
|
|
2696 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2697 |
- along with this program; if not, write to the Free Software
|
|
2698 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2699 |
-
|
|
2700 |
-*/
|
|
2701 |
|
|
2702 |
#include "JackWinNamedPipeClientChannel.h"
|
|
2703 |
#include "JackRequest.h"
|
|
2704 |
--- a/windows/JackWinNamedPipeClientChannel.h
|
|
2705 |
+++ b/windows/JackWinNamedPipeClientChannel.h
|
|
2706 |
@@ -1,21 +1,22 @@
|
|
2707 |
/*
|
|
2708 |
-Copyright (C) 2004-2006 Grame
|
|
2709 |
+ Copyright (C) 2004-2008 Grame
|
|
2710 |
+
|
|
2711 |
+ This program is free software; you can redistribute it and/or modify
|
|
2712 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2713 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2714 |
+ (at your option) any later version.
|
|
2715 |
+
|
|
2716 |
+ This program is distributed in the hope that it will be useful,
|
|
2717 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2718 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2719 |
+ GNU Lesser General Public License for more details.
|
|
2720 |
+
|
|
2721 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2722 |
+ along with this program; if not, write to the Free Software
|
|
2723 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2724 |
+
|
|
2725 |
+ */
|
|
2726 |
|
|
2727 |
- This program is free software; you can redistribute it and/or modify
|
|
2728 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2729 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2730 |
- (at your option) any later version.
|
|
2731 |
-
|
|
2732 |
- This program is distributed in the hope that it will be useful,
|
|
2733 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2734 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2735 |
- GNU Lesser General Public License for more details.
|
|
2736 |
-
|
|
2737 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2738 |
- along with this program; if not, write to the Free Software
|
|
2739 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2740 |
-
|
|
2741 |
-*/
|
|
2742 |
|
|
2743 |
#ifndef __JackWinNamedPipeClientChannel__
|
|
2744 |
#define __JackWinNamedPipeClientChannel__
|
|
2745 |
--- a/windows/JackWinNamedPipeNotifyChannel.cpp
|
|
2746 |
+++ b/windows/JackWinNamedPipeNotifyChannel.cpp
|
|
2747 |
@@ -1,21 +1,22 @@
|
|
2748 |
/*
|
|
2749 |
-Copyright (C) 2004-2006 Grame
|
|
2750 |
+ Copyright (C) 2004-2008 Grame
|
|
2751 |
+
|
|
2752 |
+ This program is free software; you can redistribute it and/or modify
|
|
2753 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2754 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2755 |
+ (at your option) any later version.
|
|
2756 |
+
|
|
2757 |
+ This program is distributed in the hope that it will be useful,
|
|
2758 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2759 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2760 |
+ GNU Lesser General Public License for more details.
|
|
2761 |
+
|
|
2762 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2763 |
+ along with this program; if not, write to the Free Software
|
|
2764 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2765 |
+
|
|
2766 |
+ */
|
|
2767 |
|
|
2768 |
- This program is free software; you can redistribute it and/or modify
|
|
2769 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2770 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2771 |
- (at your option) any later version.
|
|
2772 |
-
|
|
2773 |
- This program is distributed in the hope that it will be useful,
|
|
2774 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2775 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2776 |
- GNU Lesser General Public License for more details.
|
|
2777 |
-
|
|
2778 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2779 |
- along with this program; if not, write to the Free Software
|
|
2780 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2781 |
-
|
|
2782 |
-*/
|
|
2783 |
|
|
2784 |
#include "JackRequest.h"
|
|
2785 |
#include "JackWinNamedPipeNotifyChannel.h"
|
|
2786 |
--- a/windows/JackWinNamedPipeNotifyChannel.h
|
|
2787 |
+++ b/windows/JackWinNamedPipeNotifyChannel.h
|
|
2788 |
@@ -1,21 +1,22 @@
|
|
2789 |
/*
|
|
2790 |
-Copyright (C) 2004-2006 Grame
|
|
2791 |
+ Copyright (C) 2004-2008 Grame
|
|
2792 |
+
|
|
2793 |
+ This program is free software; you can redistribute it and/or modify
|
|
2794 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2795 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2796 |
+ (at your option) any later version.
|
|
2797 |
+
|
|
2798 |
+ This program is distributed in the hope that it will be useful,
|
|
2799 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2800 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2801 |
+ GNU Lesser General Public License for more details.
|
|
2802 |
+
|
|
2803 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2804 |
+ along with this program; if not, write to the Free Software
|
|
2805 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2806 |
+
|
|
2807 |
+ */
|
|
2808 |
|
|
2809 |
- This program is free software; you can redistribute it and/or modify
|
|
2810 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2811 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2812 |
- (at your option) any later version.
|
|
2813 |
-
|
|
2814 |
- This program is distributed in the hope that it will be useful,
|
|
2815 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2816 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2817 |
- GNU Lesser General Public License for more details.
|
|
2818 |
-
|
|
2819 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2820 |
- along with this program; if not, write to the Free Software
|
|
2821 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2822 |
-
|
|
2823 |
-*/
|
|
2824 |
|
|
2825 |
#ifndef __JackWinNamedPipeNotifyChannel__
|
|
2826 |
#define __JackWinNamedPipeNotifyChannel__
|
|
2827 |
--- a/windows/JackWinNamedPipeServerChannel.cpp
|
|
2828 |
+++ b/windows/JackWinNamedPipeServerChannel.cpp
|
|
2829 |
@@ -1,21 +1,22 @@
|
|
2830 |
/*
|
|
2831 |
-Copyright (C) 2004-2006 Grame
|
|
2832 |
+ Copyright (C) 2004-2008 Grame
|
|
2833 |
|
|
2834 |
- This program is free software; you can redistribute it and/or modify
|
|
2835 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2836 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2837 |
- (at your option) any later version.
|
|
2838 |
-
|
|
2839 |
- This program is distributed in the hope that it will be useful,
|
|
2840 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2841 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2842 |
- GNU Lesser General Public License for more details.
|
|
2843 |
-
|
|
2844 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2845 |
- along with this program; if not, write to the Free Software
|
|
2846 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2847 |
+ This program is free software; you can redistribute it and/or modify
|
|
2848 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2849 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2850 |
+ (at your option) any later version.
|
|
2851 |
+
|
|
2852 |
+ This program is distributed in the hope that it will be useful,
|
|
2853 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2854 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2855 |
+ GNU Lesser General Public License for more details.
|
|
2856 |
+
|
|
2857 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2858 |
+ along with this program; if not, write to the Free Software
|
|
2859 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2860 |
+
|
|
2861 |
+ */
|
|
2862 |
|
|
2863 |
-*/
|
|
2864 |
|
|
2865 |
#include "JackWinNamedPipeServerChannel.h"
|
|
2866 |
#include "JackNotification.h"
|
|
2867 |
@@ -73,7 +74,7 @@
|
|
2868 |
all ressources will be desallocated at the end.
|
|
2869 |
*/
|
|
2870 |
|
|
2871 |
- fThread.Stop();
|
|
2872 |
+ fThread.Kill();
|
|
2873 |
fPipe->Close();
|
|
2874 |
fRefNum = -1;
|
|
2875 |
}
|
|
2876 |
--- a/windows/JackWinNamedPipeServerChannel.h
|
|
2877 |
+++ b/windows/JackWinNamedPipeServerChannel.h
|
|
2878 |
@@ -1,21 +1,22 @@
|
|
2879 |
/*
|
|
2880 |
-Copyright (C) 2004-2006 Grame
|
|
2881 |
+ Copyright (C) 2004-2008 Grame
|
|
2882 |
+
|
|
2883 |
+ This program is free software; you can redistribute it and/or modify
|
|
2884 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2885 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2886 |
+ (at your option) any later version.
|
|
2887 |
+
|
|
2888 |
+ This program is distributed in the hope that it will be useful,
|
|
2889 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2890 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2891 |
+ GNU Lesser General Public License for more details.
|
|
2892 |
+
|
|
2893 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2894 |
+ along with this program; if not, write to the Free Software
|
|
2895 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2896 |
+
|
|
2897 |
+ */
|
|
2898 |
|
|
2899 |
- This program is free software; you can redistribute it and/or modify
|
|
2900 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2901 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2902 |
- (at your option) any later version.
|
|
2903 |
-
|
|
2904 |
- This program is distributed in the hope that it will be useful,
|
|
2905 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2906 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2907 |
- GNU Lesser General Public License for more details.
|
|
2908 |
-
|
|
2909 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2910 |
- along with this program; if not, write to the Free Software
|
|
2911 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2912 |
-
|
|
2913 |
-*/
|
|
2914 |
|
|
2915 |
#ifndef __JackWinNamedPipeServerChannel__
|
|
2916 |
#define __JackWinNamedPipeServerChannel__
|
|
2917 |
--- a/windows/JackWinNamedPipeServerNotifyChannel.h
|
|
2918 |
+++ b/windows/JackWinNamedPipeServerNotifyChannel.h
|
|
2919 |
@@ -1,21 +1,22 @@
|
|
2920 |
/*
|
|
2921 |
-Copyright (C) 2004-2006 Grame
|
|
2922 |
+ Copyright (C) 2004-2008 Grame
|
|
2923 |
+
|
|
2924 |
+ This program is free software; you can redistribute it and/or modify
|
|
2925 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2926 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2927 |
+ (at your option) any later version.
|
|
2928 |
+
|
|
2929 |
+ This program is distributed in the hope that it will be useful,
|
|
2930 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2931 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2932 |
+ GNU Lesser General Public License for more details.
|
|
2933 |
+
|
|
2934 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2935 |
+ along with this program; if not, write to the Free Software
|
|
2936 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2937 |
+
|
|
2938 |
+ */
|
|
2939 |
|
|
2940 |
- This program is free software; you can redistribute it and/or modify
|
|
2941 |
- it under the terms of the GNU Lesser General Public License as published by
|
|
2942 |
- the Free Software Foundation; either version 2.1 of the License, or
|
|
2943 |
- (at your option) any later version.
|
|
2944 |
-
|
|
2945 |
- This program is distributed in the hope that it will be useful,
|
|
2946 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2947 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2948 |
- GNU Lesser General Public License for more details.
|
|
2949 |
-
|
|
2950 |
- You should have received a copy of the GNU Lesser General Public License
|
|
2951 |
- along with this program; if not, write to the Free Software
|
|
2952 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2953 |
-
|
|
2954 |
-*/
|
|
2955 |
|
|
2956 |
#ifndef __JackWinNamedPipeServerNotifyChannel__
|
|
2957 |
#define __JackWinNamedPipeServerNotifyChannel__
|
|
2958 |
--- a/windows/JackWinProcessSync.cpp
|
|
2959 |
+++ b/windows/JackWinProcessSync.cpp
|
|
2960 |
@@ -1,21 +1,22 @@
|
|
2961 |
/*
|
|
2962 |
-Copyright (C) 2004-2006 Grame
|
|
2963 |
+ Copyright (C) 2004-2008 Grame
|
|
2964 |
+
|
|
2965 |
+ This program is free software; you can redistribute it and/or modify
|
|
2966 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
2967 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
2968 |
+ (at your option) any later version.
|
|
2969 |
+
|
|
2970 |
+ This program is distributed in the hope that it will be useful,
|
|
2971 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2972 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2973 |
+ GNU Lesser General Public License for more details.
|
|
2974 |
+
|
|
2975 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
2976 |
+ along with this program; if not, write to the Free Software
|
|
2977 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
2978 |
+
|
|
2979 |
+ */
|
|
2980 |
|
|
2981 |
-This program is free software; you can redistribute it and/or modify
|
|
2982 |
-it under the terms of the GNU General Public License as published by
|
|
2983 |
-the Free Software Foundation; either version 2 of the License, or
|
|
2984 |
-(at your option) any later version.
|
|
2985 |
-
|
|
2986 |
-This program is distributed in the hope that it will be useful,
|
|
2987 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2988 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2989 |
-GNU General Public License for more details.
|
|
2990 |
-
|
|
2991 |
-You should have received a copy of the GNU General Public License
|
|
2992 |
-along with this program; if not, write to the Free Software
|
|
2993 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
2994 |
-
|
|
2995 |
-*/
|
|
2996 |
|
|
2997 |
#include "JackWinProcessSync.h"
|
|
2998 |
#include "JackError.h"
|
|
2999 |
--- a/windows/JackWinProcessSync.h
|
|
3000 |
+++ b/windows/JackWinProcessSync.h
|
|
3001 |
@@ -1,21 +1,22 @@
|
|
3002 |
/*
|
|
3003 |
-Copyright (C) 2004-2006 Grame
|
|
3004 |
+ Copyright (C) 2004-2008 Grame
|
|
3005 |
+
|
|
3006 |
+ This program is free software; you can redistribute it and/or modify
|
|
3007 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
3008 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
3009 |
+ (at your option) any later version.
|
|
3010 |
+
|
|
3011 |
+ This program is distributed in the hope that it will be useful,
|
|
3012 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3013 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3014 |
+ GNU Lesser General Public License for more details.
|
|
3015 |
+
|
|
3016 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
3017 |
+ along with this program; if not, write to the Free Software
|
|
3018 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
3019 |
+
|
|
3020 |
+ */
|
|
3021 |
|
|
3022 |
-This program is free software; you can redistribute it and/or modify
|
|
3023 |
- it under the terms of the GNU General Public License as published by
|
|
3024 |
- the Free Software Foundation; either version 2 of the License, or
|
|
3025 |
- (at your option) any later version.
|
|
3026 |
-
|
|
3027 |
- This program is distributed in the hope that it will be useful,
|
|
3028 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3029 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3030 |
- GNU General Public License for more details.
|
|
3031 |
-
|
|
3032 |
- You should have received a copy of the GNU General Public License
|
|
3033 |
- along with this program; if not, write to the Free Software
|
|
3034 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
3035 |
-
|
|
3036 |
-*/
|
|
3037 |
|
|
3038 |
#ifndef __JackWinProcessSync__
|
|
3039 |
#define __JackWinProcessSync__
|
|
3040 |
--- a/windows/JackWinSemaphore.cpp
|
|
3041 |
+++ b/windows/JackWinSemaphore.cpp
|
|
3042 |
@@ -1,21 +1,21 @@
|
|
3043 |
/*
|
|
3044 |
-Copyright (C) 2004-2005 Grame
|
|
3045 |
-
|
|
3046 |
-This program is free software; you can redistribute it and/or modify
|
|
3047 |
- it under the terms of the GNU General Public License as published by
|
|
3048 |
- the Free Software Foundation; either version 2 of the License, or
|
|
3049 |
- (at your option) any later version.
|
|
3050 |
-
|
|
3051 |
- This program is distributed in the hope that it will be useful,
|
|
3052 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3053 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3054 |
- GNU General Public License for more details.
|
|
3055 |
-
|
|
3056 |
- You should have received a copy of the GNU General Public License
|
|
3057 |
- along with this program; if not, write to the Free Software
|
|
3058 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
3059 |
-
|
|
3060 |
-*/
|
|
3061 |
+ Copyright (C) 2004-2008 Grame
|
|
3062 |
+
|
|
3063 |
+ This program is free software; you can redistribute it and/or modify
|
|
3064 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
3065 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
3066 |
+ (at your option) any later version.
|
|
3067 |
+
|
|
3068 |
+ This program is distributed in the hope that it will be useful,
|
|
3069 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3070 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3071 |
+ GNU Lesser General Public License for more details.
|
|
3072 |
+
|
|
3073 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
3074 |
+ along with this program; if not, write to the Free Software
|
|
3075 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
3076 |
+
|
|
3077 |
+ */
|
|
3078 |
|
|
3079 |
#include "JackWinSemaphore.h"
|
|
3080 |
#include "JackConstants.h"
|
|
3081 |
--- a/windows/JackWinSemaphore.h
|
|
3082 |
+++ b/windows/JackWinSemaphore.h
|
|
3083 |
@@ -1,21 +1,22 @@
|
|
3084 |
/*
|
|
3085 |
-Copyright (C) 2004-2005 Grame
|
|
3086 |
+ Copyright (C) 2004-2008 Grame
|
|
3087 |
+
|
|
3088 |
+ This program is free software; you can redistribute it and/or modify
|
|
3089 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
3090 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
3091 |
+ (at your option) any later version.
|
|
3092 |
+
|
|
3093 |
+ This program is distributed in the hope that it will be useful,
|
|
3094 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3095 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3096 |
+ GNU Lesser General Public License for more details.
|
|
3097 |
+
|
|
3098 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
3099 |
+ along with this program; if not, write to the Free Software
|
|
3100 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
3101 |
+
|
|
3102 |
+ */
|
|
3103 |
|
|
3104 |
-This program is free software; you can redistribute it and/or modify
|
|
3105 |
- it under the terms of the GNU General Public License as published by
|
|
3106 |
- the Free Software Foundation; either version 2 of the License, or
|
|
3107 |
- (at your option) any later version.
|
|
3108 |
-
|
|
3109 |
- This program is distributed in the hope that it will be useful,
|
|
3110 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3111 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3112 |
- GNU General Public License for more details.
|
|
3113 |
-
|
|
3114 |
- You should have received a copy of the GNU General Public License
|
|
3115 |
- along with this program; if not, write to the Free Software
|
|
3116 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
3117 |
-
|
|
3118 |
-*/
|
|
3119 |
|
|
3120 |
#ifndef __JackWinSemaphore__
|
|
3121 |
#define __JackWinSemaphore__
|
|
3122 |
--- a/windows/JackWinThread.cpp
|
|
3123 |
+++ b/windows/JackWinThread.cpp
|
|
3124 |
@@ -1,22 +1,22 @@
|
|
3125 |
/*
|
|
3126 |
-Copyright (C) 2001 Paul Davis
|
|
3127 |
-Copyright (C) 2004-2006 Grame
|
|
3128 |
+ Copyright (C) 2004-2008 Grame
|
|
3129 |
+
|
|
3130 |
+ This program is free software; you can redistribute it and/or modify
|
|
3131 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
3132 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
3133 |
+ (at your option) any later version.
|
|
3134 |
+
|
|
3135 |
+ This program is distributed in the hope that it will be useful,
|
|
3136 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3137 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3138 |
+ GNU Lesser General Public License for more details.
|
|
3139 |
+
|
|
3140 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
3141 |
+ along with this program; if not, write to the Free Software
|
|
3142 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
3143 |
+
|
|
3144 |
+ */
|
|
3145 |
|
|
3146 |
-This program is free software; you can redistribute it and/or modify
|
|
3147 |
-it under the terms of the GNU General Public License as published by
|
|
3148 |
-the Free Software Foundation; either version 2 of the License, or
|
|
3149 |
-(at your option) any later version.
|
|
3150 |
-
|
|
3151 |
-This program is distributed in the hope that it will be useful,
|
|
3152 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3153 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3154 |
-GNU General Public License for more details.
|
|
3155 |
-
|
|
3156 |
-You should have received a copy of the GNU General Public License
|
|
3157 |
-along with this program; if not, write to the Free Software
|
|
3158 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
3159 |
-
|
|
3160 |
-*/
|
|
3161 |
|
|
3162 |
#include "JackWinThread.h"
|
|
3163 |
#include "JackError.h"
|
|
3164 |
--- a/windows/JackWinThread.h
|
|
3165 |
+++ b/windows/JackWinThread.h
|
|
3166 |
@@ -1,22 +1,22 @@
|
|
3167 |
/*
|
|
3168 |
-Copyright (C) 2001 Paul Davis
|
|
3169 |
-Copyright (C) 2004-2006 Grame
|
|
3170 |
+ Copyright (C) 2004-2008 Grame
|
|
3171 |
+
|
|
3172 |
+ This program is free software; you can redistribute it and/or modify
|
|
3173 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
3174 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
3175 |
+ (at your option) any later version.
|
|
3176 |
+
|
|
3177 |
+ This program is distributed in the hope that it will be useful,
|
|
3178 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3179 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3180 |
+ GNU Lesser General Public License for more details.
|
|
3181 |
+
|
|
3182 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
3183 |
+ along with this program; if not, write to the Free Software
|
|
3184 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
3185 |
+
|
|
3186 |
+ */
|
|
3187 |
|
|
3188 |
-This program is free software; you can redistribute it and/or modify
|
|
3189 |
-it under the terms of the GNU General Public License as published by
|
|
3190 |
-the Free Software Foundation; either version 2 of the License, or
|
|
3191 |
-(at your option) any later version.
|
|
3192 |
-
|
|
3193 |
-This program is distributed in the hope that it will be useful,
|
|
3194 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3195 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3196 |
-GNU General Public License for more details.
|
|
3197 |
-
|
|
3198 |
-You should have received a copy of the GNU General Public License
|
|
3199 |
-along with this program; if not, write to the Free Software
|
|
3200 |
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
3201 |
-
|
|
3202 |
-*/
|
|
3203 |
|
|
3204 |
|
|
3205 |
#ifndef __JackWinThread__
|
|
3206 |
--- a/windows/JackWinTime.c
|
|
3207 |
+++ b/windows/JackWinTime.c
|
|
3208 |
@@ -1,22 +1,22 @@
|
|
3209 |
/*
|
|
3210 |
-Copyright (C) 2001-2003 Paul Davis
|
|
3211 |
-Copyright (C) 2004-2008 Grame
|
|
3212 |
+ Copyright (C) 2004-2008 Grame
|
|
3213 |
+
|
|
3214 |
+ This program is free software; you can redistribute it and/or modify
|
|
3215 |
+ it under the terms of the GNU Lesser General Public License as published by
|
|
3216 |
+ the Free Software Foundation; either version 2.1 of the License, or
|
|
3217 |
+ (at your option) any later version.
|
|
3218 |
+
|
|
3219 |
+ This program is distributed in the hope that it will be useful,
|
|
3220 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3221 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3222 |
+ GNU Lesser General Public License for more details.
|
|
3223 |
+
|
|
3224 |
+ You should have received a copy of the GNU Lesser General Public License
|
|
3225 |
+ along with this program; if not, write to the Free Software
|
|
3226 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
3227 |
+
|
|
3228 |
+ */
|
|
3229 |
|
|
3230 |
-This program is free software; you can redistribute it and/or modify
|
|
3231 |
-it under the terms of the GNU Lesser General Public License as published by
|
|
3232 |
-the Free Software Foundation; either version 2.1 of the License, or
|
|
3233 |
-(at your option) any later version.
|
|
3234 |
-
|
|
3235 |
-This program is distributed in the hope that it will be useful,
|
|
3236 |
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3237 |
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3238 |
-GNU Lesser General Public License for more details.
|
|
3239 |
-
|
|
3240 |
-You should have received a copy of the GNU Lesser General Public License
|
|
3241 |
-along with this program; if not, write to the Free Software
|
|
3242 |
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
3243 |
-
|
|
3244 |
-*/
|
|
3245 |
|
|
3246 |
#include "JackTime.h"
|
|
3247 |
|
|
3248 |
--- a/windows/README
|
|
3249 |
+++ b/windows/README
|
|
3250 |
@@ -1,32 +1,35 @@
|
|
3251 |
-------------------------------
|
|
3252 |
-Jackmp on Windows
|
|
3253 |
+JACK2 on Windows
|
|
3254 |
-------------------------------
|
|
3255 |
|
|
3256 |
This folder contains all the windows specific sources.
|
|
3257 |
You will also find two sets of files :
|
|
3258 |
-- VisualC++6 workspace and project files, in order to compile Jack with MSVC
|
|
3259 |
-- Code::Blocks (8.02) workspace and project files, in order to compile Jack with MingW
|
|
3260 |
+- VisualC++6 workspace and project files, in order to compile JACK with MSVC
|
|
3261 |
+- Code::Blocks (8.02) workspace and project files, in order to compile JACK with MingW
|
|
3262 |
|
|
3263 |
The built binaries will be located in '/Release/bin' (or '/Debug/bin' if you build the Debug target). Once compiled, you'll find there everything you need :
|
|
3264 |
- the two 'libjackmp.dll' and 'libjackservermp.dll', client and server jack libraries
|
|
3265 |
-- the 'jackdmp.exe', main application : the jack server
|
|
3266 |
+- the 'jackdmp.exe', main application : the JACK server
|
|
3267 |
- the 'jack_xxx.exe' utilities and examples
|
|
3268 |
-- in the jackmp directory, you'll find the driver's DLL's ('jack_portaudio.dll' and 'jack_netdriver.dll') and some tools ( 'netmanager.dll', 'audioadapter.dll', 'netadapter.dll' for example )
|
|
3269 |
+- in the jackmp directory, you'll find the driver's DLL's ('jack_portaudio.dll' and 'jack_netdriver.dll') and some tools ('netmanager.dll', 'audioadapter.dll', 'netadapter.dll' for example)
|
|
3270 |
|
|
3271 |
In Code::Blocks all the projects are automatically built in a correct order (dll's then apps) by doing 'build->build workspace'.
|
|
3272 |
In VC6, you'll have to build the projects one by one.
|
|
3273 |
|
|
3274 |
+The needed regexp library TRE can be found here http://laurikari.net/tre/. Unzip and place the "tre-0.8.0" folder into the "windows" folder.
|
|
3275 |
+Then edit and comment "#define snprintf sprintf_s" at the end off the "tre-0.8.0/win32/config.h" file before building the JACK project.
|
|
3276 |
+
|
|
3277 |
-------------------------------
|
|
3278 |
Notes about VC and GCC versions
|
|
3279 |
-------------------------------
|
|
3280 |
|
|
3281 |
-The Visual Studio workspace is limited to VC6. Jack will not compile on most recent MSVC's. The fact is recent compilers (MSVC7, 8 or 9) don't agree with some of the Jack sources.
|
|
3282 |
-But now you can compile Jack using GCC, with MingW.
|
|
3283 |
+The Visual Studio workspace is limited to VC6. JACK will not compile on most recent MSVC's. The fact is recent compilers (MSVC7, 8 or 9) don't agree with some of the JACK sources.
|
|
3284 |
+But now you can compile JACK using GCC, with MingW.
|
|
3285 |
The project is actually organized in a Code::Blocks workspace. This is a simple and efficient way to compile the whole project.
|
|
3286 |
|
|
3287 |
-But for some reasons, you need to compile Jack using a SJLJ version of G++ (available on MingW website).
|
|
3288 |
+But for some reasons, you need to compile JACK using a SJLJ version of G++ (available on MingW website).
|
|
3289 |
Current GCC/G++ version (3.4.5) doesn't includes SJLJ so you'll have to use another one.
|
|
3290 |
-Jack needs the use of SJLJ exceptions instead of DW2 because exceptions are exchanged between DLL's, and DW2 does not allow to throw an exception out of a DLL, so it wouldn't be cought.
|
|
3291 |
+JACK needs the use of SJLJ exceptions instead of DW2 because exceptions are exchanged between DLL's, and DW2 does not allow to throw an exception out of a DLL, so it wouldn't be cought.
|
|
3292 |
|
|
3293 |
The ressources files has been created with ResEdit (ANSI build). VisualStudio uses 'ressource.rc' and 'ressource_vc.h'. The other files are used by MingW.
|
|
3294 |
|
|
3295 |
@@ -34,20 +37,19 @@
|
|
3296 |
A binary version of qjackctl is also included.
|
|
3297 |
|
|
3298 |
-------------------------------
|
|
3299 |
-Running Jack on Windows
|
|
3300 |
+Running JACK on Windows
|
|
3301 |
-------------------------------
|
|
3302 |
|
|
3303 |
You can use two drivers : PortAudio and NetDriver.
|
|
3304 |
The PortAudio backend allow the use of many soundcards, using ASIO, DirectSound or WMME drivers (any ASIO driver can be seen by PortAudio).
|
|
3305 |
The NetDriver allow you to use NetJack2 on windows. Thus you can easily exchange midi and audio streams bitween computers (Linux, MacOSX or Windows).
|
|
3306 |
In both cases, you have to use the minimalist :
|
|
3307 |
- 'jackd -R -d ...'
|
|
3308 |
- command. With PortAudio, you can have a list of supported drivers with :
|
|
3309 |
+ 'jackd -R -d ...' command. With PortAudio, you can have a list of supported drivers with :
|
|
3310 |
'jackd -R -S -d portaudio -l'
|
|
3311 |
|
|
3312 |
Other options still stay the same.
|
|
3313 |
-You can also pick a binary of Qjackctl, but this is still in development.
|
|
3314 |
-
|
|
3315 |
+You can also pick a binary of Qjackctl, but this is still in development.
|
|
3316 |
+
|
|
3317 |
-------------------------------
|
|
3318 |
Running Jack on windows
|
|
3319 |
-------------------------------
|
|
3320 |
@@ -55,4 +57,4 @@
|
|
3321 |
More information at : 'http://www.grame.fr/~letz/jackdmp.html'.
|
|
3322 |
|
|
3323 |
For any question or suggestion, you can refer to the mailing list 'jack-devel@jackaudio.org'
|
|
3324 |
-Enjoy Jack on windows... ;-)
|
|
3325 |
+Enjoy JACK on windows... ;-)
|
|
3326 |
--- a/windows/Setup/jack.ci
|
|
3327 |
+++ b/windows/Setup/jack.ci
|
|
3328 |
@@ -1,9 +1,9 @@
|
|
3329 |
<*project
|
|
3330 |
version = 4 civer = "Free v4.14.5" winver = "2.6/5.1.2600" >
|
|
3331 |
<output> .</>
|
|
3332 |
- <exename> Jack_v1.9.5_setup.exe</>
|
|
3333 |
+ <exename> Jack_v1.9.6_setup.exe</>
|
|
3334 |
<digitsign> </>
|
|
3335 |
- <appname> Jack v1.9.5</>
|
|
3336 |
+ <appname> Jack v1.9.6</>
|
|
3337 |
<password> </>
|
|
3338 |
<addlang> </>
|
|
3339 |
<icon> Default - 2</>
|
|
3340 |
@@ -92,6 +92,8 @@
|
|
3341 |
<_><src>..\..\common\jack\transport.h</><dest>inst</><custom>includes\jack</><ifexist>overnewer</><recurs>0</></>
|
|
3342 |
<_><src>..\..\common\jack\types.h</><dest>inst</><custom>includes\jack</><ifexist>overnewer</><recurs>0</></>
|
|
3343 |
<_><src>..\..\common\jack\systemdeps.h</><dest>inst</><custom>includes\jack</><ifexist>overnewer</><recurs>1</></>
|
|
3344 |
+<_><src>..\..\common\jack\weakjack.h</><dest>inst</><custom>includes\jack</><ifexist>overnewer</><recurs>1</></>
|
|
3345 |
+<_><src>..\..\common\jack\weakmacros.h</><dest>inst</><custom>includes\jack</><ifexist>overnewer</><recurs>1</></>
|
|
3346 |
<_><src>.\JackRouter.dll</><dest>inst</><custom></><ifexist>overnewer</><recurs>0</></>
|
|
3347 |
<_><src>.\JackRouter.ini</><dest>inst</><custom></><ifexist>overnewer</><recurs>0</></>
|
|
3348 |
<_><src>.\qjackctl\mingwm10.dll</><dest>inst</><custom></><ifexist>overnewer</><recurs>0</></>
|
|
3349 |
--- a/windows/jackaudioadapter.rc
|
|
3350 |
+++ b/windows/jackaudioadapter.rc
|
|
3351 |
@@ -11,8 +11,8 @@
|
|
3352 |
//
|
|
3353 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3354 |
1 VERSIONINFO
|
|
3355 |
- FILEVERSION 1,9,5,0
|
|
3356 |
- PRODUCTVERSION 1,9,5,0
|
|
3357 |
+ FILEVERSION 1,9,6,0
|
|
3358 |
+ PRODUCTVERSION 1,9,6,0
|
|
3359 |
FILEOS VOS_UNKNOWN
|
|
3360 |
FILETYPE VFT_DLL
|
|
3361 |
BEGIN
|
|
3362 |
@@ -23,14 +23,14 @@
|
|
3363 |
VALUE "Comments", "\0"
|
|
3364 |
VALUE "CompanyName", "Grame\0"
|
|
3365 |
VALUE "FileDescription", "Jackmp Audio Adapter for Windows\0"
|
|
3366 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3367 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3368 |
VALUE "InternalName", "audioadapter\0"
|
|
3369 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3370 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3371 |
VALUE "LegalTrademarks", "\0"
|
|
3372 |
VALUE "OriginalFilename", "audioadapter.dll\0"
|
|
3373 |
VALUE "PrivateBuild", "\0"
|
|
3374 |
VALUE "ProductName", "audioadapter\0"
|
|
3375 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3376 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3377 |
VALUE "SpecialBuild", "\0"
|
|
3378 |
END
|
|
3379 |
END
|
|
3380 |
--- a/windows/jackd.rc
|
|
3381 |
+++ b/windows/jackd.rc
|
|
3382 |
@@ -11,8 +11,8 @@
|
|
3383 |
//
|
|
3384 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3385 |
1 VERSIONINFO
|
|
3386 |
- FILEVERSION 1,9,5,0
|
|
3387 |
- PRODUCTVERSION 1,9,5,0
|
|
3388 |
+ FILEVERSION 1,9,6,0
|
|
3389 |
+ PRODUCTVERSION 1,9,6,0
|
|
3390 |
FILEOS VOS_UNKNOWN
|
|
3391 |
FILETYPE VFT_APP
|
|
3392 |
BEGIN
|
|
3393 |
@@ -23,14 +23,14 @@
|
|
3394 |
VALUE "Comments", "\0"
|
|
3395 |
VALUE "CompanyName", "Grame\0"
|
|
3396 |
VALUE "FileDescription", "Jack server for Windows\0"
|
|
3397 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3398 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3399 |
VALUE "InternalName", "jackd\0"
|
|
3400 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3401 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3402 |
VALUE "LegalTrademarks", "\0"
|
|
3403 |
VALUE "OriginalFilename", "jackd.exe\0"
|
|
3404 |
VALUE "PrivateBuild", "\0"
|
|
3405 |
VALUE "ProductName", "jackd\0"
|
|
3406 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3407 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3408 |
VALUE "SpecialBuild", "\0"
|
|
3409 |
END
|
|
3410 |
END
|
|
3411 |
--- a/windows/jackd.workspace
|
|
3412 |
+++ b/windows/jackd.workspace
|
|
3413 |
@@ -20,7 +20,7 @@
|
|
3414 |
<Project filename="jack_netmanager.cbp">
|
|
3415 |
<Depends filename="libjackserver.cbp" />
|
|
3416 |
</Project>
|
|
3417 |
- <Project filename="jack_audioadapter.cbp">
|
|
3418 |
+ <Project filename="jack_audioadapter.cbp" active="1">
|
|
3419 |
<Depends filename="libjackserver.cbp" />
|
|
3420 |
</Project>
|
|
3421 |
<Project filename="jack_netadapter.cbp">
|
|
3422 |
@@ -36,7 +36,7 @@
|
|
3423 |
<Project filename="jack_lsp.cbp">
|
|
3424 |
<Depends filename="libjack.cbp" />
|
|
3425 |
</Project>
|
|
3426 |
- <Project filename="jack_netsource.cbp" active="1">
|
|
3427 |
+ <Project filename="jack_netsource.cbp">
|
|
3428 |
<Depends filename="libjack.cbp" />
|
|
3429 |
<Depends filename="jack_netonedriver.cbp" />
|
|
3430 |
</Project>
|
|
3431 |
--- a/windows/jacknetadapter.rc
|
|
3432 |
+++ b/windows/jacknetadapter.rc
|
|
3433 |
@@ -11,8 +11,8 @@
|
|
3434 |
//
|
|
3435 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3436 |
1 VERSIONINFO
|
|
3437 |
- FILEVERSION 1,9,5,0
|
|
3438 |
- PRODUCTVERSION 1,9,5,0
|
|
3439 |
+ FILEVERSION 1,9,6,0
|
|
3440 |
+ PRODUCTVERSION 1,9,6,0
|
|
3441 |
FILEOS VOS_UNKNOWN
|
|
3442 |
FILETYPE VFT_DLL
|
|
3443 |
BEGIN
|
|
3444 |
@@ -23,14 +23,14 @@
|
|
3445 |
VALUE "Comments", "\0"
|
|
3446 |
VALUE "CompanyName", "Grame\0"
|
|
3447 |
VALUE "FileDescription", "Jackmp Net Adapter for Windows\0"
|
|
3448 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3449 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3450 |
VALUE "InternalName", "netadapter\0"
|
|
3451 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3452 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3453 |
VALUE "LegalTrademarks", "\0"
|
|
3454 |
VALUE "OriginalFilename", "netadapter.dll\0"
|
|
3455 |
VALUE "PrivateBuild", "\0"
|
|
3456 |
VALUE "ProductName", "netadapter\0"
|
|
3457 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3458 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3459 |
VALUE "SpecialBuild", "\0"
|
|
3460 |
END
|
|
3461 |
END
|
|
3462 |
--- a/windows/jacknetdriver.rc
|
|
3463 |
+++ b/windows/jacknetdriver.rc
|
|
3464 |
@@ -11,8 +11,8 @@
|
|
3465 |
//
|
|
3466 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3467 |
1 VERSIONINFO
|
|
3468 |
- FILEVERSION 1,9,5,0
|
|
3469 |
- PRODUCTVERSION 1,9,5,0
|
|
3470 |
+ FILEVERSION 1,9,6,0
|
|
3471 |
+ PRODUCTVERSION 1,9,6,0
|
|
3472 |
FILEOS VOS_UNKNOWN
|
|
3473 |
FILETYPE VFT_DLL
|
|
3474 |
BEGIN
|
|
3475 |
@@ -23,14 +23,14 @@
|
|
3476 |
VALUE "Comments", "\0"
|
|
3477 |
VALUE "CompanyName", "Grame\0"
|
|
3478 |
VALUE "FileDescription", "Jackmp Net Driver for Windows\0"
|
|
3479 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3480 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3481 |
VALUE "InternalName", "jack_netdriver\0"
|
|
3482 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3483 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3484 |
VALUE "LegalTrademarks", "\0"
|
|
3485 |
VALUE "OriginalFilename", "jack_netdriver.dll\0"
|
|
3486 |
VALUE "PrivateBuild", "\0"
|
|
3487 |
VALUE "ProductName", "jack_netdriver\0"
|
|
3488 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3489 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3490 |
VALUE "SpecialBuild", "\0"
|
|
3491 |
END
|
|
3492 |
END
|
|
3493 |
--- a/windows/jacknetmanager.rc
|
|
3494 |
+++ b/windows/jacknetmanager.rc
|
|
3495 |
@@ -11,8 +11,8 @@
|
|
3496 |
//
|
|
3497 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3498 |
1 VERSIONINFO
|
|
3499 |
- FILEVERSION 1,9,5,0
|
|
3500 |
- PRODUCTVERSION 1,9,5,0
|
|
3501 |
+ FILEVERSION 1,9,6,0
|
|
3502 |
+ PRODUCTVERSION 1,9,6,0
|
|
3503 |
FILEOS VOS_UNKNOWN
|
|
3504 |
FILETYPE VFT_DLL
|
|
3505 |
BEGIN
|
|
3506 |
@@ -23,14 +23,14 @@
|
|
3507 |
VALUE "Comments", "\0"
|
|
3508 |
VALUE "CompanyName", "Grame\0"
|
|
3509 |
VALUE "FileDescription", "Jackmp Net Manager for Windows\0"
|
|
3510 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3511 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3512 |
VALUE "InternalName", "netmanager\0"
|
|
3513 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3514 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3515 |
VALUE "LegalTrademarks", "\0"
|
|
3516 |
VALUE "OriginalFilename", "netmanager.dll\0"
|
|
3517 |
VALUE "PrivateBuild", "\0"
|
|
3518 |
VALUE "ProductName", "netmanager\0"
|
|
3519 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3520 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3521 |
VALUE "SpecialBuild", "\0"
|
|
3522 |
END
|
|
3523 |
END
|
|
3524 |
--- a/windows/jackportaudio.rc
|
|
3525 |
+++ b/windows/jackportaudio.rc
|
|
3526 |
@@ -11,8 +11,8 @@
|
|
3527 |
//
|
|
3528 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3529 |
1 VERSIONINFO
|
|
3530 |
- FILEVERSION 1,9,5,0
|
|
3531 |
- PRODUCTVERSION 1,9,5,0
|
|
3532 |
+ FILEVERSION 1,9,6,0
|
|
3533 |
+ PRODUCTVERSION 1,9,6,0
|
|
3534 |
FILEOS VOS_UNKNOWN
|
|
3535 |
FILETYPE VFT_DLL
|
|
3536 |
BEGIN
|
|
3537 |
@@ -23,14 +23,14 @@
|
|
3538 |
VALUE "Comments", "\0"
|
|
3539 |
VALUE "CompanyName", "Grame\0"
|
|
3540 |
VALUE "FileDescription", "Jackmp PortAudio Driver for Windows\0"
|
|
3541 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3542 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3543 |
VALUE "InternalName", "jack_portaudio\0"
|
|
3544 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3545 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3546 |
VALUE "LegalTrademarks", "\0"
|
|
3547 |
VALUE "OriginalFilename", "jack_portaudio.dll\0"
|
|
3548 |
VALUE "PrivateBuild", "\0"
|
|
3549 |
VALUE "ProductName", "jack_portaudio\0"
|
|
3550 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3551 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3552 |
VALUE "SpecialBuild", "\0"
|
|
3553 |
END
|
|
3554 |
END
|
|
3555 |
--- a/windows/jackwinmme.rc
|
|
3556 |
+++ b/windows/jackwinmme.rc
|
|
3557 |
@@ -11,8 +11,8 @@
|
|
3558 |
//
|
|
3559 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3560 |
1 VERSIONINFO
|
|
3561 |
- FILEVERSION 1,9,5,0
|
|
3562 |
- PRODUCTVERSION 1,9,5,0
|
|
3563 |
+ FILEVERSION 1,9,6,0
|
|
3564 |
+ PRODUCTVERSION 1,9,6,0
|
|
3565 |
FILEOS VOS_UNKNOWN
|
|
3566 |
FILETYPE VFT_DLL
|
|
3567 |
BEGIN
|
|
3568 |
@@ -23,14 +23,14 @@
|
|
3569 |
VALUE "Comments", "\0"
|
|
3570 |
VALUE "CompanyName", "Grame\0"
|
|
3571 |
VALUE "FileDescription", "Jackmp WinMMEo Driver for Windows\0"
|
|
3572 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3573 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3574 |
VALUE "InternalName", "jack_portaudio\0"
|
|
3575 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3576 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3577 |
VALUE "LegalTrademarks", "\0"
|
|
3578 |
VALUE "OriginalFilename", "jack_winmme.dll\0"
|
|
3579 |
VALUE "PrivateBuild", "\0"
|
|
3580 |
VALUE "ProductName", "jack_winmme\0"
|
|
3581 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3582 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3583 |
VALUE "SpecialBuild", "\0"
|
|
3584 |
END
|
|
3585 |
END
|
|
3586 |
--- a/windows/libjack.cbp
|
|
3587 |
+++ b/windows/libjack.cbp
|
|
3588 |
@@ -25,10 +25,13 @@
|
|
3589 |
<Add option="-DREGEX_MALLOC" />
|
|
3590 |
<Add option="-DSTDC_HEADERS" />
|
|
3591 |
<Add option="-D__SMP__" />
|
|
3592 |
+ <Add option="-DHAVE_CONFIG_H" />
|
|
3593 |
<Add directory="." />
|
|
3594 |
<Add directory="..\windows" />
|
|
3595 |
<Add directory="..\common\jack" />
|
|
3596 |
<Add directory="..\common" />
|
|
3597 |
+ <Add directory="tre-0.8.0\win32" />
|
|
3598 |
+ <Add directory="tre-0.8.0\lib" />
|
|
3599 |
</Compiler>
|
|
3600 |
<Linker>
|
|
3601 |
<Add library="kernel32" />
|
|
3602 |
@@ -64,10 +67,13 @@
|
|
3603 |
<Add option="-DREGEX_MALLOC" />
|
|
3604 |
<Add option="-DSTDC_HEADERS" />
|
|
3605 |
<Add option="-D__SMP__" />
|
|
3606 |
+ <Add option="-DHAVE_CONFIG_H" />
|
|
3607 |
<Add directory="." />
|
|
3608 |
<Add directory="..\windows" />
|
|
3609 |
<Add directory="..\common\jack" />
|
|
3610 |
<Add directory="..\common" />
|
|
3611 |
+ <Add directory="tre-0.8.0\win32" />
|
|
3612 |
+ <Add directory="tre-0.8.0\lib" />
|
|
3613 |
</Compiler>
|
|
3614 |
<Linker>
|
|
3615 |
<Add library="kernel32" />
|
|
3616 |
@@ -104,10 +110,13 @@
|
|
3617 |
<Add option="-DSTDC_HEADERS" />
|
|
3618 |
<Add option="-D__SMP__" />
|
|
3619 |
<Add option="-DJACK_MONITOR" />
|
|
3620 |
+ <Add option="-DHAVE_CONFIG_H" />
|
|
3621 |
<Add directory="." />
|
|
3622 |
<Add directory="..\windows" />
|
|
3623 |
<Add directory="..\common\jack" />
|
|
3624 |
<Add directory="..\common" />
|
|
3625 |
+ <Add directory="tre-0.8.0\win32" />
|
|
3626 |
+ <Add directory="tre-0.8.0\lib" />
|
|
3627 |
</Compiler>
|
|
3628 |
<Linker>
|
|
3629 |
<Add library="kernel32" />
|
|
3630 |
@@ -180,9 +189,52 @@
|
|
3631 |
<Unit filename="libjack.rc">
|
|
3632 |
<Option compilerVar="WINDRES" />
|
|
3633 |
</Unit>
|
|
3634 |
- <Unit filename="regex.c">
|
|
3635 |
+ <Unit filename="tre-0.8.0\lib\regcomp.c">
|
|
3636 |
<Option compilerVar="CC" />
|
|
3637 |
</Unit>
|
|
3638 |
+ <Unit filename="tre-0.8.0\lib\regerror.c">
|
|
3639 |
+ <Option compilerVar="CC" />
|
|
3640 |
+ </Unit>
|
|
3641 |
+ <Unit filename="tre-0.8.0\lib\regex.h" />
|
|
3642 |
+ <Unit filename="tre-0.8.0\lib\regexec.c">
|
|
3643 |
+ <Option compilerVar="CC" />
|
|
3644 |
+ </Unit>
|
|
3645 |
+ <Unit filename="tre-0.8.0\lib\tre-ast.c">
|
|
3646 |
+ <Option compilerVar="CC" />
|
|
3647 |
+ </Unit>
|
|
3648 |
+ <Unit filename="tre-0.8.0\lib\tre-ast.h" />
|
|
3649 |
+ <Unit filename="tre-0.8.0\lib\tre-compile.c">
|
|
3650 |
+ <Option compilerVar="CC" />
|
|
3651 |
+ </Unit>
|
|
3652 |
+ <Unit filename="tre-0.8.0\lib\tre-compile.h" />
|
|
3653 |
+ <Unit filename="tre-0.8.0\lib\tre-internal.h" />
|
|
3654 |
+ <Unit filename="tre-0.8.0\lib\tre-match-approx.c">
|
|
3655 |
+ <Option compilerVar="CC" />
|
|
3656 |
+ </Unit>
|
|
3657 |
+ <Unit filename="tre-0.8.0\lib\tre-match-backtrack.c">
|
|
3658 |
+ <Option compilerVar="CC" />
|
|
3659 |
+ </Unit>
|
|
3660 |
+ <Unit filename="tre-0.8.0\lib\tre-match-parallel.c">
|
|
3661 |
+ <Option compilerVar="CC" />
|
|
3662 |
+ </Unit>
|
|
3663 |
+ <Unit filename="tre-0.8.0\lib\tre-match-utils.h" />
|
|
3664 |
+ <Unit filename="tre-0.8.0\lib\tre-mem.c">
|
|
3665 |
+ <Option compilerVar="CC" />
|
|
3666 |
+ </Unit>
|
|
3667 |
+ <Unit filename="tre-0.8.0\lib\tre-mem.h" />
|
|
3668 |
+ <Unit filename="tre-0.8.0\lib\tre-parse.c">
|
|
3669 |
+ <Option compilerVar="CC" />
|
|
3670 |
+ </Unit>
|
|
3671 |
+ <Unit filename="tre-0.8.0\lib\tre-parse.h" />
|
|
3672 |
+ <Unit filename="tre-0.8.0\lib\tre-stack.c">
|
|
3673 |
+ <Option compilerVar="CC" />
|
|
3674 |
+ </Unit>
|
|
3675 |
+ <Unit filename="tre-0.8.0\lib\tre-stack.h" />
|
|
3676 |
+ <Unit filename="tre-0.8.0\lib\tre.h" />
|
|
3677 |
+ <Unit filename="tre-0.8.0\lib\xmalloc.c">
|
|
3678 |
+ <Option compilerVar="CC" />
|
|
3679 |
+ </Unit>
|
|
3680 |
+ <Unit filename="tre-0.8.0\lib\xmalloc.h" />
|
|
3681 |
<Extensions>
|
|
3682 |
<code_completion />
|
|
3683 |
<envvars />
|
|
3684 |
--- a/windows/libjack.rc
|
|
3685 |
+++ b/windows/libjack.rc
|
|
3686 |
@@ -11,8 +11,8 @@
|
|
3687 |
//
|
|
3688 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3689 |
1 VERSIONINFO
|
|
3690 |
- FILEVERSION 1,9,5,0
|
|
3691 |
- PRODUCTVERSION 1,9,5,0
|
|
3692 |
+ FILEVERSION 1,9,6,0
|
|
3693 |
+ PRODUCTVERSION 1,9,6,0
|
|
3694 |
FILEOS VOS_UNKNOWN
|
|
3695 |
FILETYPE VFT_DLL
|
|
3696 |
BEGIN
|
|
3697 |
@@ -23,14 +23,14 @@
|
|
3698 |
VALUE "Comments", "\0"
|
|
3699 |
VALUE "CompanyName", "Grame\0"
|
|
3700 |
VALUE "FileDescription", "Jack client library for Windows\0"
|
|
3701 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3702 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
3703 |
VALUE "InternalName", "libjack\0"
|
|
3704 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3705 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3706 |
VALUE "LegalTrademarks", "\0"
|
|
3707 |
VALUE "OriginalFilename", "libjack.dll\0"
|
|
3708 |
VALUE "PrivateBuild", "\0"
|
|
3709 |
VALUE "ProductName", "libjack\0"
|
|
3710 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3711 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3712 |
VALUE "SpecialBuild", "\0"
|
|
3713 |
END
|
|
3714 |
END
|
|
3715 |
--- a/windows/libjackserver.cbp
|
|
3716 |
+++ b/windows/libjackserver.cbp
|
|
3717 |
@@ -26,10 +26,13 @@
|
|
3718 |
<Add option="-DSTDC_HEADERS" />
|
|
3719 |
<Add option="-DSERVER_SIDE" />
|
|
3720 |
<Add option="-D__SMP__" />
|
|
3721 |
+ <Add option="-DHAVE_CONFIG_H" />
|
|
3722 |
<Add directory="." />
|
|
3723 |
<Add directory="..\windows" />
|
|
3724 |
<Add directory="..\common\jack" />
|
|
3725 |
<Add directory="..\common" />
|
|
3726 |
+ <Add directory="tre-0.8.0\win32" />
|
|
3727 |
+ <Add directory="tre-0.8.0\lib" />
|
|
3728 |
</Compiler>
|
|
3729 |
<Linker>
|
|
3730 |
<Add directory="Release\bin" />
|
|
3731 |
@@ -55,10 +58,13 @@
|
|
3732 |
<Add option="-DSTDC_HEADERS" />
|
|
3733 |
<Add option="-DSERVER_SIDE" />
|
|
3734 |
<Add option="-D__SMP__" />
|
|
3735 |
+ <Add option="-DHAVE_CONFIG_H" />
|
|
3736 |
<Add directory="." />
|
|
3737 |
<Add directory="..\windows" />
|
|
3738 |
<Add directory="..\common\jack" />
|
|
3739 |
<Add directory="..\common" />
|
|
3740 |
+ <Add directory="tre-0.8.0\win32" />
|
|
3741 |
+ <Add directory="tre-0.8.0\lib" />
|
|
3742 |
</Compiler>
|
|
3743 |
<Linker>
|
|
3744 |
<Add directory="Debug\bin" />
|
|
3745 |
@@ -85,10 +91,13 @@
|
|
3746 |
<Add option="-DSERVER_SIDE" />
|
|
3747 |
<Add option="-D__SMP__" />
|
|
3748 |
<Add option="-DJACK_MONITOR" />
|
|
3749 |
+ <Add option="-DHAVE_CONFIG_H" />
|
|
3750 |
<Add directory="." />
|
|
3751 |
<Add directory="..\windows" />
|
|
3752 |
<Add directory="..\common\jack" />
|
|
3753 |
<Add directory="..\common" />
|
|
3754 |
+ <Add directory="tre-0.8.0\win32" />
|
|
3755 |
+ <Add directory="tre-0.8.0\lib" />
|
|
3756 |
</Compiler>
|
|
3757 |
<Linker>
|
|
3758 |
<Add directory="Release\bin" />
|
|
3759 |
@@ -145,6 +154,8 @@
|
|
3760 |
<Unit filename="..\common\JackMidiPort.cpp" />
|
|
3761 |
<Unit filename="..\common\JackNetInterface.cpp" />
|
|
3762 |
<Unit filename="..\common\JackNetTool.cpp" />
|
|
3763 |
+ <Unit filename="..\common\JackPhysicalMidiInput.cpp" />
|
|
3764 |
+ <Unit filename="..\common\JackPhysicalMidiOutput.cpp" />
|
|
3765 |
<Unit filename="..\common\JackPort.cpp" />
|
|
3766 |
<Unit filename="..\common\JackPortType.cpp" />
|
|
3767 |
<Unit filename="..\common\JackRestartThreadedDriver.cpp" />
|
|
3768 |
@@ -156,8 +167,6 @@
|
|
3769 |
<Unit filename="..\common\JackTools.cpp" />
|
|
3770 |
<Unit filename="..\common\JackTransportEngine.cpp" />
|
|
3771 |
<Unit filename="..\common\JackWaitThreadedDriver.cpp" />
|
|
3772 |
- <Unit filename="..\common\JackPhysicalMidiInput.cpp" />
|
|
3773 |
- <Unit filename="..\common\JackPhysicalMidiOutput.cpp" />
|
|
3774 |
<Unit filename="..\common\ringbuffer.c">
|
|
3775 |
<Option compilerVar="CC" />
|
|
3776 |
</Unit>
|
|
3777 |
@@ -185,9 +194,52 @@
|
|
3778 |
<Unit filename="libjackserver.rc">
|
|
3779 |
<Option compilerVar="WINDRES" />
|
|
3780 |
</Unit>
|
|
3781 |
- <Unit filename="regex.c">
|
|
3782 |
+ <Unit filename="tre-0.8.0\lib\regcomp.c">
|
|
3783 |
+ <Option compilerVar="CC" />
|
|
3784 |
+ </Unit>
|
|
3785 |
+ <Unit filename="tre-0.8.0\lib\regerror.c">
|
|
3786 |
+ <Option compilerVar="CC" />
|
|
3787 |
+ </Unit>
|
|
3788 |
+ <Unit filename="tre-0.8.0\lib\regex.h" />
|
|
3789 |
+ <Unit filename="tre-0.8.0\lib\regexec.c">
|
|
3790 |
+ <Option compilerVar="CC" />
|
|
3791 |
+ </Unit>
|
|
3792 |
+ <Unit filename="tre-0.8.0\lib\tre-ast.c">
|
|
3793 |
+ <Option compilerVar="CC" />
|
|
3794 |
+ </Unit>
|
|
3795 |
+ <Unit filename="tre-0.8.0\lib\tre-ast.h" />
|
|
3796 |
+ <Unit filename="tre-0.8.0\lib\tre-compile.c">
|
|
3797 |
+ <Option compilerVar="CC" />
|
|
3798 |
+ </Unit>
|
|
3799 |
+ <Unit filename="tre-0.8.0\lib\tre-compile.h" />
|
|
3800 |
+ <Unit filename="tre-0.8.0\lib\tre-internal.h" />
|
|
3801 |
+ <Unit filename="tre-0.8.0\lib\tre-match-approx.c">
|
|
3802 |
+ <Option compilerVar="CC" />
|
|
3803 |
+ </Unit>
|
|
3804 |
+ <Unit filename="tre-0.8.0\lib\tre-match-backtrack.c">
|
|
3805 |
+ <Option compilerVar="CC" />
|
|
3806 |
+ </Unit>
|
|
3807 |
+ <Unit filename="tre-0.8.0\lib\tre-match-parallel.c">
|
|
3808 |
+ <Option compilerVar="CC" />
|
|
3809 |
+ </Unit>
|
|
3810 |
+ <Unit filename="tre-0.8.0\lib\tre-match-utils.h" />
|
|
3811 |
+ <Unit filename="tre-0.8.0\lib\tre-mem.c">
|
|
3812 |
+ <Option compilerVar="CC" />
|
|
3813 |
+ </Unit>
|
|
3814 |
+ <Unit filename="tre-0.8.0\lib\tre-mem.h" />
|
|
3815 |
+ <Unit filename="tre-0.8.0\lib\tre-parse.c">
|
|
3816 |
+ <Option compilerVar="CC" />
|
|
3817 |
+ </Unit>
|
|
3818 |
+ <Unit filename="tre-0.8.0\lib\tre-parse.h" />
|
|
3819 |
+ <Unit filename="tre-0.8.0\lib\tre-stack.c">
|
|
3820 |
+ <Option compilerVar="CC" />
|
|
3821 |
+ </Unit>
|
|
3822 |
+ <Unit filename="tre-0.8.0\lib\tre-stack.h" />
|
|
3823 |
+ <Unit filename="tre-0.8.0\lib\tre.h" />
|
|
3824 |
+ <Unit filename="tre-0.8.0\lib\xmalloc.c">
|
|
3825 |
<Option compilerVar="CC" />
|
|
3826 |
</Unit>
|
|
3827 |
+ <Unit filename="tre-0.8.0\lib\xmalloc.h" />
|
|
3828 |
<Extensions>
|
|
3829 |
<code_completion />
|
|
3830 |
<envvars />
|
|
3831 |
--- a/windows/libjackserver.rc
|
|
3832 |
+++ b/windows/libjackserver.rc
|
|
3833 |
@@ -11,8 +11,8 @@
|
|
3834 |
//
|
|
3835 |
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
3836 |
1 VERSIONINFO
|
|
3837 |
- FILEVERSION 1,9,5,0
|
|
3838 |
- PRODUCTVERSION 1,9,5,0
|
|
3839 |
+ FILEVERSION 1,9,6,0
|
|
3840 |
+ PRODUCTVERSION 1,9,6,0
|
|
3841 |
FILEOS VOS_UNKNOWN
|
|
3842 |
FILETYPE VFT_DLL
|
|
3843 |
BEGIN
|
|
3844 |
@@ -23,14 +23,14 @@
|
|
3845 |
VALUE "Comments", "\0"
|
|
3846 |
VALUE "CompanyName", "Grame\0"
|
|
3847 |
VALUE "FileDescription", "Jack server library for Windows\0"
|
|
3848 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
3849 |
+ VALUE "FileVersion", "1, 9, 56, 0\0"
|
|
3850 |
VALUE "InternalName", "libjackserver\0"
|
|
3851 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
3852 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
3853 |
VALUE "LegalTrademarks", "\0"
|
|
3854 |
VALUE "OriginalFilename", "libjackserver.dll\0"
|
|
3855 |
VALUE "PrivateBuild", "\0"
|
|
3856 |
VALUE "ProductName", "libjackserver\0"
|
|
3857 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
3858 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
3859 |
VALUE "SpecialBuild", "\0"
|
|
3860 |
END
|
|
3861 |
END
|
|
3862 |
--- a/windows/portaudio/JackPortAudioDriver.cpp
|
|
3863 |
+++ b/windows/portaudio/JackPortAudioDriver.cpp
|
|
3864 |
@@ -404,8 +404,8 @@
|
|
3865 |
{
|
|
3866 |
|
|
3867 |
case 'd':
|
|
3868 |
- capture_pcm_name = strdup(param->value.str);
|
|
3869 |
- playback_pcm_name = strdup(param->value.str);
|
|
3870 |
+ capture_pcm_name = param->value.str;
|
|
3871 |
+ playback_pcm_name = param->value.str;
|
|
3872 |
break;
|
|
3873 |
|
|
3874 |
case 'D':
|
|
3875 |
@@ -428,14 +428,14 @@
|
|
3876 |
case 'C':
|
|
3877 |
capture = true;
|
|
3878 |
if (strcmp(param->value.str, "none") != 0) {
|
|
3879 |
- capture_pcm_name = strdup(param->value.str);
|
|
3880 |
+ capture_pcm_name = param->value.str;
|
|
3881 |
}
|
|
3882 |
break;
|
|
3883 |
|
|
3884 |
case 'P':
|
|
3885 |
playback = TRUE;
|
|
3886 |
if (strcmp(param->value.str, "none") != 0) {
|
|
3887 |
- playback_pcm_name = strdup(param->value.str);
|
|
3888 |
+ playback_pcm_name = param->value.str;
|
|
3889 |
}
|
|
3890 |
break;
|
|
3891 |
|
|
3892 |
--- a/windows/regex.c
|
|
3893 |
+++ /dev/null
|
|
3894 |
@@ -1,4949 +0,0 @@
|
|
3895 |
-/* Extended regular expression matching and search library,
|
|
3896 |
- version 0.12.
|
|
3897 |
- (Implements POSIX draft P10003.2/D11.2, except for
|
|
3898 |
- internationalization features.)
|
|
3899 |
-
|
|
3900 |
- Copyright (C) 1993 Free Software Foundation, Inc.
|
|
3901 |
-
|
|
3902 |
- This program is free software; you can redistribute it and/or modify
|
|
3903 |
- it under the terms of the GNU General Public License as published by
|
|
3904 |
- the Free Software Foundation; either version 2, or (at your option)
|
|
3905 |
- any later version.
|
|
3906 |
-
|
|
3907 |
- This program is distributed in the hope that it will be useful,
|
|
3908 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
3909 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
3910 |
- GNU General Public License for more details.
|
|
3911 |
-
|
|
3912 |
- You should have received a copy of the GNU General Public License
|
|
3913 |
- along with this program; if not, write to the Free Software
|
|
3914 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|
3915 |
-
|
|
3916 |
-/* AIX requires this to be the first thing in the file. */
|
|
3917 |
-#if defined (_AIX) && !defined (REGEX_MALLOC)
|
|
3918 |
- #pragma alloca
|
|
3919 |
-#endif
|
|
3920 |
-
|
|
3921 |
-#define _GNU_SOURCE
|
|
3922 |
-
|
|
3923 |
-/* We need this for `regex.h', and perhaps for the Emacs include files. */
|
|
3924 |
-#include <sys/types.h>
|
|
3925 |
-
|
|
3926 |
-#ifdef HAVE_CONFIG_H
|
|
3927 |
-#include "config.h"
|
|
3928 |
-#endif
|
|
3929 |
-
|
|
3930 |
-/* The `emacs' switch turns on certain matching commands
|
|
3931 |
- that make sense only in Emacs. */
|
|
3932 |
-#ifdef emacs
|
|
3933 |
-
|
|
3934 |
-#include "lisp.h"
|
|
3935 |
-#include "buffer.h"
|
|
3936 |
-#include "syntax.h"
|
|
3937 |
-
|
|
3938 |
-/* Emacs uses `NULL' as a predicate. */
|
|
3939 |
-#undef NULL
|
|
3940 |
-
|
|
3941 |
-#else /* not emacs */
|
|
3942 |
-
|
|
3943 |
-/* We used to test for `BSTRING' here, but only GCC and Emacs define
|
|
3944 |
- `BSTRING', as far as I know, and neither of them use this code. */
|
|
3945 |
-#if HAVE_STRING_H || STDC_HEADERS
|
|
3946 |
-#include <string.h>
|
|
3947 |
-#ifndef bcmp
|
|
3948 |
-#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
|
|
3949 |
-#endif
|
|
3950 |
-#ifndef bcopy
|
|
3951 |
-#define bcopy(s, d, n) memcpy ((d), (s), (n))
|
|
3952 |
-#endif
|
|
3953 |
-#ifndef bzero
|
|
3954 |
-#define bzero(s, n) memset ((s), 0, (n))
|
|
3955 |
-#endif
|
|
3956 |
-#else
|
|
3957 |
-#include <strings.h>
|
|
3958 |
-#endif
|
|
3959 |
-
|
|
3960 |
-#ifdef STDC_HEADERS
|
|
3961 |
-#include <stdlib.h>
|
|
3962 |
-#else
|
|
3963 |
-char *malloc ();
|
|
3964 |
-char *realloc ();
|
|
3965 |
-#endif
|
|
3966 |
-
|
|
3967 |
-
|
|
3968 |
-/* Define the syntax stuff for \<, \>, etc. */
|
|
3969 |
-
|
|
3970 |
-/* This must be nonzero for the wordchar and notwordchar pattern
|
|
3971 |
- commands in re_match_2. */
|
|
3972 |
-#ifndef Sword
|
|
3973 |
-#define Sword 1
|
|
3974 |
-#endif
|
|
3975 |
-
|
|
3976 |
-#ifdef SYNTAX_TABLE
|
|
3977 |
-
|
|
3978 |
-extern char *re_syntax_table;
|
|
3979 |
-
|
|
3980 |
-#else /* not SYNTAX_TABLE */
|
|
3981 |
-
|
|
3982 |
-/* How many characters in the character set. */
|
|
3983 |
-#define CHAR_SET_SIZE 256
|
|
3984 |
-
|
|
3985 |
-static char re_syntax_table[CHAR_SET_SIZE];
|
|
3986 |
-
|
|
3987 |
-static void
|
|
3988 |
-init_syntax_once ()
|
|
3989 |
-{
|
|
3990 |
- register int c;
|
|
3991 |
- static int done = 0;
|
|
3992 |
-
|
|
3993 |
- if (done)
|
|
3994 |
- return;
|
|
3995 |
-
|
|
3996 |
- bzero (re_syntax_table, sizeof re_syntax_table);
|
|
3997 |
-
|
|
3998 |
- for (c = 'a'; c <= 'z'; c++)
|
|
3999 |
- re_syntax_table[c] = Sword;
|
|
4000 |
-
|
|
4001 |
- for (c = 'A'; c <= 'Z'; c++)
|
|
4002 |
- re_syntax_table[c] = Sword;
|
|
4003 |
-
|
|
4004 |
- for (c = '0'; c <= '9'; c++)
|
|
4005 |
- re_syntax_table[c] = Sword;
|
|
4006 |
-
|
|
4007 |
- re_syntax_table['_'] = Sword;
|
|
4008 |
-
|
|
4009 |
- done = 1;
|
|
4010 |
-}
|
|
4011 |
-
|
|
4012 |
-#endif /* not SYNTAX_TABLE */
|
|
4013 |
-
|
|
4014 |
-#define SYNTAX(c) re_syntax_table[c]
|
|
4015 |
-
|
|
4016 |
-#endif /* not emacs */
|
|
4017 |
-
|
|
4018 |
-/* Get the interface, including the syntax bits. */
|
|
4019 |
-#include "regex.h"
|
|
4020 |
-
|
|
4021 |
-/* isalpha etc. are used for the character classes. */
|
|
4022 |
-#include <ctype.h>
|
|
4023 |
-
|
|
4024 |
-#ifndef isascii
|
|
4025 |
-#define isascii(c) 1
|
|
4026 |
-#endif
|
|
4027 |
-
|
|
4028 |
-#ifdef isblank
|
|
4029 |
-#define ISBLANK(c) (isascii (c) && isblank (c))
|
|
4030 |
-#else
|
|
4031 |
-#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
|
4032 |
-#endif
|
|
4033 |
-#ifdef isgraph
|
|
4034 |
-#define ISGRAPH(c) (isascii (c) && isgraph (c))
|
|
4035 |
-#else
|
|
4036 |
-#define ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c))
|
|
4037 |
-#endif
|
|
4038 |
-
|
|
4039 |
-#define ISPRINT(c) (isascii (c) && isprint (c))
|
|
4040 |
-#define ISDIGIT(c) (isascii (c) && isdigit (c))
|
|
4041 |
-#define ISALNUM(c) (isascii (c) && isalnum (c))
|
|
4042 |
-#define ISALPHA(c) (isascii (c) && isalpha (c))
|
|
4043 |
-#define ISCNTRL(c) (isascii (c) && iscntrl (c))
|
|
4044 |
-#define ISLOWER(c) (isascii (c) && islower (c))
|
|
4045 |
-#define ISPUNCT(c) (isascii (c) && ispunct (c))
|
|
4046 |
-#define ISSPACE(c) (isascii (c) && isspace (c))
|
|
4047 |
-#define ISUPPER(c) (isascii (c) && isupper (c))
|
|
4048 |
-#define ISXDIGIT(c) (isascii (c) && isxdigit (c))
|
|
4049 |
-
|
|
4050 |
-#ifndef NULL
|
|
4051 |
-#define NULL 0
|
|
4052 |
-#endif
|
|
4053 |
-
|
|
4054 |
-/* We remove any previous definition of `SIGN_EXTEND_CHAR',
|
|
4055 |
- since ours (we hope) works properly with all combinations of
|
|
4056 |
- machines, compilers, `char' and `unsigned char' argument types.
|
|
4057 |
- (Per Bothner suggested the basic approach.) */
|
|
4058 |
-#undef SIGN_EXTEND_CHAR
|
|
4059 |
-#if __STDC__
|
|
4060 |
-#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
|
|
4061 |
-#else /* not __STDC__ */
|
|
4062 |
-/* As in Harbison and Steele. */
|
|
4063 |
-#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
|
|
4064 |
-#endif
|
|
4065 |
-
|
|
4066 |
-/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
|
|
4067 |
- use `alloca' instead of `malloc'. This is because using malloc in
|
|
4068 |
- re_search* or re_match* could cause memory leaks when C-g is used in
|
|
4069 |
- Emacs; also, malloc is slower and causes storage fragmentation. On
|
|
4070 |
- the other hand, malloc is more portable, and easier to debug.
|
|
4071 |
-
|
|
4072 |
- Because we sometimes use alloca, some routines have to be macros,
|
|
4073 |
- not functions -- `alloca'-allocated space disappears at the end of the
|
|
4074 |
- function it is called in. */
|
|
4075 |
-
|
|
4076 |
-#ifdef REGEX_MALLOC
|
|
4077 |
-
|
|
4078 |
-#define REGEX_ALLOCATE malloc
|
|
4079 |
-#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
|
|
4080 |
-
|
|
4081 |
-#else /* not REGEX_MALLOC */
|
|
4082 |
-
|
|
4083 |
-/* Emacs already defines alloca, sometimes. */
|
|
4084 |
-#ifndef alloca
|
|
4085 |
-
|
|
4086 |
-/* Make alloca work the best possible way. */
|
|
4087 |
-#ifdef __GNUC__
|
|
4088 |
-#define alloca __builtin_alloca
|
|
4089 |
-#else /* not __GNUC__ */
|
|
4090 |
-#if HAVE_ALLOCA_H
|
|
4091 |
-#include <alloca.h>
|
|
4092 |
-#else /* not __GNUC__ or HAVE_ALLOCA_H */
|
|
4093 |
-#ifndef _AIX /* Already did AIX, up at the top. */
|
|
4094 |
-char *alloca ();
|
|
4095 |
-#endif /* not _AIX */
|
|
4096 |
-#endif /* not HAVE_ALLOCA_H */
|
|
4097 |
-#endif /* not __GNUC__ */
|
|
4098 |
-
|
|
4099 |
-#endif /* not alloca */
|
|
4100 |
-
|
|
4101 |
-#define REGEX_ALLOCATE alloca
|
|
4102 |
-
|
|
4103 |
-/* Assumes a `char *destination' variable. */
|
|
4104 |
-#define REGEX_REALLOCATE(source, osize, nsize) \
|
|
4105 |
- (destination = (char *) alloca (nsize), \
|
|
4106 |
- bcopy (source, destination, osize), \
|
|
4107 |
- destination)
|
|
4108 |
-
|
|
4109 |
-#endif /* not REGEX_MALLOC */
|
|
4110 |
-
|
|
4111 |
-
|
|
4112 |
-/* True if `size1' is non-NULL and PTR is pointing anywhere inside
|
|
4113 |
- `string1' or just past its end. This works if PTR is NULL, which is
|
|
4114 |
- a good thing. */
|
|
4115 |
-#define FIRST_STRING_P(ptr) \
|
|
4116 |
- (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
|
|
4117 |
-
|
|
4118 |
-/* (Re)Allocate N items of type T using malloc, or fail. */
|
|
4119 |
-#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
|
|
4120 |
-#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
|
|
4121 |
-#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
|
|
4122 |
-
|
|
4123 |
-#define BYTEWIDTH 8 /* In bits. */
|
|
4124 |
-
|
|
4125 |
-#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
|
|
4126 |
-
|
|
4127 |
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
4128 |
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
4129 |
-
|
|
4130 |
-typedef char boolean;
|
|
4131 |
-#define false 0
|
|
4132 |
-#define true 1
|
|
4133 |
-
|
|
4134 |
-/* These are the command codes that appear in compiled regular
|
|
4135 |
- expressions. Some opcodes are followed by argument bytes. A
|
|
4136 |
- command code can specify any interpretation whatsoever for its
|
|
4137 |
- arguments. Zero bytes may appear in the compiled regular expression.
|
|
4138 |
-
|
|
4139 |
- The value of `exactn' is needed in search.c (search_buffer) in Emacs.
|
|
4140 |
- So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of
|
|
4141 |
- `exactn' we use here must also be 1. */
|
|
4142 |
-
|
|
4143 |
-typedef enum
|
|
4144 |
-{
|
|
4145 |
- no_op = 0,
|
|
4146 |
-
|
|
4147 |
- /* Followed by one byte giving n, then by n literal bytes. */
|
|
4148 |
- exactn = 1,
|
|
4149 |
-
|
|
4150 |
- /* Matches any (more or less) character. */
|
|
4151 |
- anychar,
|
|
4152 |
-
|
|
4153 |
- /* Matches any one char belonging to specified set. First
|
|
4154 |
- following byte is number of bitmap bytes. Then come bytes
|
|
4155 |
- for a bitmap saying which chars are in. Bits in each byte
|
|
4156 |
- are ordered low-bit-first. A character is in the set if its
|
|
4157 |
- bit is 1. A character too large to have a bit in the map is
|
|
4158 |
- automatically not in the set. */
|
|
4159 |
- charset,
|
|
4160 |
-
|
|
4161 |
- /* Same parameters as charset, but match any character that is
|
|
4162 |
- not one of those specified. */
|
|
4163 |
- charset_not,
|
|
4164 |
-
|
|
4165 |
- /* Start remembering the text that is matched, for storing in a
|
|
4166 |
- register. Followed by one byte with the register number, in
|
|
4167 |
- the range 0 to one less than the pattern buffer's re_nsub
|
|
4168 |
- field. Then followed by one byte with the number of groups
|
|
4169 |
- inner to this one. (This last has to be part of the
|
|
4170 |
- start_memory only because we need it in the on_failure_jump
|
|
4171 |
- of re_match_2.) */
|
|
4172 |
- start_memory,
|
|
4173 |
-
|
|
4174 |
- /* Stop remembering the text that is matched and store it in a
|
|
4175 |
- memory register. Followed by one byte with the register
|
|
4176 |
- number, in the range 0 to one less than `re_nsub' in the
|
|
4177 |
- pattern buffer, and one byte with the number of inner groups,
|
|
4178 |
- just like `start_memory'. (We need the number of inner
|
|
4179 |
- groups here because we don't have any easy way of finding the
|
|
4180 |
- corresponding start_memory when we're at a stop_memory.) */
|
|
4181 |
- stop_memory,
|
|
4182 |
-
|
|
4183 |
- /* Match a duplicate of something remembered. Followed by one
|
|
4184 |
- byte containing the register number. */
|
|
4185 |
- duplicate,
|
|
4186 |
-
|
|
4187 |
- /* Fail unless at beginning of line. */
|
|
4188 |
- begline,
|
|
4189 |
-
|
|
4190 |
- /* Fail unless at end of line. */
|
|
4191 |
- endline,
|
|
4192 |
-
|
|
4193 |
- /* Succeeds if at beginning of buffer (if emacs) or at beginning
|
|
4194 |
- of string to be matched (if not). */
|
|
4195 |
- begbuf,
|
|
4196 |
-
|
|
4197 |
- /* Analogously, for end of buffer/string. */
|
|
4198 |
- endbuf,
|
|
4199 |
-
|
|
4200 |
- /* Followed by two byte relative address to which to jump. */
|
|
4201 |
- jump,
|
|
4202 |
-
|
|
4203 |
- /* Same as jump, but marks the end of an alternative. */
|
|
4204 |
- jump_past_alt,
|
|
4205 |
-
|
|
4206 |
- /* Followed by two-byte relative address of place to resume at
|
|
4207 |
- in case of failure. */
|
|
4208 |
- on_failure_jump,
|
|
4209 |
-
|
|
4210 |
- /* Like on_failure_jump, but pushes a placeholder instead of the
|
|
4211 |
- current string position when executed. */
|
|
4212 |
- on_failure_keep_string_jump,
|
|
4213 |
-
|
|
4214 |
- /* Throw away latest failure point and then jump to following
|
|
4215 |
- two-byte relative address. */
|
|
4216 |
- pop_failure_jump,
|
|
4217 |
-
|
|
4218 |
- /* Change to pop_failure_jump if know won't have to backtrack to
|
|
4219 |
- match; otherwise change to jump. This is used to jump
|
|
4220 |
- back to the beginning of a repeat. If what follows this jump
|
|
4221 |
- clearly won't match what the repeat does, such that we can be
|
|
4222 |
- sure that there is no use backtracking out of repetitions
|
|
4223 |
- already matched, then we change it to a pop_failure_jump.
|
|
4224 |
- Followed by two-byte address. */
|
|
4225 |
- maybe_pop_jump,
|
|
4226 |
-
|
|
4227 |
- /* Jump to following two-byte address, and push a dummy failure
|
|
4228 |
- point. This failure point will be thrown away if an attempt
|
|
4229 |
- is made to use it for a failure. A `+' construct makes this
|
|
4230 |
- before the first repeat. Also used as an intermediary kind
|
|
4231 |
- of jump when compiling an alternative. */
|
|
4232 |
- dummy_failure_jump,
|
|
4233 |
-
|
|
4234 |
- /* Push a dummy failure point and continue. Used at the end of
|
|
4235 |
- alternatives. */
|
|
4236 |
- push_dummy_failure,
|
|
4237 |
-
|
|
4238 |
- /* Followed by two-byte relative address and two-byte number n.
|
|
4239 |
- After matching N times, jump to the address upon failure. */
|
|
4240 |
- succeed_n,
|
|
4241 |
-
|
|
4242 |
- /* Followed by two-byte relative address, and two-byte number n.
|
|
4243 |
- Jump to the address N times, then fail. */
|
|
4244 |
- jump_n,
|
|
4245 |
-
|
|
4246 |
- /* Set the following two-byte relative address to the
|
|
4247 |
- subsequent two-byte number. The address *includes* the two
|
|
4248 |
- bytes of number. */
|
|
4249 |
- set_number_at,
|
|
4250 |
-
|
|
4251 |
- wordchar, /* Matches any word-constituent character. */
|
|
4252 |
- notwordchar, /* Matches any char that is not a word-constituent. */
|
|
4253 |
-
|
|
4254 |
- wordbeg, /* Succeeds if at word beginning. */
|
|
4255 |
- wordend, /* Succeeds if at word end. */
|
|
4256 |
-
|
|
4257 |
- wordbound, /* Succeeds if at a word boundary. */
|
|
4258 |
- notwordbound /* Succeeds if not at a word boundary. */
|
|
4259 |
-
|
|
4260 |
-#ifdef emacs
|
|
4261 |
- ,before_dot, /* Succeeds if before point. */
|
|
4262 |
- at_dot, /* Succeeds if at point. */
|
|
4263 |
- after_dot, /* Succeeds if after point. */
|
|
4264 |
-
|
|
4265 |
- /* Matches any character whose syntax is specified. Followed by
|
|
4266 |
- a byte which contains a syntax code, e.g., Sword. */
|
|
4267 |
- syntaxspec,
|
|
4268 |
-
|
|
4269 |
- /* Matches any character whose syntax is not that specified. */
|
|
4270 |
- notsyntaxspec
|
|
4271 |
-#endif /* emacs */
|
|
4272 |
-} re_opcode_t;
|
|
4273 |
-
|
|
4274 |
-/* Common operations on the compiled pattern. */
|
|
4275 |
-
|
|
4276 |
-/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
|
|
4277 |
-
|
|
4278 |
-#define STORE_NUMBER(destination, number) \
|
|
4279 |
- do { \
|
|
4280 |
- (destination)[0] = (number) & 0377; \
|
|
4281 |
- (destination)[1] = (number) >> 8; \
|
|
4282 |
- } while (0)
|
|
4283 |
-
|
|
4284 |
-/* Same as STORE_NUMBER, except increment DESTINATION to
|
|
4285 |
- the byte after where the number is stored. Therefore, DESTINATION
|
|
4286 |
- must be an lvalue. */
|
|
4287 |
-
|
|
4288 |
-#define STORE_NUMBER_AND_INCR(destination, number) \
|
|
4289 |
- do { \
|
|
4290 |
- STORE_NUMBER (destination, number); \
|
|
4291 |
- (destination) += 2; \
|
|
4292 |
- } while (0)
|
|
4293 |
-
|
|
4294 |
-/* Put into DESTINATION a number stored in two contiguous bytes starting
|
|
4295 |
- at SOURCE. */
|
|
4296 |
-
|
|
4297 |
-#define EXTRACT_NUMBER(destination, source) \
|
|
4298 |
- do { \
|
|
4299 |
- (destination) = *(source) & 0377; \
|
|
4300 |
- (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \
|
|
4301 |
- } while (0)
|
|
4302 |
-
|
|
4303 |
-#ifdef DEBUG
|
|
4304 |
-static void
|
|
4305 |
-extract_number (dest, source)
|
|
4306 |
- int *dest;
|
|
4307 |
- unsigned char *source;
|
|
4308 |
-{
|
|
4309 |
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
|
|
4310 |
- *dest = *source & 0377;
|
|
4311 |
- *dest += temp << 8;
|
|
4312 |
-}
|
|
4313 |
-
|
|
4314 |
-#ifndef EXTRACT_MACROS /* To debug the macros. */
|
|
4315 |
-#undef EXTRACT_NUMBER
|
|
4316 |
-#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
|
|
4317 |
-#endif /* not EXTRACT_MACROS */
|
|
4318 |
-
|
|
4319 |
-#endif /* DEBUG */
|
|
4320 |
-
|
|
4321 |
-/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
|
|
4322 |
- SOURCE must be an lvalue. */
|
|
4323 |
-
|
|
4324 |
-#define EXTRACT_NUMBER_AND_INCR(destination, source) \
|
|
4325 |
- do { \
|
|
4326 |
- EXTRACT_NUMBER (destination, source); \
|
|
4327 |
- (source) += 2; \
|
|
4328 |
- } while (0)
|
|
4329 |
-
|
|
4330 |
-#ifdef DEBUG
|
|
4331 |
-static void
|
|
4332 |
-extract_number_and_incr (destination, source)
|
|
4333 |
- int *destination;
|
|
4334 |
- unsigned char **source;
|
|
4335 |
-{
|
|
4336 |
- extract_number (destination, *source);
|
|
4337 |
- *source += 2;
|
|
4338 |
-}
|
|
4339 |
-
|
|
4340 |
-#ifndef EXTRACT_MACROS
|
|
4341 |
-#undef EXTRACT_NUMBER_AND_INCR
|
|
4342 |
-#define EXTRACT_NUMBER_AND_INCR(dest, src) \
|
|
4343 |
- extract_number_and_incr (&dest, &src)
|
|
4344 |
-#endif /* not EXTRACT_MACROS */
|
|
4345 |
-
|
|
4346 |
-#endif /* DEBUG */
|
|
4347 |
-
|
|
4348 |
-/* If DEBUG is defined, Regex prints many voluminous messages about what
|
|
4349 |
- it is doing (if the variable `debug' is nonzero). If linked with the
|
|
4350 |
- main program in `iregex.c', you can enter patterns and strings
|
|
4351 |
- interactively. And if linked with the main program in `main.c' and
|
|
4352 |
- the other test files, you can run the already-written tests. */
|
|
4353 |
-
|
|
4354 |
-#ifdef DEBUG
|
|
4355 |
-
|
|
4356 |
-/* We use standard I/O for debugging. */
|
|
4357 |
-#include <stdio.h>
|
|
4358 |
-
|
|
4359 |
-/* It is useful to test things that ``must'' be true when debugging. */
|
|
4360 |
-#include <assert.h>
|
|
4361 |
-
|
|
4362 |
-static int debug = 0;
|
|
4363 |
-
|
|
4364 |
-#define DEBUG_STATEMENT(e) e
|
|
4365 |
-#define DEBUG_PRINT1(x) if (debug) printf (x)
|
|
4366 |
-#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
|
|
4367 |
-#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
|
|
4368 |
-#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
|
|
4369 |
-#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
|
|
4370 |
- if (debug) print_partial_compiled_pattern (s, e)
|
|
4371 |
-#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
|
|
4372 |
- if (debug) print_double_string (w, s1, sz1, s2, sz2)
|
|
4373 |
-
|
|
4374 |
-
|
|
4375 |
-//extern void printchar ();
|
|
4376 |
-void printchar( int i ) {}
|
|
4377 |
-
|
|
4378 |
-/* Print the fastmap in human-readable form. */
|
|
4379 |
-
|
|
4380 |
-void
|
|
4381 |
-print_fastmap (fastmap)
|
|
4382 |
- char *fastmap;
|
|
4383 |
-{
|
|
4384 |
- unsigned was_a_range = 0;
|
|
4385 |
- unsigned i = 0;
|
|
4386 |
-
|
|
4387 |
- while (i < (1 << BYTEWIDTH))
|
|
4388 |
- {
|
|
4389 |
- if (fastmap[i++])
|
|
4390 |
- {
|
|
4391 |
- was_a_range = 0;
|
|
4392 |
- printchar (i - 1);
|
|
4393 |
- while (i < (1 << BYTEWIDTH) && fastmap[i])
|
|
4394 |
- {
|
|
4395 |
- was_a_range = 1;
|
|
4396 |
- i++;
|
|
4397 |
- }
|
|
4398 |
- if (was_a_range)
|
|
4399 |
- {
|
|
4400 |
- printf ("-");
|
|
4401 |
- printchar (i - 1);
|
|
4402 |
- }
|
|
4403 |
- }
|
|
4404 |
- }
|
|
4405 |
- putchar ('\n');
|
|
4406 |
-}
|
|
4407 |
-
|
|
4408 |
-
|
|
4409 |
-/* Print a compiled pattern string in human-readable form, starting at
|
|
4410 |
- the START pointer into it and ending just before the pointer END. */
|
|
4411 |
-
|
|
4412 |
-void
|
|
4413 |
-print_partial_compiled_pattern (start, end)
|
|
4414 |
- unsigned char *start;
|
|
4415 |
- unsigned char *end;
|
|
4416 |
-{
|
|
4417 |
- int mcnt, mcnt2;
|
|
4418 |
- unsigned char *p = start;
|
|
4419 |
- unsigned char *pend = end;
|
|
4420 |
-
|
|
4421 |
- if (start == NULL)
|
|
4422 |
- {
|
|
4423 |
- printf ("(null)\n");
|
|
4424 |
- return;
|
|
4425 |
- }
|
|
4426 |
-
|
|
4427 |
- /* Loop over pattern commands. */
|
|
4428 |
- while (p < pend)
|
|
4429 |
- {
|
|
4430 |
- switch ((re_opcode_t) *p++)
|
|
4431 |
- {
|
|
4432 |
- case no_op:
|
|
4433 |
- printf ("/no_op");
|
|
4434 |
- break;
|
|
4435 |
-
|
|
4436 |
- case exactn:
|
|
4437 |
- mcnt = *p++;
|
|
4438 |
- printf ("/exactn/%d", mcnt);
|
|
4439 |
- do
|
|
4440 |
- {
|
|
4441 |
- putchar ('/');
|
|
4442 |
- printchar (*p++);
|
|
4443 |
- }
|
|
4444 |
- while (--mcnt);
|
|
4445 |
- break;
|
|
4446 |
-
|
|
4447 |
- case start_memory:
|
|
4448 |
- mcnt = *p++;
|
|
4449 |
- printf ("/start_memory/%d/%d", mcnt, *p++);
|
|
4450 |
- break;
|
|
4451 |
-
|
|
4452 |
- case stop_memory:
|
|
4453 |
- mcnt = *p++;
|
|
4454 |
- printf ("/stop_memory/%d/%d", mcnt, *p++);
|
|
4455 |
- break;
|
|
4456 |
-
|
|
4457 |
- case duplicate:
|
|
4458 |
- printf ("/duplicate/%d", *p++);
|
|
4459 |
- break;
|
|
4460 |
-
|
|
4461 |
- case anychar:
|
|
4462 |
- printf ("/anychar");
|
|
4463 |
- break;
|
|
4464 |
-
|
|
4465 |
- case charset:
|
|
4466 |
- case charset_not:
|
|
4467 |
- {
|
|
4468 |
- register int c;
|
|
4469 |
-
|
|
4470 |
- printf ("/charset%s",
|
|
4471 |
- (re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
|
|
4472 |
-
|
|
4473 |
- assert (p + *p < pend);
|
|
4474 |
-
|
|
4475 |
- for (c = 0; c < *p; c++)
|
|
4476 |
- {
|
|
4477 |
- unsigned bit;
|
|
4478 |
- unsigned char map_byte = p[1 + c];
|
|
4479 |
-
|
|
4480 |
- putchar ('/');
|
|
4481 |
-
|
|
4482 |
- for (bit = 0; bit < BYTEWIDTH; bit++)
|
|
4483 |
- if (map_byte & (1 << bit))
|
|
4484 |
- printchar (c * BYTEWIDTH + bit);
|
|
4485 |
- }
|
|
4486 |
- p += 1 + *p;
|
|
4487 |
- break;
|
|
4488 |
- }
|
|
4489 |
-
|
|
4490 |
- case begline:
|
|
4491 |
- printf ("/begline");
|
|
4492 |
- break;
|
|
4493 |
-
|
|
4494 |
- case endline:
|
|
4495 |
- printf ("/endline");
|
|
4496 |
- break;
|
|
4497 |
-
|
|
4498 |
- case on_failure_jump:
|
|
4499 |
- extract_number_and_incr (&mcnt, &p);
|
|
4500 |
- printf ("/on_failure_jump/0/%d", mcnt);
|
|
4501 |
- break;
|
|
4502 |
-
|
|
4503 |
- case on_failure_keep_string_jump:
|
|
4504 |
- extract_number_and_incr (&mcnt, &p);
|
|
4505 |
- printf ("/on_failure_keep_string_jump/0/%d", mcnt);
|
|
4506 |
- break;
|
|
4507 |
-
|
|
4508 |
- case dummy_failure_jump:
|
|
4509 |
- extract_number_and_incr (&mcnt, &p);
|
|
4510 |
- printf ("/dummy_failure_jump/0/%d", mcnt);
|
|
4511 |
- break;
|
|
4512 |
-
|
|
4513 |
- case push_dummy_failure:
|
|
4514 |
- printf ("/push_dummy_failure");
|
|
4515 |
- break;
|
|
4516 |
-
|
|
4517 |
- case maybe_pop_jump:
|
|
4518 |
- extract_number_and_incr (&mcnt, &p);
|
|
4519 |
- printf ("/maybe_pop_jump/0/%d", mcnt);
|
|
4520 |
- break;
|
|
4521 |
-
|
|
4522 |
- case pop_failure_jump:
|
|
4523 |
- extract_number_and_incr (&mcnt, &p);
|
|
4524 |
- printf ("/pop_failure_jump/0/%d", mcnt);
|
|
4525 |
- break;
|
|
4526 |
-
|
|
4527 |
- case jump_past_alt:
|
|
4528 |
- extract_number_and_incr (&mcnt, &p);
|
|
4529 |
- printf ("/jump_past_alt/0/%d", mcnt);
|
|
4530 |
- break;
|
|
4531 |
-
|
|
4532 |
- case jump:
|
|
4533 |
- extract_number_and_incr (&mcnt, &p);
|
|
4534 |
- printf ("/jump/0/%d", mcnt);
|
|
4535 |
- break;
|
|
4536 |
-
|
|
4537 |
- case succeed_n:
|
|
4538 |
- extract_number_and_incr (&mcnt, &p);
|
|
4539 |
- extract_number_and_incr (&mcnt2, &p);
|
|
4540 |
- printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
|
|
4541 |
- break;
|
|
4542 |
-
|
|
4543 |
- case jump_n:
|
|
4544 |
- extract_number_and_incr (&mcnt, &p);
|
|
4545 |
- extract_number_and_incr (&mcnt2, &p);
|
|
4546 |
- printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
|
|
4547 |
- break;
|
|
4548 |
-
|
|
4549 |
- case set_number_at:
|
|
4550 |
- extract_number_and_incr (&mcnt, &p);
|
|
4551 |
- extract_number_and_incr (&mcnt2, &p);
|
|
4552 |
- printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
|
|
4553 |
- break;
|
|
4554 |
-
|
|
4555 |
- case wordbound:
|
|
4556 |
- printf ("/wordbound");
|
|
4557 |
- break;
|
|
4558 |
-
|
|
4559 |
- case notwordbound:
|
|
4560 |
- printf ("/notwordbound");
|
|
4561 |
- break;
|
|
4562 |
-
|
|
4563 |
- case wordbeg:
|
|
4564 |
- printf ("/wordbeg");
|
|
4565 |
- break;
|
|
4566 |
-
|
|
4567 |
- case wordend:
|
|
4568 |
- printf ("/wordend");
|
|
4569 |
-
|
|
4570 |
-#ifdef emacs
|
|
4571 |
- case before_dot:
|
|
4572 |
- printf ("/before_dot");
|
|
4573 |
- break;
|
|
4574 |
-
|
|
4575 |
- case at_dot:
|
|
4576 |
- printf ("/at_dot");
|
|
4577 |
- break;
|
|
4578 |
-
|
|
4579 |
- case after_dot:
|
|
4580 |
- printf ("/after_dot");
|
|
4581 |
- break;
|
|
4582 |
-
|
|
4583 |
- case syntaxspec:
|
|
4584 |
- printf ("/syntaxspec");
|
|
4585 |
- mcnt = *p++;
|
|
4586 |
- printf ("/%d", mcnt);
|
|
4587 |
- break;
|
|
4588 |
-
|
|
4589 |
- case notsyntaxspec:
|
|
4590 |
- printf ("/notsyntaxspec");
|
|
4591 |
- mcnt = *p++;
|
|
4592 |
- printf ("/%d", mcnt);
|
|
4593 |
- break;
|
|
4594 |
-#endif /* emacs */
|
|
4595 |
-
|
|
4596 |
- case wordchar:
|
|
4597 |
- printf ("/wordchar");
|
|
4598 |
- break;
|
|
4599 |
-
|
|
4600 |
- case notwordchar:
|
|
4601 |
- printf ("/notwordchar");
|
|
4602 |
- break;
|
|
4603 |
-
|
|
4604 |
- case begbuf:
|
|
4605 |
- printf ("/begbuf");
|
|
4606 |
- break;
|
|
4607 |
-
|
|
4608 |
- case endbuf:
|
|
4609 |
- printf ("/endbuf");
|
|
4610 |
- break;
|
|
4611 |
-
|
|
4612 |
- default:
|
|
4613 |
- printf ("?%d", *(p-1));
|
|
4614 |
- }
|
|
4615 |
- }
|
|
4616 |
- printf ("/\n");
|
|
4617 |
-}
|
|
4618 |
-
|
|
4619 |
-
|
|
4620 |
-void
|
|
4621 |
-print_compiled_pattern (bufp)
|
|
4622 |
- struct re_pattern_buffer *bufp;
|
|
4623 |
-{
|
|
4624 |
- unsigned char *buffer = bufp->buffer;
|
|
4625 |
-
|
|
4626 |
- print_partial_compiled_pattern (buffer, buffer + bufp->used);
|
|
4627 |
- printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
|
|
4628 |
-
|
|
4629 |
- if (bufp->fastmap_accurate && bufp->fastmap)
|
|
4630 |
- {
|
|
4631 |
- printf ("fastmap: ");
|
|
4632 |
- print_fastmap (bufp->fastmap);
|
|
4633 |
- }
|
|
4634 |
-
|
|
4635 |
- printf ("re_nsub: %d\t", bufp->re_nsub);
|
|
4636 |
- printf ("regs_alloc: %d\t", bufp->regs_allocated);
|
|
4637 |
- printf ("can_be_null: %d\t", bufp->can_be_null);
|
|
4638 |
- printf ("newline_anchor: %d\n", bufp->newline_anchor);
|
|
4639 |
- printf ("no_sub: %d\t", bufp->no_sub);
|
|
4640 |
- printf ("not_bol: %d\t", bufp->not_bol);
|
|
4641 |
- printf ("not_eol: %d\t", bufp->not_eol);
|
|
4642 |
- printf ("syntax: %d\n", bufp->syntax);
|
|
4643 |
- /* Perhaps we should print the translate table? */
|
|
4644 |
-}
|
|
4645 |
-
|
|
4646 |
-
|
|
4647 |
-void
|
|
4648 |
-print_double_string (where, string1, size1, string2, size2)
|
|
4649 |
- const char *where;
|
|
4650 |
- const char *string1;
|
|
4651 |
- const char *string2;
|
|
4652 |
- int size1;
|
|
4653 |
- int size2;
|
|
4654 |
-{
|
|
4655 |
- unsigned this_char;
|
|
4656 |
-
|
|
4657 |
- if (where == NULL)
|
|
4658 |
- printf ("(null)");
|
|
4659 |
- else
|
|
4660 |
- {
|
|
4661 |
- if (FIRST_STRING_P (where))
|
|
4662 |
- {
|
|
4663 |
- for (this_char = where - string1; this_char < size1; this_char++)
|
|
4664 |
- printchar (string1[this_char]);
|
|
4665 |
-
|
|
4666 |
- where = string2;
|
|
4667 |
- }
|
|
4668 |
-
|
|
4669 |
- for (this_char = where - string2; this_char < size2; this_char++)
|
|
4670 |
- printchar (string2[this_char]);
|
|
4671 |
- }
|
|
4672 |
-}
|
|
4673 |
-
|
|
4674 |
-#else /* not DEBUG */
|
|
4675 |
-
|
|
4676 |
-#undef assert
|
|
4677 |
-#define assert(e)
|
|
4678 |
-
|
|
4679 |
-#define DEBUG_STATEMENT(e)
|
|
4680 |
-#define DEBUG_PRINT1(x)
|
|
4681 |
-#define DEBUG_PRINT2(x1, x2)
|
|
4682 |
-#define DEBUG_PRINT3(x1, x2, x3)
|
|
4683 |
-#define DEBUG_PRINT4(x1, x2, x3, x4)
|
|
4684 |
-#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
|
|
4685 |
-#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
|
|
4686 |
-
|
|
4687 |
-#endif /* not DEBUG */
|
|
4688 |
-
|
|
4689 |
-/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
|
|
4690 |
- also be assigned to arbitrarily: each pattern buffer stores its own
|
|
4691 |
- syntax, so it can be changed between regex compilations. */
|
|
4692 |
-reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS;
|
|
4693 |
-
|
|
4694 |
-
|
|
4695 |
-/* Specify the precise syntax of regexps for compilation. This provides
|
|
4696 |
- for compatibility for various utilities which historically have
|
|
4697 |
- different, incompatible syntaxes.
|
|
4698 |
-
|
|
4699 |
- The argument SYNTAX is a bit mask comprised of the various bits
|
|
4700 |
- defined in regex.h. We return the old syntax. */
|
|
4701 |
-
|
|
4702 |
-reg_syntax_t
|
|
4703 |
-re_set_syntax (syntax)
|
|
4704 |
- reg_syntax_t syntax;
|
|
4705 |
-{
|
|
4706 |
- reg_syntax_t ret = re_syntax_options;
|
|
4707 |
-
|
|
4708 |
- re_syntax_options = syntax;
|
|
4709 |
- return ret;
|
|
4710 |
-}
|
|
4711 |
-
|
|
4712 |
-/* This table gives an error message for each of the error codes listed
|
|
4713 |
- in regex.h. Obviously the order here has to be same as there. */
|
|
4714 |
-
|
|
4715 |
-static const char *re_error_msg[] =
|
|
4716 |
- { NULL, /* REG_NOERROR */
|
|
4717 |
- "No match", /* REG_NOMATCH */
|
|
4718 |
- "Invalid regular expression", /* REG_BADPAT */
|
|
4719 |
- "Invalid collation character", /* REG_ECOLLATE */
|
|
4720 |
- "Invalid character class name", /* REG_ECTYPE */
|
|
4721 |
- "Trailing backslash", /* REG_EESCAPE */
|
|
4722 |
- "Invalid back reference", /* REG_ESUBREG */
|
|
4723 |
- "Unmatched [ or [^", /* REG_EBRACK */
|
|
4724 |
- "Unmatched ( or \\(", /* REG_EPAREN */
|
|
4725 |
- "Unmatched \\{", /* REG_EBRACE */
|
|
4726 |
- "Invalid content of \\{\\}", /* REG_BADBR */
|
|
4727 |
- "Invalid range end", /* REG_ERANGE */
|
|
4728 |
- "Memory exhausted", /* REG_ESPACE */
|
|
4729 |
- "Invalid preceding regular expression", /* REG_BADRPT */
|
|
4730 |
- "Premature end of regular expression", /* REG_EEND */
|
|
4731 |
- "Regular expression too big", /* REG_ESIZE */
|
|
4732 |
- "Unmatched ) or \\)", /* REG_ERPAREN */
|
|
4733 |
- };
|
|
4734 |
-
|
|
4735 |
-/* Subroutine declarations and macros for regex_compile. */
|
|
4736 |
-
|
|
4737 |
-static void store_op1 (), store_op2 ();
|
|
4738 |
-static void insert_op1 (), insert_op2 ();
|
|
4739 |
-static boolean at_begline_loc_p (), at_endline_loc_p ();
|
|
4740 |
-static boolean group_in_compile_stack ();
|
|
4741 |
-static reg_errcode_t compile_range ();
|
|
4742 |
-
|
|
4743 |
-/* Fetch the next character in the uncompiled pattern---translating it
|
|
4744 |
- if necessary. Also cast from a signed character in the constant
|
|
4745 |
- string passed to us by the user to an unsigned char that we can use
|
|
4746 |
- as an array index (in, e.g., `translate'). */
|
|
4747 |
-#define PATFETCH(c) \
|
|
4748 |
- do {if (p == pend) return REG_EEND; \
|
|
4749 |
- c = (unsigned char) *p++; \
|
|
4750 |
- if (translate) c = translate[c]; \
|
|
4751 |
- } while (0)
|
|
4752 |
-
|
|
4753 |
-/* Fetch the next character in the uncompiled pattern, with no
|
|
4754 |
- translation. */
|
|
4755 |
-#define PATFETCH_RAW(c) \
|
|
4756 |
- do {if (p == pend) return REG_EEND; \
|
|
4757 |
- c = (unsigned char) *p++; \
|
|
4758 |
- } while (0)
|
|
4759 |
-
|
|
4760 |
-/* Go backwards one character in the pattern. */
|
|
4761 |
-#define PATUNFETCH p--
|
|
4762 |
-
|
|
4763 |
-
|
|
4764 |
-/* If `translate' is non-null, return translate[D], else just D. We
|
|
4765 |
- cast the subscript to translate because some data is declared as
|
|
4766 |
- `char *', to avoid warnings when a string constant is passed. But
|
|
4767 |
- when we use a character as a subscript we must make it unsigned. */
|
|
4768 |
-#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d))
|
|
4769 |
-
|
|
4770 |
-
|
|
4771 |
-/* Macros for outputting the compiled pattern into `buffer'. */
|
|
4772 |
-
|
|
4773 |
-/* If the buffer isn't allocated when it comes in, use this. */
|
|
4774 |
-#define INIT_BUF_SIZE 32
|
|
4775 |
-
|
|
4776 |
-/* Make sure we have at least N more bytes of space in buffer. */
|
|
4777 |
-#define GET_BUFFER_SPACE(n) \
|
|
4778 |
- while (b - bufp->buffer + (n) > bufp->allocated) \
|
|
4779 |
- EXTEND_BUFFER ()
|
|
4780 |
-
|
|
4781 |
-/* Make sure we have one more byte of buffer space and then add C to it. */
|
|
4782 |
-#define BUF_PUSH(c) \
|
|
4783 |
- do { \
|
|
4784 |
- GET_BUFFER_SPACE (1); \
|
|
4785 |
- *b++ = (unsigned char) (c); \
|
|
4786 |
- } while (0)
|
|
4787 |
-
|
|
4788 |
-
|
|
4789 |
-/* Ensure we have two more bytes of buffer space and then append C1 and C2. */
|
|
4790 |
-#define BUF_PUSH_2(c1, c2) \
|
|
4791 |
- do { \
|
|
4792 |
- GET_BUFFER_SPACE (2); \
|
|
4793 |
- *b++ = (unsigned char) (c1); \
|
|
4794 |
- *b++ = (unsigned char) (c2); \
|
|
4795 |
- } while (0)
|
|
4796 |
-
|
|
4797 |
-
|
|
4798 |
-/* As with BUF_PUSH_2, except for three bytes. */
|
|
4799 |
-#define BUF_PUSH_3(c1, c2, c3) \
|
|
4800 |
- do { \
|
|
4801 |
- GET_BUFFER_SPACE (3); \
|
|
4802 |
- *b++ = (unsigned char) (c1); \
|
|
4803 |
- *b++ = (unsigned char) (c2); \
|
|
4804 |
- *b++ = (unsigned char) (c3); \
|
|
4805 |
- } while (0)
|
|
4806 |
-
|
|
4807 |
-
|
|
4808 |
-/* Store a jump with opcode OP at LOC to location TO. We store a
|
|
4809 |
- relative address offset by the three bytes the jump itself occupies. */
|
|
4810 |
-#define STORE_JUMP(op, loc, to) \
|
|
4811 |
- store_op1 (op, loc, (to) - (loc) - 3)
|
|
4812 |
-
|
|
4813 |
-/* Likewise, for a two-argument jump. */
|
|
4814 |
-#define STORE_JUMP2(op, loc, to, arg) \
|
|
4815 |
- store_op2 (op, loc, (to) - (loc) - 3, arg)
|
|
4816 |
-
|
|
4817 |
-/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
|
|
4818 |
-#define INSERT_JUMP(op, loc, to) \
|
|
4819 |
- insert_op1 (op, loc, (to) - (loc) - 3, b)
|
|
4820 |
-
|
|
4821 |
-/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
|
|
4822 |
-#define INSERT_JUMP2(op, loc, to, arg) \
|
|
4823 |
- insert_op2 (op, loc, (to) - (loc) - 3, arg, b)
|
|
4824 |
-
|
|
4825 |
-
|
|
4826 |
-/* This is not an arbitrary limit: the arguments which represent offsets
|
|
4827 |
- into the pattern are two bytes long. So if 2^16 bytes turns out to
|
|
4828 |
- be too small, many things would have to change. */
|
|
4829 |
-#define MAX_BUF_SIZE (1L << 16)
|
|
4830 |
-
|
|
4831 |
-
|
|
4832 |
-/* Extend the buffer by twice its current size via realloc and
|
|
4833 |
- reset the pointers that pointed into the old block to point to the
|
|
4834 |
- correct places in the new one. If extending the buffer results in it
|
|
4835 |
- being larger than MAX_BUF_SIZE, then flag memory exhausted. */
|
|
4836 |
-#define EXTEND_BUFFER() \
|
|
4837 |
- do { \
|
|
4838 |
- unsigned char *old_buffer = bufp->buffer; \
|
|
4839 |
- if (bufp->allocated == MAX_BUF_SIZE) \
|
|
4840 |
- return REG_ESIZE; \
|
|
4841 |
- bufp->allocated <<= 1; \
|
|
4842 |
- if (bufp->allocated > MAX_BUF_SIZE) \
|
|
4843 |
- bufp->allocated = MAX_BUF_SIZE; \
|
|
4844 |
- bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\
|
|
4845 |
- if (bufp->buffer == NULL) \
|
|
4846 |
- return REG_ESPACE; \
|
|
4847 |
- /* If the buffer moved, move all the pointers into it. */ \
|
|
4848 |
- if (old_buffer != bufp->buffer) \
|
|
4849 |
- { \
|
|
4850 |
- b = (b - old_buffer) + bufp->buffer; \
|
|
4851 |
- begalt = (begalt - old_buffer) + bufp->buffer; \
|
|
4852 |
- if (fixup_alt_jump) \
|
|
4853 |
- fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
|
|
4854 |
- if (laststart) \
|
|
4855 |
- laststart = (laststart - old_buffer) + bufp->buffer; \
|
|
4856 |
- if (pending_exact) \
|
|
4857 |
- pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
|
|
4858 |
- } \
|
|
4859 |
- } while (0)
|
|
4860 |
-
|
|
4861 |
-
|
|
4862 |
-/* Since we have one byte reserved for the register number argument to
|
|
4863 |
- {start,stop}_memory, the maximum number of groups we can report
|
|
4864 |
- things about is what fits in that byte. */
|
|
4865 |
-#define MAX_REGNUM 255
|
|
4866 |
-
|
|
4867 |
-/* But patterns can have more than `MAX_REGNUM' registers. We just
|
|
4868 |
- ignore the excess. */
|
|
4869 |
-typedef unsigned regnum_t;
|
|
4870 |
-
|
|
4871 |
-
|
|
4872 |
-/* Macros for the compile stack. */
|
|
4873 |
-
|
|
4874 |
-/* Since offsets can go either forwards or backwards, this type needs to
|
|
4875 |
- be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
|
|
4876 |
-typedef int pattern_offset_t;
|
|
4877 |
-
|
|
4878 |
-typedef struct
|
|
4879 |
-{
|
|
4880 |
- pattern_offset_t begalt_offset;
|
|
4881 |
- pattern_offset_t fixup_alt_jump;
|
|
4882 |
- pattern_offset_t inner_group_offset;
|
|
4883 |
- pattern_offset_t laststart_offset;
|
|
4884 |
- regnum_t regnum;
|
|
4885 |
-} compile_stack_elt_t;
|
|
4886 |
-
|
|
4887 |
-
|
|
4888 |
-typedef struct
|
|
4889 |
-{
|
|
4890 |
- compile_stack_elt_t *stack;
|
|
4891 |
- unsigned size;
|
|
4892 |
- unsigned avail; /* Offset of next open position. */
|
|
4893 |
-} compile_stack_type;
|
|
4894 |
-
|
|
4895 |
-
|
|
4896 |
-#define INIT_COMPILE_STACK_SIZE 32
|
|
4897 |
-
|
|
4898 |
-#define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
|
|
4899 |
-#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size)
|
|
4900 |
-
|
|
4901 |
-/* The next available element. */
|
|
4902 |
-#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
|
|
4903 |
-
|
|
4904 |
-
|
|
4905 |
-/* Set the bit for character C in a list. */
|
|
4906 |
-#define SET_LIST_BIT(c) \
|
|
4907 |
- (b[((unsigned char) (c)) / BYTEWIDTH] \
|
|
4908 |
- |= 1 << (((unsigned char) c) % BYTEWIDTH))
|
|
4909 |
-
|
|
4910 |
-
|
|
4911 |
-/* Get the next unsigned number in the uncompiled pattern. */
|
|
4912 |
-#define GET_UNSIGNED_NUMBER(num) \
|
|
4913 |
- { if (p != pend) \
|
|
4914 |
- { \
|
|
4915 |
- PATFETCH (c); \
|
|
4916 |
- while (ISDIGIT (c)) \
|
|
4917 |
- { \
|
|
4918 |
- if (num < 0) \
|
|
4919 |
- num = 0; \
|
|
4920 |
- num = num * 10 + c - '0'; \
|
|
4921 |
- if (p == pend) \
|
|
4922 |
- break; \
|
|
4923 |
- PATFETCH (c); \
|
|
4924 |
- } \
|
|
4925 |
- } \
|
|
4926 |
- }
|
|
4927 |
-
|
|
4928 |
-#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
|
|
4929 |
-
|
|
4930 |
-#define IS_CHAR_CLASS(string) \
|
|
4931 |
- (STREQ (string, "alpha") || STREQ (string, "upper") \
|
|
4932 |
- || STREQ (string, "lower") || STREQ (string, "digit") \
|
|
4933 |
- || STREQ (string, "alnum") || STREQ (string, "xdigit") \
|
|
4934 |
- || STREQ (string, "space") || STREQ (string, "print") \
|
|
4935 |
- || STREQ (string, "punct") || STREQ (string, "graph") \
|
|
4936 |
- || STREQ (string, "cntrl") || STREQ (string, "blank"))
|
|
4937 |
-
|
|
4938 |
-/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
|
|
4939 |
- Returns one of error codes defined in `regex.h', or zero for success.
|
|
4940 |
-
|
|
4941 |
- Assumes the `allocated' (and perhaps `buffer') and `translate'
|
|
4942 |
- fields are set in BUFP on entry.
|
|
4943 |
-
|
|
4944 |
- If it succeeds, results are put in BUFP (if it returns an error, the
|
|
4945 |
- contents of BUFP are undefined):
|
|
4946 |
- `buffer' is the compiled pattern;
|
|
4947 |
- `syntax' is set to SYNTAX;
|
|
4948 |
- `used' is set to the length of the compiled pattern;
|
|
4949 |
- `fastmap_accurate' is zero;
|
|
4950 |
- `re_nsub' is the number of subexpressions in PATTERN;
|
|
4951 |
- `not_bol' and `not_eol' are zero;
|
|
4952 |
-
|
|
4953 |
- The `fastmap' and `newline_anchor' fields are neither
|
|
4954 |
- examined nor set. */
|
|
4955 |
-
|
|
4956 |
-static reg_errcode_t
|
|
4957 |
-regex_compile (pattern, size, syntax, bufp)
|
|
4958 |
- const char *pattern;
|
|
4959 |
- int size;
|
|
4960 |
- reg_syntax_t syntax;
|
|
4961 |
- struct re_pattern_buffer *bufp;
|
|
4962 |
-{
|
|
4963 |
- /* We fetch characters from PATTERN here. Even though PATTERN is
|
|
4964 |
- `char *' (i.e., signed), we declare these variables as unsigned, so
|
|
4965 |
- they can be reliably used as array indices. */
|
|
4966 |
- register unsigned char c, c1;
|
|
4967 |
-
|
|
4968 |
- /* A random tempory spot in PATTERN. */
|
|
4969 |
- const char *p1;
|
|
4970 |
-
|
|
4971 |
- /* Points to the end of the buffer, where we should append. */
|
|
4972 |
- register unsigned char *b;
|
|
4973 |
-
|
|
4974 |
- /* Keeps track of unclosed groups. */
|
|
4975 |
- compile_stack_type compile_stack;
|
|
4976 |
-
|
|
4977 |
- /* Points to the current (ending) position in the pattern. */
|
|
4978 |
- const char *p = pattern;
|
|
4979 |
- const char *pend = pattern + size;
|
|
4980 |
-
|
|
4981 |
- /* How to translate the characters in the pattern. */
|
|
4982 |
- char *translate = bufp->translate;
|
|
4983 |
-
|
|
4984 |
- /* Address of the count-byte of the most recently inserted `exactn'
|
|
4985 |
- command. This makes it possible to tell if a new exact-match
|
|
4986 |
- character can be added to that command or if the character requires
|
|
4987 |
- a new `exactn' command. */
|
|
4988 |
- unsigned char *pending_exact = 0;
|
|
4989 |
-
|
|
4990 |
- /* Address of start of the most recently finished expression.
|
|
4991 |
- This tells, e.g., postfix * where to find the start of its
|
|
4992 |
- operand. Reset at the beginning of groups and alternatives. */
|
|
4993 |
- unsigned char *laststart = 0;
|
|
4994 |
-
|
|
4995 |
- /* Address of beginning of regexp, or inside of last group. */
|
|
4996 |
- unsigned char *begalt;
|
|
4997 |
-
|
|
4998 |
- /* Place in the uncompiled pattern (i.e., the {) to
|
|
4999 |
- which to go back if the interval is invalid. */
|
|
5000 |
- const char *beg_interval;
|
|
5001 |
-
|
|
5002 |
- /* Address of the place where a forward jump should go to the end of
|
|
5003 |
- the containing expression. Each alternative of an `or' -- except the
|
|
5004 |
- last -- ends with a forward jump of this sort. */
|
|
5005 |
- unsigned char *fixup_alt_jump = 0;
|
|
5006 |
-
|
|
5007 |
- /* Counts open-groups as they are encountered. Remembered for the
|
|
5008 |
- matching close-group on the compile stack, so the same register
|
|
5009 |
- number is put in the stop_memory as the start_memory. */
|
|
5010 |
- regnum_t regnum = 0;
|
|
5011 |
-
|
|
5012 |
-#ifdef DEBUG
|
|
5013 |
- DEBUG_PRINT1 ("\nCompiling pattern: ");
|
|
5014 |
- if (debug)
|
|
5015 |
- {
|
|
5016 |
- unsigned debug_count;
|
|
5017 |
-
|
|
5018 |
- for (debug_count = 0; debug_count < size; debug_count++)
|
|
5019 |
- printchar (pattern[debug_count]);
|
|
5020 |
- putchar ('\n');
|
|
5021 |
- }
|
|
5022 |
-#endif /* DEBUG */
|
|
5023 |
-
|
|
5024 |
- /* Initialize the compile stack. */
|
|
5025 |
- compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
|
|
5026 |
- if (compile_stack.stack == NULL)
|
|
5027 |
- return REG_ESPACE;
|
|
5028 |
-
|
|
5029 |
- compile_stack.size = INIT_COMPILE_STACK_SIZE;
|
|
5030 |
- compile_stack.avail = 0;
|
|
5031 |
-
|
|
5032 |
- /* Initialize the pattern buffer. */
|
|
5033 |
- bufp->syntax = syntax;
|
|
5034 |
- bufp->fastmap_accurate = 0;
|
|
5035 |
- bufp->not_bol = bufp->not_eol = 0;
|
|
5036 |
-
|
|
5037 |
- /* Set `used' to zero, so that if we return an error, the pattern
|
|
5038 |
- printer (for debugging) will think there's no pattern. We reset it
|
|
5039 |
- at the end. */
|
|
5040 |
- bufp->used = 0;
|
|
5041 |
-
|
|
5042 |
- /* Always count groups, whether or not bufp->no_sub is set. */
|
|
5043 |
- bufp->re_nsub = 0;
|
|
5044 |
-
|
|
5045 |
-#if !defined (emacs) && !defined (SYNTAX_TABLE)
|
|
5046 |
- /* Initialize the syntax table. */
|
|
5047 |
- init_syntax_once ();
|
|
5048 |
-#endif
|
|
5049 |
-
|
|
5050 |
- if (bufp->allocated == 0)
|
|
5051 |
- {
|
|
5052 |
- if (bufp->buffer)
|
|
5053 |
- { /* If zero allocated, but buffer is non-null, try to realloc
|
|
5054 |
- enough space. This loses if buffer's address is bogus, but
|
|
5055 |
- that is the user's responsibility. */
|
|
5056 |
- RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
|
|
5057 |
- }
|
|
5058 |
- else
|
|
5059 |
- { /* Caller did not allocate a buffer. Do it for them. */
|
|
5060 |
- bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
|
|
5061 |
- }
|
|
5062 |
- if (!bufp->buffer) return REG_ESPACE;
|
|
5063 |
-
|
|
5064 |
- bufp->allocated = INIT_BUF_SIZE;
|
|
5065 |
- }
|
|
5066 |
-
|
|
5067 |
- begalt = b = bufp->buffer;
|
|
5068 |
-
|
|
5069 |
- /* Loop through the uncompiled pattern until we're at the end. */
|
|
5070 |
- while (p != pend)
|
|
5071 |
- {
|
|
5072 |
- PATFETCH (c);
|
|
5073 |
-
|
|
5074 |
- switch (c)
|
|
5075 |
- {
|
|
5076 |
- case '^':
|
|
5077 |
- {
|
|
5078 |
- if ( /* If at start of pattern, it's an operator. */
|
|
5079 |
- p == pattern + 1
|
|
5080 |
- /* If context independent, it's an operator. */
|
|
5081 |
- || syntax & RE_CONTEXT_INDEP_ANCHORS
|
|
5082 |
- /* Otherwise, depends on what's come before. */
|
|
5083 |
- || at_begline_loc_p (pattern, p, syntax))
|
|
5084 |
- BUF_PUSH (begline);
|
|
5085 |
- else
|
|
5086 |
- goto normal_char;
|
|
5087 |
- }
|
|
5088 |
- break;
|
|
5089 |
-
|
|
5090 |
-
|
|
5091 |
- case '$':
|
|
5092 |
- {
|
|
5093 |
- if ( /* If at end of pattern, it's an operator. */
|
|
5094 |
- p == pend
|
|
5095 |
- /* If context independent, it's an operator. */
|
|
5096 |
- || syntax & RE_CONTEXT_INDEP_ANCHORS
|
|
5097 |
- /* Otherwise, depends on what's next. */
|
|
5098 |
- || at_endline_loc_p (p, pend, syntax))
|
|
5099 |
- BUF_PUSH (endline);
|
|
5100 |
- else
|
|
5101 |
- goto normal_char;
|
|
5102 |
- }
|
|
5103 |
- break;
|
|
5104 |
-
|
|
5105 |
-
|
|
5106 |
- case '+':
|
|
5107 |
- case '?':
|
|
5108 |
- if ((syntax & RE_BK_PLUS_QM)
|
|
5109 |
- || (syntax & RE_LIMITED_OPS))
|
|
5110 |
- goto normal_char;
|
|
5111 |
- handle_plus:
|
|
5112 |
- case '*':
|
|
5113 |
- /* If there is no previous pattern... */
|
|
5114 |
- if (!laststart)
|
|
5115 |
- {
|
|
5116 |
- if (syntax & RE_CONTEXT_INVALID_OPS)
|
|
5117 |
- return REG_BADRPT;
|
|
5118 |
- else if (!(syntax & RE_CONTEXT_INDEP_OPS))
|
|
5119 |
- goto normal_char;
|
|
5120 |
- }
|
|
5121 |
-
|
|
5122 |
- {
|
|
5123 |
- /* Are we optimizing this jump? */
|
|
5124 |
- boolean keep_string_p = false;
|
|
5125 |
-
|
|
5126 |
- /* 1 means zero (many) matches is allowed. */
|
|
5127 |
- char zero_times_ok = 0, many_times_ok = 0;
|
|
5128 |
-
|
|
5129 |
- /* If there is a sequence of repetition chars, collapse it
|
|
5130 |
- down to just one (the right one). We can't combine
|
|
5131 |
- interval operators with these because of, e.g., `a{2}*',
|
|
5132 |
- which should only match an even number of `a's. */
|
|
5133 |
-
|
|
5134 |
- for (;;)
|
|
5135 |
- {
|
|
5136 |
- zero_times_ok |= c != '+';
|
|
5137 |
- many_times_ok |= c != '?';
|
|
5138 |
-
|
|
5139 |
- if (p == pend)
|
|
5140 |
- break;
|
|
5141 |
-
|
|
5142 |
- PATFETCH (c);
|
|
5143 |
-
|
|
5144 |
- if (c == '*'
|
|
5145 |
- || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
|
|
5146 |
- ;
|
|
5147 |
-
|
|
5148 |
- else if (syntax & RE_BK_PLUS_QM && c == '\\')
|
|
5149 |
- {
|
|
5150 |
- if (p == pend) return REG_EESCAPE;
|
|
5151 |
-
|
|
5152 |
- PATFETCH (c1);
|
|
5153 |
- if (!(c1 == '+' || c1 == '?'))
|
|
5154 |
- {
|
|
5155 |
- PATUNFETCH;
|
|
5156 |
- PATUNFETCH;
|
|
5157 |
- break;
|
|
5158 |
- }
|
|
5159 |
-
|
|
5160 |
- c = c1;
|
|
5161 |
- }
|
|
5162 |
- else
|
|
5163 |
- {
|
|
5164 |
- PATUNFETCH;
|
|
5165 |
- break;
|
|
5166 |
- }
|
|
5167 |
-
|
|
5168 |
- /* If we get here, we found another repeat character. */
|
|
5169 |
- }
|
|
5170 |
-
|
|
5171 |
- /* Star, etc. applied to an empty pattern is equivalent
|
|
5172 |
- to an empty pattern. */
|
|
5173 |
- if (!laststart)
|
|
5174 |
- break;
|
|
5175 |
-
|
|
5176 |
- /* Now we know whether or not zero matches is allowed
|
|
5177 |
- and also whether or not two or more matches is allowed. */
|
|
5178 |
- if (many_times_ok)
|
|
5179 |
- { /* More than one repetition is allowed, so put in at the
|
|
5180 |
- end a backward relative jump from `b' to before the next
|
|
5181 |
- jump we're going to put in below (which jumps from
|
|
5182 |
- laststart to after this jump).
|
|
5183 |
-
|
|
5184 |
- But if we are at the `*' in the exact sequence `.*\n',
|
|
5185 |
- insert an unconditional jump backwards to the .,
|
|
5186 |
- instead of the beginning of the loop. This way we only
|
|
5187 |
- push a failure point once, instead of every time
|
|
5188 |
- through the loop. */
|
|
5189 |
- assert (p - 1 > pattern);
|
|
5190 |
-
|
|
5191 |
- /* Allocate the space for the jump. */
|
|
5192 |
- GET_BUFFER_SPACE (3);
|
|
5193 |
-
|
|
5194 |
- /* We know we are not at the first character of the pattern,
|
|
5195 |
- because laststart was nonzero. And we've already
|
|
5196 |
- incremented `p', by the way, to be the character after
|
|
5197 |
- the `*'. Do we have to do something analogous here
|
|
5198 |
- for null bytes, because of RE_DOT_NOT_NULL? */
|
|
5199 |
- if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
|
|
5200 |
- && zero_times_ok
|
|
5201 |
- && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
|
|
5202 |
- && !(syntax & RE_DOT_NEWLINE))
|
|
5203 |
- { /* We have .*\n. */
|
|
5204 |
- STORE_JUMP (jump, b, laststart);
|
|
5205 |
- keep_string_p = true;
|
|
5206 |
- }
|
|
5207 |
- else
|
|
5208 |
- /* Anything else. */
|
|
5209 |
- STORE_JUMP (maybe_pop_jump, b, laststart - 3);
|
|
5210 |
-
|
|
5211 |
- /* We've added more stuff to the buffer. */
|
|
5212 |
- b += 3;
|
|
5213 |
- }
|
|
5214 |
-
|
|
5215 |
- /* On failure, jump from laststart to b + 3, which will be the
|
|
5216 |
- end of the buffer after this jump is inserted. */
|
|
5217 |
- GET_BUFFER_SPACE (3);
|
|
5218 |
- INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
|
|
5219 |
- : on_failure_jump,
|
|
5220 |
- laststart, b + 3);
|
|
5221 |
- pending_exact = 0;
|
|
5222 |
- b += 3;
|
|
5223 |
-
|
|
5224 |
- if (!zero_times_ok)
|
|
5225 |
- {
|
|
5226 |
- /* At least one repetition is required, so insert a
|
|
5227 |
- `dummy_failure_jump' before the initial
|
|
5228 |
- `on_failure_jump' instruction of the loop. This
|
|
5229 |
- effects a skip over that instruction the first time
|
|
5230 |
- we hit that loop. */
|
|
5231 |
- GET_BUFFER_SPACE (3);
|
|
5232 |
- INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6);
|
|
5233 |
- b += 3;
|
|
5234 |
- }
|
|
5235 |
- }
|
|
5236 |
- break;
|
|
5237 |
-
|
|
5238 |
-
|
|
5239 |
- case '.':
|
|
5240 |
- laststart = b;
|
|
5241 |
- BUF_PUSH (anychar);
|
|
5242 |
- break;
|
|
5243 |
-
|
|
5244 |
-
|
|
5245 |
- case '[':
|
|
5246 |
- {
|
|
5247 |
- boolean had_char_class = false;
|
|
5248 |
-
|
|
5249 |
- if (p == pend) return REG_EBRACK;
|
|
5250 |
-
|
|
5251 |
- /* Ensure that we have enough space to push a charset: the
|
|
5252 |
- opcode, the length count, and the bitset; 34 bytes in all. */
|
|
5253 |
- GET_BUFFER_SPACE (34);
|
|
5254 |
-
|
|
5255 |
- laststart = b;
|
|
5256 |
-
|
|
5257 |
- /* We test `*p == '^' twice, instead of using an if
|
|
5258 |
- statement, so we only need one BUF_PUSH. */
|
|
5259 |
- BUF_PUSH (*p == '^' ? charset_not : charset);
|
|
5260 |
- if (*p == '^')
|
|
5261 |
- p++;
|
|
5262 |
-
|
|
5263 |
- /* Remember the first position in the bracket expression. */
|
|
5264 |
- p1 = p;
|
|
5265 |
-
|
|
5266 |
- /* Push the number of bytes in the bitmap. */
|
|
5267 |
- BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
|
|
5268 |
-
|
|
5269 |
- /* Clear the whole map. */
|
|
5270 |
- bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
|
|
5271 |
-
|
|
5272 |
- /* charset_not matches newline according to a syntax bit. */
|
|
5273 |
- if ((re_opcode_t) b[-2] == charset_not
|
|
5274 |
- && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
|
|
5275 |
- SET_LIST_BIT ('\n');
|
|
5276 |
-
|
|
5277 |
- /* Read in characters and ranges, setting map bits. */
|
|
5278 |
- for (;;)
|
|
5279 |
- {
|
|
5280 |
- if (p == pend) return REG_EBRACK;
|
|
5281 |
-
|
|
5282 |
- PATFETCH (c);
|
|
5283 |
-
|
|
5284 |
- /* \ might escape characters inside [...] and [^...]. */
|
|
5285 |
- if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
|
|
5286 |
- {
|
|
5287 |
- if (p == pend) return REG_EESCAPE;
|
|
5288 |
-
|
|
5289 |
- PATFETCH (c1);
|
|
5290 |
- SET_LIST_BIT (c1);
|
|
5291 |
- continue;
|
|
5292 |
- }
|
|
5293 |
-
|
|
5294 |
- /* Could be the end of the bracket expression. If it's
|
|
5295 |
- not (i.e., when the bracket expression is `[]' so
|
|
5296 |
- far), the ']' character bit gets set way below. */
|
|
5297 |
- if (c == ']' && p != p1 + 1)
|
|
5298 |
- break;
|
|
5299 |
-
|
|
5300 |
- /* Look ahead to see if it's a range when the last thing
|
|
5301 |
- was a character class. */
|
|
5302 |
- if (had_char_class && c == '-' && *p != ']')
|
|
5303 |
- return REG_ERANGE;
|
|
5304 |
-
|
|
5305 |
- /* Look ahead to see if it's a range when the last thing
|
|
5306 |
- was a character: if this is a hyphen not at the
|
|
5307 |
- beginning or the end of a list, then it's the range
|
|
5308 |
- operator. */
|
|
5309 |
- if (c == '-'
|
|
5310 |
- && !(p - 2 >= pattern && p[-2] == '[')
|
|
5311 |
- && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
|
|
5312 |
- && *p != ']')
|
|
5313 |
- {
|
|
5314 |
- reg_errcode_t ret
|
|
5315 |
- = compile_range (&p, pend, translate, syntax, b);
|
|
5316 |
- if (ret != REG_NOERROR) return ret;
|
|
5317 |
- }
|
|
5318 |
-
|
|
5319 |
- else if (p[0] == '-' && p[1] != ']')
|
|
5320 |
- { /* This handles ranges made up of characters only. */
|
|
5321 |
- reg_errcode_t ret;
|
|
5322 |
-
|
|
5323 |
- /* Move past the `-'. */
|
|
5324 |
- PATFETCH (c1);
|
|
5325 |
-
|
|
5326 |
- ret = compile_range (&p, pend, translate, syntax, b);
|
|
5327 |
- if (ret != REG_NOERROR) return ret;
|
|
5328 |
- }
|
|
5329 |
-
|
|
5330 |
- /* See if we're at the beginning of a possible character
|
|
5331 |
- class. */
|
|
5332 |
-
|
|
5333 |
- else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
|
|
5334 |
- { /* Leave room for the null. */
|
|
5335 |
- char str[CHAR_CLASS_MAX_LENGTH + 1];
|
|
5336 |
-
|
|
5337 |
- PATFETCH (c);
|
|
5338 |
- c1 = 0;
|
|
5339 |
-
|
|
5340 |
- /* If pattern is `[[:'. */
|
|
5341 |
- if (p == pend) return REG_EBRACK;
|
|
5342 |
-
|
|
5343 |
- for (;;)
|
|
5344 |
- {
|
|
5345 |
- PATFETCH (c);
|
|
5346 |
- if (c == ':' || c == ']' || p == pend
|
|
5347 |
- || c1 == CHAR_CLASS_MAX_LENGTH)
|
|
5348 |
- break;
|
|
5349 |
- str[c1++] = c;
|
|
5350 |
- }
|
|
5351 |
- str[c1] = '\0';
|
|
5352 |
-
|
|
5353 |
- /* If isn't a word bracketed by `[:' and:`]':
|
|
5354 |
- undo the ending character, the letters, and leave
|
|
5355 |
- the leading `:' and `[' (but set bits for them). */
|
|
5356 |
- if (c == ':' && *p == ']')
|
|
5357 |
- {
|
|
5358 |
- int ch;
|
|
5359 |
- boolean is_alnum = STREQ (str, "alnum");
|
|
5360 |
- boolean is_alpha = STREQ (str, "alpha");
|
|
5361 |
- boolean is_blank = STREQ (str, "blank");
|
|
5362 |
- boolean is_cntrl = STREQ (str, "cntrl");
|
|
5363 |
- boolean is_digit = STREQ (str, "digit");
|
|
5364 |
- boolean is_graph = STREQ (str, "graph");
|
|
5365 |
- boolean is_lower = STREQ (str, "lower");
|
|
5366 |
- boolean is_print = STREQ (str, "print");
|
|
5367 |
- boolean is_punct = STREQ (str, "punct");
|
|
5368 |
- boolean is_space = STREQ (str, "space");
|
|
5369 |
- boolean is_upper = STREQ (str, "upper");
|
|
5370 |
- boolean is_xdigit = STREQ (str, "xdigit");
|
|
5371 |
-
|
|
5372 |
- if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
|
|
5373 |
-
|
|
5374 |
- /* Throw away the ] at the end of the character
|
|
5375 |
- class. */
|
|
5376 |
- PATFETCH (c);
|
|
5377 |
-
|
|
5378 |
- if (p == pend) return REG_EBRACK;
|
|
5379 |
-
|
|
5380 |
- for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
|
|
5381 |
- {
|
|
5382 |
- if ( (is_alnum && ISALNUM (ch))
|
|
5383 |
- || (is_alpha && ISALPHA (ch))
|
|
5384 |
- || (is_blank && ISBLANK (ch))
|
|
5385 |
- || (is_cntrl && ISCNTRL (ch))
|
|
5386 |
- || (is_digit && ISDIGIT (ch))
|
|
5387 |
- || (is_graph && ISGRAPH (ch))
|
|
5388 |
- || (is_lower && ISLOWER (ch))
|
|
5389 |
- || (is_print && ISPRINT (ch))
|
|
5390 |
- || (is_punct && ISPUNCT (ch))
|
|
5391 |
- || (is_space && ISSPACE (ch))
|
|
5392 |
- || (is_upper && ISUPPER (ch))
|
|
5393 |
- || (is_xdigit && ISXDIGIT (ch)))
|
|
5394 |
- SET_LIST_BIT (ch);
|
|
5395 |
- }
|
|
5396 |
- had_char_class = true;
|
|
5397 |
- }
|
|
5398 |
- else
|
|
5399 |
- {
|
|
5400 |
- c1++;
|
|
5401 |
- while (c1--)
|
|
5402 |
- PATUNFETCH;
|
|
5403 |
- SET_LIST_BIT ('[');
|
|
5404 |
- SET_LIST_BIT (':');
|
|
5405 |
- had_char_class = false;
|
|
5406 |
- }
|
|
5407 |
- }
|
|
5408 |
- else
|
|
5409 |
- {
|
|
5410 |
- had_char_class = false;
|
|
5411 |
- SET_LIST_BIT (c);
|
|
5412 |
- }
|
|
5413 |
- }
|
|
5414 |
-
|
|
5415 |
- /* Discard any (non)matching list bytes that are all 0 at the
|
|
5416 |
- end of the map. Decrease the map-length byte too. */
|
|
5417 |
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
|
|
5418 |
- b[-1]--;
|
|
5419 |
- b += b[-1];
|
|
5420 |
- }
|
|
5421 |
- break;
|
|
5422 |
-
|
|
5423 |
-
|
|
5424 |
- case '(':
|
|
5425 |
- if (syntax & RE_NO_BK_PARENS)
|
|
5426 |
- goto handle_open;
|
|
5427 |
- else
|
|
5428 |
- goto normal_char;
|
|
5429 |
-
|
|
5430 |
-
|
|
5431 |
- case ')':
|
|
5432 |
- if (syntax & RE_NO_BK_PARENS)
|
|
5433 |
- goto handle_close;
|
|
5434 |
- else
|
|
5435 |
- goto normal_char;
|
|
5436 |
-
|
|
5437 |
-
|
|
5438 |
- case '\n':
|
|
5439 |
- if (syntax & RE_NEWLINE_ALT)
|
|
5440 |
- goto handle_alt;
|
|
5441 |
- else
|
|
5442 |
- goto normal_char;
|
|
5443 |
-
|
|
5444 |
-
|
|
5445 |
- case '|':
|
|
5446 |
- if (syntax & RE_NO_BK_VBAR)
|
|
5447 |
- goto handle_alt;
|
|
5448 |
- else
|
|
5449 |
- goto normal_char;
|
|
5450 |
-
|
|
5451 |
-
|
|
5452 |
- case '{':
|
|
5453 |
- if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
|
|
5454 |
- goto handle_interval;
|
|
5455 |
- else
|
|
5456 |
- goto normal_char;
|
|
5457 |
-
|
|
5458 |
-
|
|
5459 |
- case '\\':
|
|
5460 |
- if (p == pend) return REG_EESCAPE;
|
|
5461 |
-
|
|
5462 |
- /* Do not translate the character after the \, so that we can
|
|
5463 |
- distinguish, e.g., \B from \b, even if we normally would
|
|
5464 |
- translate, e.g., B to b. */
|
|
5465 |
- PATFETCH_RAW (c);
|
|
5466 |
-
|
|
5467 |
- switch (c)
|
|
5468 |
- {
|
|
5469 |
- case '(':
|
|
5470 |
- if (syntax & RE_NO_BK_PARENS)
|
|
5471 |
- goto normal_backslash;
|
|
5472 |
-
|
|
5473 |
- handle_open:
|
|
5474 |
- bufp->re_nsub++;
|
|
5475 |
- regnum++;
|
|
5476 |
-
|
|
5477 |
- if (COMPILE_STACK_FULL)
|
|
5478 |
- {
|
|
5479 |
- RETALLOC (compile_stack.stack, compile_stack.size << 1,
|
|
5480 |
- compile_stack_elt_t);
|
|
5481 |
- if (compile_stack.stack == NULL) return REG_ESPACE;
|
|
5482 |
-
|
|
5483 |
- compile_stack.size <<= 1;
|
|
5484 |
- }
|
|
5485 |
-
|
|
5486 |
- /* These are the values to restore when we hit end of this
|
|
5487 |
- group. They are all relative offsets, so that if the
|
|
5488 |
- whole pattern moves because of realloc, they will still
|
|
5489 |
- be valid. */
|
|
5490 |
- COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
|
|
5491 |
- COMPILE_STACK_TOP.fixup_alt_jump
|
|
5492 |
- = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
|
|
5493 |
- COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
|
|
5494 |
- COMPILE_STACK_TOP.regnum = regnum;
|
|
5495 |
-
|
|
5496 |
- /* We will eventually replace the 0 with the number of
|
|
5497 |
- groups inner to this one. But do not push a
|
|
5498 |
- start_memory for groups beyond the last one we can
|
|
5499 |
- represent in the compiled pattern. */
|
|
5500 |
- if (regnum <= MAX_REGNUM)
|
|
5501 |
- {
|
|
5502 |
- COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
|
|
5503 |
- BUF_PUSH_3 (start_memory, regnum, 0);
|
|
5504 |
- }
|
|
5505 |
-
|
|
5506 |
- compile_stack.avail++;
|
|
5507 |
-
|
|
5508 |
- fixup_alt_jump = 0;
|
|
5509 |
- laststart = 0;
|
|
5510 |
- begalt = b;
|
|
5511 |
- /* If we've reached MAX_REGNUM groups, then this open
|
|
5512 |
- won't actually generate any code, so we'll have to
|
|
5513 |
- clear pending_exact explicitly. */
|
|
5514 |
- pending_exact = 0;
|
|
5515 |
- break;
|
|
5516 |
-
|
|
5517 |
-
|
|
5518 |
- case ')':
|
|
5519 |
- if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
|
|
5520 |
-
|
|
5521 |
- if (COMPILE_STACK_EMPTY)
|
|
5522 |
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
|
5523 |
- goto normal_backslash;
|
|
5524 |
- else
|
|
5525 |
- return REG_ERPAREN;
|
|
5526 |
-
|
|
5527 |
- handle_close:
|
|
5528 |
- if (fixup_alt_jump)
|
|
5529 |
- { /* Push a dummy failure point at the end of the
|
|
5530 |
- alternative for a possible future
|
|
5531 |
- `pop_failure_jump' to pop. See comments at
|
|
5532 |
- `push_dummy_failure' in `re_match_2'. */
|
|
5533 |
- BUF_PUSH (push_dummy_failure);
|
|
5534 |
-
|
|
5535 |
- /* We allocated space for this jump when we assigned
|
|
5536 |
- to `fixup_alt_jump', in the `handle_alt' case below. */
|
|
5537 |
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
|
|
5538 |
- }
|
|
5539 |
-
|
|
5540 |
- /* See similar code for backslashed left paren above. */
|
|
5541 |
- if (COMPILE_STACK_EMPTY)
|
|
5542 |
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
|
5543 |
- goto normal_char;
|
|
5544 |
- else
|
|
5545 |
- return REG_ERPAREN;
|
|
5546 |
-
|
|
5547 |
- /* Since we just checked for an empty stack above, this
|
|
5548 |
- ``can't happen''. */
|
|
5549 |
- assert (compile_stack.avail != 0);
|
|
5550 |
- {
|
|
5551 |
- /* We don't just want to restore into `regnum', because
|
|
5552 |
- later groups should continue to be numbered higher,
|
|
5553 |
- as in `(ab)c(de)' -- the second group is #2. */
|
|
5554 |
- regnum_t this_group_regnum;
|
|
5555 |
-
|
|
5556 |
- compile_stack.avail--;
|
|
5557 |
- begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
|
|
5558 |
- fixup_alt_jump
|
|
5559 |
- = COMPILE_STACK_TOP.fixup_alt_jump
|
|
5560 |
- ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
|
|
5561 |
- : 0;
|
|
5562 |
- laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
|
|
5563 |
- this_group_regnum = COMPILE_STACK_TOP.regnum;
|
|
5564 |
- /* If we've reached MAX_REGNUM groups, then this open
|
|
5565 |
- won't actually generate any code, so we'll have to
|
|
5566 |
- clear pending_exact explicitly. */
|
|
5567 |
- pending_exact = 0;
|
|
5568 |
-
|
|
5569 |
- /* We're at the end of the group, so now we know how many
|
|
5570 |
- groups were inside this one. */
|
|
5571 |
- if (this_group_regnum <= MAX_REGNUM)
|
|
5572 |
- {
|
|
5573 |
- unsigned char *inner_group_loc
|
|
5574 |
- = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
|
|
5575 |
-
|
|
5576 |
- *inner_group_loc = regnum - this_group_regnum;
|
|
5577 |
- BUF_PUSH_3 (stop_memory, this_group_regnum,
|
|
5578 |
- regnum - this_group_regnum);
|
|
5579 |
- }
|
|
5580 |
- }
|
|
5581 |
- break;
|
|
5582 |
-
|
|
5583 |
-
|
|
5584 |
- case '|': /* `\|'. */
|
|
5585 |
- if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
|
|
5586 |
- goto normal_backslash;
|
|
5587 |
- handle_alt:
|
|
5588 |
- if (syntax & RE_LIMITED_OPS)
|
|
5589 |
- goto normal_char;
|
|
5590 |
-
|
|
5591 |
- /* Insert before the previous alternative a jump which
|
|
5592 |
- jumps to this alternative if the former fails. */
|
|
5593 |
- GET_BUFFER_SPACE (3);
|
|
5594 |
- INSERT_JUMP (on_failure_jump, begalt, b + 6);
|
|
5595 |
- pending_exact = 0;
|
|
5596 |
- b += 3;
|
|
5597 |
-
|
|
5598 |
- /* The alternative before this one has a jump after it
|
|
5599 |
- which gets executed if it gets matched. Adjust that
|
|
5600 |
- jump so it will jump to this alternative's analogous
|
|
5601 |
- jump (put in below, which in turn will jump to the next
|
|
5602 |
- (if any) alternative's such jump, etc.). The last such
|
|
5603 |
- jump jumps to the correct final destination. A picture:
|
|
5604 |
- _____ _____
|
|
5605 |
- | | | |
|
|
5606 |
- | v | v
|
|
5607 |
- a | b | c
|
|
5608 |
-
|
|
5609 |
- If we are at `b', then fixup_alt_jump right now points to a
|
|
5610 |
- three-byte space after `a'. We'll put in the jump, set
|
|
5611 |
- fixup_alt_jump to right after `b', and leave behind three
|
|
5612 |
- bytes which we'll fill in when we get to after `c'. */
|
|
5613 |
-
|
|
5614 |
- if (fixup_alt_jump)
|
|
5615 |
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
|
|
5616 |
-
|
|
5617 |
- /* Mark and leave space for a jump after this alternative,
|
|
5618 |
- to be filled in later either by next alternative or
|
|
5619 |
- when know we're at the end of a series of alternatives. */
|
|
5620 |
- fixup_alt_jump = b;
|
|
5621 |
- GET_BUFFER_SPACE (3);
|
|
5622 |
- b += 3;
|
|
5623 |
-
|
|
5624 |
- laststart = 0;
|
|
5625 |
- begalt = b;
|
|
5626 |
- break;
|
|
5627 |
-
|
|
5628 |
-
|
|
5629 |
- case '{':
|
|
5630 |
- /* If \{ is a literal. */
|
|
5631 |
- if (!(syntax & RE_INTERVALS)
|
|
5632 |
- /* If we're at `\{' and it's not the open-interval
|
|
5633 |
- operator. */
|
|
5634 |
- || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|
|
5635 |
- || (p - 2 == pattern && p == pend))
|
|
5636 |
- goto normal_backslash;
|
|
5637 |
-
|
|
5638 |
- handle_interval:
|
|
5639 |
- {
|
|
5640 |
- /* If got here, then the syntax allows intervals. */
|
|
5641 |
-
|
|
5642 |
- /* At least (most) this many matches must be made. */
|
|
5643 |
- int lower_bound = -1, upper_bound = -1;
|
|
5644 |
-
|
|
5645 |
- beg_interval = p - 1;
|
|
5646 |
-
|
|
5647 |
- if (p == pend)
|
|
5648 |
- {
|
|
5649 |
- if (syntax & RE_NO_BK_BRACES)
|
|
5650 |
- goto unfetch_interval;
|
|
5651 |
- else
|
|
5652 |
- return REG_EBRACE;
|
|
5653 |
- }
|
|
5654 |
-
|
|
5655 |
- GET_UNSIGNED_NUMBER (lower_bound);
|
|
5656 |
-
|
|
5657 |
- if (c == ',')
|
|
5658 |
- {
|
|
5659 |
- GET_UNSIGNED_NUMBER (upper_bound);
|
|
5660 |
- if (upper_bound < 0) upper_bound = RE_DUP_MAX;
|
|
5661 |
- }
|
|
5662 |
- else
|
|
5663 |
- /* Interval such as `{1}' => match exactly once. */
|
|
5664 |
- upper_bound = lower_bound;
|
|
5665 |
-
|
|
5666 |
- if (lower_bound < 0 || upper_bound > RE_DUP_MAX
|
|
5667 |
- || lower_bound > upper_bound)
|
|
5668 |
- {
|
|
5669 |
- if (syntax & RE_NO_BK_BRACES)
|
|
5670 |
- goto unfetch_interval;
|
|
5671 |
- else
|
|
5672 |
- return REG_BADBR;
|
|
5673 |
- }
|
|
5674 |
-
|
|
5675 |
- if (!(syntax & RE_NO_BK_BRACES))
|
|
5676 |
- {
|
|
5677 |
- if (c != '\\') return REG_EBRACE;
|
|
5678 |
-
|
|
5679 |
- PATFETCH (c);
|
|
5680 |
- }
|
|
5681 |
-
|
|
5682 |
- if (c != '}')
|
|
5683 |
- {
|
|
5684 |
- if (syntax & RE_NO_BK_BRACES)
|
|
5685 |
- goto unfetch_interval;
|
|
5686 |
- else
|
|
5687 |
- return REG_BADBR;
|
|
5688 |
- }
|
|
5689 |
-
|
|
5690 |
- /* We just parsed a valid interval. */
|
|
5691 |
-
|
|
5692 |
- /* If it's invalid to have no preceding re. */
|
|
5693 |
- if (!laststart)
|
|
5694 |
- {
|
|
5695 |
- if (syntax & RE_CONTEXT_INVALID_OPS)
|
|
5696 |
- return REG_BADRPT;
|
|
5697 |
- else if (syntax & RE_CONTEXT_INDEP_OPS)
|
|
5698 |
- laststart = b;
|
|
5699 |
- else
|
|
5700 |
- goto unfetch_interval;
|
|
5701 |
- }
|
|
5702 |
-
|
|
5703 |
- /* If the upper bound is zero, don't want to succeed at
|
|
5704 |
- all; jump from `laststart' to `b + 3', which will be
|
|
5705 |
- the end of the buffer after we insert the jump. */
|
|
5706 |
- if (upper_bound == 0)
|
|
5707 |
- {
|
|
5708 |
- GET_BUFFER_SPACE (3);
|
|
5709 |
- INSERT_JUMP (jump, laststart, b + 3);
|
|
5710 |
- b += 3;
|
|
5711 |
- }
|
|
5712 |
-
|
|
5713 |
- /* Otherwise, we have a nontrivial interval. When
|
|
5714 |
- we're all done, the pattern will look like:
|
|
5715 |
- set_number_at <jump count> <upper bound>
|
|
5716 |
- set_number_at <succeed_n count> <lower bound>
|
|
5717 |
- succeed_n <after jump addr> <succed_n count>
|
|
5718 |
- <body of loop>
|
|
5719 |
- jump_n <succeed_n addr> <jump count>
|
|
5720 |
- (The upper bound and `jump_n' are omitted if
|
|
5721 |
- `upper_bound' is 1, though.) */
|
|
5722 |
- else
|
|
5723 |
- { /* If the upper bound is > 1, we need to insert
|
|
5724 |
- more at the end of the loop. */
|
|
5725 |
- unsigned nbytes = 10 + (upper_bound > 1) * 10;
|
|
5726 |
-
|
|
5727 |
- GET_BUFFER_SPACE (nbytes);
|
|
5728 |
-
|
|
5729 |
- /* Initialize lower bound of the `succeed_n', even
|
|
5730 |
- though it will be set during matching by its
|
|
5731 |
- attendant `set_number_at' (inserted next),
|
|
5732 |
- because `re_compile_fastmap' needs to know.
|
|
5733 |
- Jump to the `jump_n' we might insert below. */
|
|
5734 |
- INSERT_JUMP2 (succeed_n, laststart,
|
|
5735 |
- b + 5 + (upper_bound > 1) * 5,
|
|
5736 |
- lower_bound);
|
|
5737 |
- b += 5;
|
|
5738 |
-
|
|
5739 |
- /* Code to initialize the lower bound. Insert
|
|
5740 |
- before the `succeed_n'. The `5' is the last two
|
|
5741 |
- bytes of this `set_number_at', plus 3 bytes of
|
|
5742 |
- the following `succeed_n'. */
|
|
5743 |
- insert_op2 (set_number_at, laststart, 5, lower_bound, b);
|
|
5744 |
- b += 5;
|
|
5745 |
-
|
|
5746 |
- if (upper_bound > 1)
|
|
5747 |
- { /* More than one repetition is allowed, so
|
|
5748 |
- append a backward jump to the `succeed_n'
|
|
5749 |
- that starts this interval.
|
|
5750 |
-
|
|
5751 |
- When we've reached this during matching,
|
|
5752 |
- we'll have matched the interval once, so
|
|
5753 |
- jump back only `upper_bound - 1' times. */
|
|
5754 |
- STORE_JUMP2 (jump_n, b, laststart + 5,
|
|
5755 |
- upper_bound - 1);
|
|
5756 |
- b += 5;
|
|
5757 |
-
|
|
5758 |
- /* The location we want to set is the second
|
|
5759 |
- parameter of the `jump_n'; that is `b-2' as
|
|
5760 |
- an absolute address. `laststart' will be
|
|
5761 |
- the `set_number_at' we're about to insert;
|
|
5762 |
- `laststart+3' the number to set, the source
|
|
5763 |
- for the relative address. But we are
|
|
5764 |
- inserting into the middle of the pattern --
|
|
5765 |
- so everything is getting moved up by 5.
|
|
5766 |
- Conclusion: (b - 2) - (laststart + 3) + 5,
|
|
5767 |
- i.e., b - laststart.
|
|
5768 |
-
|
|
5769 |
- We insert this at the beginning of the loop
|
|
5770 |
- so that if we fail during matching, we'll
|
|
5771 |
- reinitialize the bounds. */
|
|
5772 |
- insert_op2 (set_number_at, laststart, b - laststart,
|
|
5773 |
- upper_bound - 1, b);
|
|
5774 |
- b += 5;
|
|
5775 |
- }
|
|
5776 |
- }
|
|
5777 |
- pending_exact = 0;
|
|
5778 |
- beg_interval = NULL;
|
|
5779 |
- }
|
|
5780 |
- break;
|
|
5781 |
-
|
|
5782 |
- unfetch_interval:
|
|
5783 |
- /* If an invalid interval, match the characters as literals. */
|
|
5784 |
- assert (beg_interval);
|
|
5785 |
- p = beg_interval;
|
|
5786 |
- beg_interval = NULL;
|
|
5787 |
-
|
|
5788 |
- /* normal_char and normal_backslash need `c'. */
|
|
5789 |
- PATFETCH (c);
|
|
5790 |
-
|
|
5791 |
- if (!(syntax & RE_NO_BK_BRACES))
|
|
5792 |
- {
|
|
5793 |
- if (p > pattern && p[-1] == '\\')
|
|
5794 |
- goto normal_backslash;
|
|
5795 |
- }
|
|
5796 |
- goto normal_char;
|
|
5797 |
-
|
|
5798 |
-#ifdef emacs
|
|
5799 |
- /* There is no way to specify the before_dot and after_dot
|
|
5800 |
- operators. rms says this is ok. --karl */
|
|
5801 |
- case '=':
|
|
5802 |
- BUF_PUSH (at_dot);
|
|
5803 |
- break;
|
|
5804 |
-
|
|
5805 |
- case 's':
|
|
5806 |
- laststart = b;
|
|
5807 |
- PATFETCH (c);
|
|
5808 |
- BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
|
|
5809 |
- break;
|
|
5810 |
-
|
|
5811 |
- case 'S':
|
|
5812 |
- laststart = b;
|
|
5813 |
- PATFETCH (c);
|
|
5814 |
- BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
|
|
5815 |
- break;
|
|
5816 |
-#endif /* emacs */
|
|
5817 |
-
|
|
5818 |
-
|
|
5819 |
- case 'w':
|
|
5820 |
- laststart = b;
|
|
5821 |
- BUF_PUSH (wordchar);
|
|
5822 |
- break;
|
|
5823 |
-
|
|
5824 |
-
|
|
5825 |
- case 'W':
|
|
5826 |
- laststart = b;
|
|
5827 |
- BUF_PUSH (notwordchar);
|
|
5828 |
- break;
|
|
5829 |
-
|
|
5830 |
-
|
|
5831 |
- case '<':
|
|
5832 |
- BUF_PUSH (wordbeg);
|
|
5833 |
- break;
|
|
5834 |
-
|
|
5835 |
- case '>':
|
|
5836 |
- BUF_PUSH (wordend);
|
|
5837 |
- break;
|
|
5838 |
-
|
|
5839 |
- case 'b':
|
|
5840 |
- BUF_PUSH (wordbound);
|
|
5841 |
- break;
|
|
5842 |
-
|
|
5843 |
- case 'B':
|
|
5844 |
- BUF_PUSH (notwordbound);
|
|
5845 |
- break;
|
|
5846 |
-
|
|
5847 |
- case '`':
|
|
5848 |
- BUF_PUSH (begbuf);
|
|
5849 |
- break;
|
|
5850 |
-
|
|
5851 |
- case '\'':
|
|
5852 |
- BUF_PUSH (endbuf);
|
|
5853 |
- break;
|
|
5854 |
-
|
|
5855 |
- case '1': case '2': case '3': case '4': case '5':
|
|
5856 |
- case '6': case '7': case '8': case '9':
|
|
5857 |
- if (syntax & RE_NO_BK_REFS)
|
|
5858 |
- goto normal_char;
|
|
5859 |
-
|
|
5860 |
- c1 = c - '0';
|
|
5861 |
-
|
|
5862 |
- if (c1 > regnum)
|
|
5863 |
- return REG_ESUBREG;
|
|
5864 |
-
|
|
5865 |
- /* Can't back reference to a subexpression if inside of it. */
|
|
5866 |
- if (group_in_compile_stack (compile_stack, c1))
|
|
5867 |
- goto normal_char;
|
|
5868 |
-
|
|
5869 |
- laststart = b;
|
|
5870 |
- BUF_PUSH_2 (duplicate, c1);
|
|
5871 |
- break;
|
|
5872 |
-
|
|
5873 |
-
|
|
5874 |
- case '+':
|
|
5875 |
- case '?':
|
|
5876 |
- if (syntax & RE_BK_PLUS_QM)
|
|
5877 |
- goto handle_plus;
|
|
5878 |
- else
|
|
5879 |
- goto normal_backslash;
|
|
5880 |
-
|
|
5881 |
- default:
|
|
5882 |
- normal_backslash:
|
|
5883 |
- /* You might think it would be useful for \ to mean
|
|
5884 |
- not to translate; but if we don't translate it
|
|
5885 |
- it will never match anything. */
|
|
5886 |
- c = TRANSLATE (c);
|
|
5887 |
- goto normal_char;
|
|
5888 |
- }
|
|
5889 |
- break;
|
|
5890 |
-
|
|
5891 |
-
|
|
5892 |
- default:
|
|
5893 |
- /* Expects the character in `c'. */
|
|
5894 |
- normal_char:
|
|
5895 |
- /* If no exactn currently being built. */
|
|
5896 |
- if (!pending_exact
|
|
5897 |
-
|
|
5898 |
- /* If last exactn not at current position. */
|
|
5899 |
- || pending_exact + *pending_exact + 1 != b
|
|
5900 |
-
|
|
5901 |
- /* We have only one byte following the exactn for the count. */
|
|
5902 |
- || *pending_exact == (1 << BYTEWIDTH) - 1
|
|
5903 |
-
|
|
5904 |
- /* If followed by a repetition operator. */
|
|
5905 |
- || *p == '*' || *p == '^'
|
|
5906 |
- || ((syntax & RE_BK_PLUS_QM)
|
|
5907 |
- ? *p == '\\' && (p[1] == '+' || p[1] == '?')
|
|
5908 |
- : (*p == '+' || *p == '?'))
|
|
5909 |
- || ((syntax & RE_INTERVALS)
|
|
5910 |
- && ((syntax & RE_NO_BK_BRACES)
|
|
5911 |
- ? *p == '{'
|
|
5912 |
- : (p[0] == '\\' && p[1] == '{'))))
|
|
5913 |
- {
|
|
5914 |
- /* Start building a new exactn. */
|
|
5915 |
-
|
|
5916 |
- laststart = b;
|
|
5917 |
-
|
|
5918 |
- BUF_PUSH_2 (exactn, 0);
|
|
5919 |
- pending_exact = b - 1;
|
|
5920 |
- }
|
|
5921 |
-
|
|
5922 |
- BUF_PUSH (c);
|
|
5923 |
- (*pending_exact)++;
|
|
5924 |
- break;
|
|
5925 |
- } /* switch (c) */
|
|
5926 |
- } /* while p != pend */
|
|
5927 |
-
|
|
5928 |
-
|
|
5929 |
- /* Through the pattern now. */
|
|
5930 |
-
|
|
5931 |
- if (fixup_alt_jump)
|
|
5932 |
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
|
|
5933 |
-
|
|
5934 |
- if (!COMPILE_STACK_EMPTY)
|
|
5935 |
- return REG_EPAREN;
|
|
5936 |
-
|
|
5937 |
- free (compile_stack.stack);
|
|
5938 |
-
|
|
5939 |
- /* We have succeeded; set the length of the buffer. */
|
|
5940 |
- bufp->used = b - bufp->buffer;
|
|
5941 |
-
|
|
5942 |
-#ifdef DEBUG
|
|
5943 |
- if (debug)
|
|
5944 |
- {
|
|
5945 |
- DEBUG_PRINT1 ("\nCompiled pattern: ");
|
|
5946 |
- print_compiled_pattern (bufp);
|
|
5947 |
- }
|
|
5948 |
-#endif /* DEBUG */
|
|
5949 |
-
|
|
5950 |
- return REG_NOERROR;
|
|
5951 |
-} /* regex_compile */
|
|
5952 |
-
|
|
5953 |
-/* Subroutines for `regex_compile'. */
|
|
5954 |
-
|
|
5955 |
-/* Store OP at LOC followed by two-byte integer parameter ARG. */
|
|
5956 |
-
|
|
5957 |
-static void
|
|
5958 |
-store_op1 (op, loc, arg)
|
|
5959 |
- re_opcode_t op;
|
|
5960 |
- unsigned char *loc;
|
|
5961 |
- int arg;
|
|
5962 |
-{
|
|
5963 |
- *loc = (unsigned char) op;
|
|
5964 |
- STORE_NUMBER (loc + 1, arg);
|
|
5965 |
-}
|
|
5966 |
-
|
|
5967 |
-
|
|
5968 |
-/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
|
|
5969 |
-
|
|
5970 |
-static void
|
|
5971 |
-store_op2 (op, loc, arg1, arg2)
|
|
5972 |
- re_opcode_t op;
|
|
5973 |
- unsigned char *loc;
|
|
5974 |
- int arg1, arg2;
|
|
5975 |
-{
|
|
5976 |
- *loc = (unsigned char) op;
|
|
5977 |
- STORE_NUMBER (loc + 1, arg1);
|
|
5978 |
- STORE_NUMBER (loc + 3, arg2);
|
|
5979 |
-}
|
|
5980 |
-
|
|
5981 |
-
|
|
5982 |
-/* Copy the bytes from LOC to END to open up three bytes of space at LOC
|
|
5983 |
- for OP followed by two-byte integer parameter ARG. */
|
|
5984 |
-
|
|
5985 |
-static void
|
|
5986 |
-insert_op1 (op, loc, arg, end)
|
|
5987 |
- re_opcode_t op;
|
|
5988 |
- unsigned char *loc;
|
|
5989 |
- int arg;
|
|
5990 |
- unsigned char *end;
|
|
5991 |
-{
|
|
5992 |
- register unsigned char *pfrom = end;
|
|
5993 |
- register unsigned char *pto = end + 3;
|
|
5994 |
-
|
|
5995 |
- while (pfrom != loc)
|
|
5996 |
- *--pto = *--pfrom;
|
|
5997 |
-
|
|
5998 |
- store_op1 (op, loc, arg);
|
|
5999 |
-}
|
|
6000 |
-
|
|
6001 |
-
|
|
6002 |
-/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
|
|
6003 |
-
|
|
6004 |
-static void
|
|
6005 |
-insert_op2 (op, loc, arg1, arg2, end)
|
|
6006 |
- re_opcode_t op;
|
|
6007 |
- unsigned char *loc;
|
|
6008 |
- int arg1, arg2;
|
|
6009 |
- unsigned char *end;
|
|
6010 |
-{
|
|
6011 |
- register unsigned char *pfrom = end;
|
|
6012 |
- register unsigned char *pto = end + 5;
|
|
6013 |
-
|
|
6014 |
- while (pfrom != loc)
|
|
6015 |
- *--pto = *--pfrom;
|
|
6016 |
-
|
|
6017 |
- store_op2 (op, loc, arg1, arg2);
|
|
6018 |
-}
|
|
6019 |
-
|
|
6020 |
-
|
|
6021 |
-/* P points to just after a ^ in PATTERN. Return true if that ^ comes
|
|
6022 |
- after an alternative or a begin-subexpression. We assume there is at
|
|
6023 |
- least one character before the ^. */
|
|
6024 |
-
|
|
6025 |
-static boolean
|
|
6026 |
-at_begline_loc_p (pattern, p, syntax)
|
|
6027 |
- const char *pattern, *p;
|
|
6028 |
- reg_syntax_t syntax;
|
|
6029 |
-{
|
|
6030 |
- const char *prev = p - 2;
|
|
6031 |
- boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
|
|
6032 |
-
|
|
6033 |
- return
|
|
6034 |
- /* After a subexpression? */
|
|
6035 |
- (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
|
|
6036 |
- /* After an alternative? */
|
|
6037 |
- || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
|
|
6038 |
-}
|
|
6039 |
-
|
|
6040 |
-
|
|
6041 |
-/* The dual of at_begline_loc_p. This one is for $. We assume there is
|
|
6042 |
- at least one character after the $, i.e., `P < PEND'. */
|
|
6043 |
-
|
|
6044 |
-static boolean
|
|
6045 |
-at_endline_loc_p (p, pend, syntax)
|
|
6046 |
- const char *p, *pend;
|
|
6047 |
- int syntax;
|
|
6048 |
-{
|
|
6049 |
- const char *next = p;
|
|
6050 |
- boolean next_backslash = *next == '\\';
|
|
6051 |
- const char *next_next = p + 1 < pend ? p + 1 : NULL;
|
|
6052 |
-
|
|
6053 |
- return
|
|
6054 |
- /* Before a subexpression? */
|
|
6055 |
- (syntax & RE_NO_BK_PARENS ? *next == ')'
|
|
6056 |
- : next_backslash && next_next && *next_next == ')')
|
|
6057 |
- /* Before an alternative? */
|
|
6058 |
- || (syntax & RE_NO_BK_VBAR ? *next == '|'
|
|
6059 |
- : next_backslash && next_next && *next_next == '|');
|
|
6060 |
-}
|
|
6061 |
-
|
|
6062 |
-
|
|
6063 |
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
|
|
6064 |
- false if it's not. */
|
|
6065 |
-
|
|
6066 |
-static boolean
|
|
6067 |
-group_in_compile_stack (compile_stack, regnum)
|
|
6068 |
- compile_stack_type compile_stack;
|
|
6069 |
- regnum_t regnum;
|
|
6070 |
-{
|
|
6071 |
- int this_element;
|
|
6072 |
-
|
|
6073 |
- for (this_element = compile_stack.avail - 1;
|
|
6074 |
- this_element >= 0;
|
|
6075 |
- this_element--)
|
|
6076 |
- if (compile_stack.stack[this_element].regnum == regnum)
|
|
6077 |
- return true;
|
|
6078 |
-
|
|
6079 |
- return false;
|
|
6080 |
-}
|
|
6081 |
-
|
|
6082 |
-
|
|
6083 |
-/* Read the ending character of a range (in a bracket expression) from the
|
|
6084 |
- uncompiled pattern *P_PTR (which ends at PEND). We assume the
|
|
6085 |
- starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
|
|
6086 |
- Then we set the translation of all bits between the starting and
|
|
6087 |
- ending characters (inclusive) in the compiled pattern B.
|
|
6088 |
-
|
|
6089 |
- Return an error code.
|
|
6090 |
-
|
|
6091 |
- We use these short variable names so we can use the same macros as
|
|
6092 |
- `regex_compile' itself. */
|
|
6093 |
-
|
|
6094 |
-static reg_errcode_t
|
|
6095 |
-compile_range (p_ptr, pend, translate, syntax, b)
|
|
6096 |
- const char **p_ptr, *pend;
|
|
6097 |
- char *translate;
|
|
6098 |
- reg_syntax_t syntax;
|
|
6099 |
- unsigned char *b;
|
|
6100 |
-{
|
|
6101 |
- unsigned this_char;
|
|
6102 |
-
|
|
6103 |
- const char *p = *p_ptr;
|
|
6104 |
- int range_start, range_end;
|
|
6105 |
-
|
|
6106 |
- if (p == pend)
|
|
6107 |
- return REG_ERANGE;
|
|
6108 |
-
|
|
6109 |
- /* Even though the pattern is a signed `char *', we need to fetch
|
|
6110 |
- with unsigned char *'s; if the high bit of the pattern character
|
|
6111 |
- is set, the range endpoints will be negative if we fetch using a
|
|
6112 |
- signed char *.
|
|
6113 |
-
|
|
6114 |
- We also want to fetch the endpoints without translating them; the
|
|
6115 |
- appropriate translation is done in the bit-setting loop below. */
|
|
6116 |
- range_start = ((unsigned char *) p)[-2];
|
|
6117 |
- range_end = ((unsigned char *) p)[0];
|
|
6118 |
-
|
|
6119 |
- /* Have to increment the pointer into the pattern string, so the
|
|
6120 |
- caller isn't still at the ending character. */
|
|
6121 |
- (*p_ptr)++;
|
|
6122 |
-
|
|
6123 |
- /* If the start is after the end, the range is empty. */
|
|
6124 |
- if (range_start > range_end)
|
|
6125 |
- return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
|
|
6126 |
-
|
|
6127 |
- /* Here we see why `this_char' has to be larger than an `unsigned
|
|
6128 |
- char' -- the range is inclusive, so if `range_end' == 0xff
|
|
6129 |
- (assuming 8-bit characters), we would otherwise go into an infinite
|
|
6130 |
- loop, since all characters <= 0xff. */
|
|
6131 |
- for (this_char = range_start; this_char <= range_end; this_char++)
|
|
6132 |
- {
|
|
6133 |
- SET_LIST_BIT (TRANSLATE (this_char));
|
|
6134 |
- }
|
|
6135 |
-
|
|
6136 |
- return REG_NOERROR;
|
|
6137 |
-}
|
|
6138 |
-
|
|
6139 |
-/* Failure stack declarations and macros; both re_compile_fastmap and
|
|
6140 |
- re_match_2 use a failure stack. These have to be macros because of
|
|
6141 |
- REGEX_ALLOCATE. */
|
|
6142 |
-
|
|
6143 |
-
|
|
6144 |
-/* Number of failure points for which to initially allocate space
|
|
6145 |
- when matching. If this number is exceeded, we allocate more
|
|
6146 |
- space, so it is not a hard limit. */
|
|
6147 |
-#ifndef INIT_FAILURE_ALLOC
|
|
6148 |
-#define INIT_FAILURE_ALLOC 5
|
|
6149 |
-#endif
|
|
6150 |
-
|
|
6151 |
-/* Roughly the maximum number of failure points on the stack. Would be
|
|
6152 |
- exactly that if always used MAX_FAILURE_SPACE each time we failed.
|
|
6153 |
- This is a variable only so users of regex can assign to it; we never
|
|
6154 |
- change it ourselves. */
|
|
6155 |
-int re_max_failures = 2000;
|
|
6156 |
-
|
|
6157 |
-typedef const unsigned char *fail_stack_elt_t;
|
|
6158 |
-
|
|
6159 |
-typedef struct
|
|
6160 |
-{
|
|
6161 |
- fail_stack_elt_t *stack;
|
|
6162 |
- unsigned size;
|
|
6163 |
- unsigned avail; /* Offset of next open position. */
|
|
6164 |
-} fail_stack_type;
|
|
6165 |
-
|
|
6166 |
-#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
|
|
6167 |
-#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
|
|
6168 |
-#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
|
|
6169 |
-#define FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail])
|
|
6170 |
-
|
|
6171 |
-
|
|
6172 |
-/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */
|
|
6173 |
-
|
|
6174 |
-#define INIT_FAIL_STACK() \
|
|
6175 |
- do { \
|
|
6176 |
- fail_stack.stack = (fail_stack_elt_t *) \
|
|
6177 |
- REGEX_ALLOCATE (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
|
|
6178 |
- \
|
|
6179 |
- if (fail_stack.stack == NULL) \
|
|
6180 |
- return -2; \
|
|
6181 |
- \
|
|
6182 |
- fail_stack.size = INIT_FAILURE_ALLOC; \
|
|
6183 |
- fail_stack.avail = 0; \
|
|
6184 |
- } while (0)
|
|
6185 |
-
|
|
6186 |
-
|
|
6187 |
-/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
|
|
6188 |
-
|
|
6189 |
- Return 1 if succeeds, and 0 if either ran out of memory
|
|
6190 |
- allocating space for it or it was already too large.
|
|
6191 |
-
|
|
6192 |
- REGEX_REALLOCATE requires `destination' be declared. */
|
|
6193 |
-
|
|
6194 |
-#define DOUBLE_FAIL_STACK(fail_stack) \
|
|
6195 |
- ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \
|
|
6196 |
- ? 0 \
|
|
6197 |
- : ((fail_stack).stack = (fail_stack_elt_t *) \
|
|
6198 |
- REGEX_REALLOCATE ((fail_stack).stack, \
|
|
6199 |
- (fail_stack).size * sizeof (fail_stack_elt_t), \
|
|
6200 |
- ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
|
|
6201 |
- \
|
|
6202 |
- (fail_stack).stack == NULL \
|
|
6203 |
- ? 0 \
|
|
6204 |
- : ((fail_stack).size <<= 1, \
|
|
6205 |
- 1)))
|
|
6206 |
-
|
|
6207 |
-
|
|
6208 |
-/* Push PATTERN_OP on FAIL_STACK.
|
|
6209 |
-
|
|
6210 |
- Return 1 if was able to do so and 0 if ran out of memory allocating
|
|
6211 |
- space to do so. */
|
|
6212 |
-#define PUSH_PATTERN_OP(pattern_op, fail_stack) \
|
|
6213 |
- ((FAIL_STACK_FULL () \
|
|
6214 |
- && !DOUBLE_FAIL_STACK (fail_stack)) \
|
|
6215 |
- ? 0 \
|
|
6216 |
- : ((fail_stack).stack[(fail_stack).avail++] = pattern_op, \
|
|
6217 |
- 1))
|
|
6218 |
-
|
|
6219 |
-/* This pushes an item onto the failure stack. Must be a four-byte
|
|
6220 |
- value. Assumes the variable `fail_stack'. Probably should only
|
|
6221 |
- be called from within `PUSH_FAILURE_POINT'. */
|
|
6222 |
-#define PUSH_FAILURE_ITEM(item) \
|
|
6223 |
- fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item
|
|
6224 |
-
|
|
6225 |
-/* The complement operation. Assumes `fail_stack' is nonempty. */
|
|
6226 |
-#define POP_FAILURE_ITEM() fail_stack.stack[--fail_stack.avail]
|
|
6227 |
-
|
|
6228 |
-/* Used to omit pushing failure point id's when we're not debugging. */
|
|
6229 |
-#ifdef DEBUG
|
|
6230 |
-#define DEBUG_PUSH PUSH_FAILURE_ITEM
|
|
6231 |
-#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_ITEM ()
|
|
6232 |
-#else
|
|
6233 |
-#define DEBUG_PUSH(item)
|
|
6234 |
-#define DEBUG_POP(item_addr)
|
|
6235 |
-#endif
|
|
6236 |
-
|
|
6237 |
-
|
|
6238 |
-/* Push the information about the state we will need
|
|
6239 |
- if we ever fail back to it.
|
|
6240 |
-
|
|
6241 |
- Requires variables fail_stack, regstart, regend, reg_info, and
|
|
6242 |
- num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
|
|
6243 |
- declared.
|
|
6244 |
-
|
|
6245 |
- Does `return FAILURE_CODE' if runs out of memory. */
|
|
6246 |
-
|
|
6247 |
-#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
|
|
6248 |
- do { \
|
|
6249 |
- char *destination; \
|
|
6250 |
- /* Must be int, so when we don't save any registers, the arithmetic \
|
|
6251 |
- of 0 + -1 isn't done as unsigned. */ \
|
|
6252 |
- int this_reg; \
|
|
6253 |
- \
|
|
6254 |
- DEBUG_STATEMENT (failure_id++); \
|
|
6255 |
- DEBUG_STATEMENT (nfailure_points_pushed++); \
|
|
6256 |
- DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \
|
|
6257 |
- DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
|
|
6258 |
- DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
|
|
6259 |
- \
|
|
6260 |
- DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \
|
|
6261 |
- DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
|
|
6262 |
- \
|
|
6263 |
- /* Ensure we have enough space allocated for what we will push. */ \
|
|
6264 |
- while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
|
|
6265 |
- { \
|
|
6266 |
- if (!DOUBLE_FAIL_STACK (fail_stack)) \
|
|
6267 |
- return failure_code; \
|
|
6268 |
- \
|
|
6269 |
- DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \
|
|
6270 |
- (fail_stack).size); \
|
|
6271 |
- DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\
|
|
6272 |
- } \
|
|
6273 |
- \
|
|
6274 |
- /* Push the info, starting with the registers. */ \
|
|
6275 |
- DEBUG_PRINT1 ("\n"); \
|
|
6276 |
- \
|
|
6277 |
- for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
|
|
6278 |
- this_reg++) \
|
|
6279 |
- { \
|
|
6280 |
- DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \
|
|
6281 |
- DEBUG_STATEMENT (num_regs_pushed++); \
|
|
6282 |
- \
|
|
6283 |
- DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
|
|
6284 |
- PUSH_FAILURE_ITEM (regstart[this_reg]); \
|
|
6285 |
- \
|
|
6286 |
- DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
|
|
6287 |
- PUSH_FAILURE_ITEM (regend[this_reg]); \
|
|
6288 |
- \
|
|
6289 |
- DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \
|
|
6290 |
- DEBUG_PRINT2 (" match_null=%d", \
|
|
6291 |
- REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
|
|
6292 |
- DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
|
|
6293 |
- DEBUG_PRINT2 (" matched_something=%d", \
|
|
6294 |
- MATCHED_SOMETHING (reg_info[this_reg])); \
|
|
6295 |
- DEBUG_PRINT2 (" ever_matched=%d", \
|
|
6296 |
- EVER_MATCHED_SOMETHING (reg_info[this_reg])); \
|
|
6297 |
- DEBUG_PRINT1 ("\n"); \
|
|
6298 |
- PUSH_FAILURE_ITEM (reg_info[this_reg].word); \
|
|
6299 |
- } \
|
|
6300 |
- \
|
|
6301 |
- DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
|
|
6302 |
- PUSH_FAILURE_ITEM (lowest_active_reg); \
|
|
6303 |
- \
|
|
6304 |
- DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
|
|
6305 |
- PUSH_FAILURE_ITEM (highest_active_reg); \
|
|
6306 |
- \
|
|
6307 |
- DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \
|
|
6308 |
- DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
|
|
6309 |
- PUSH_FAILURE_ITEM (pattern_place); \
|
|
6310 |
- \
|
|
6311 |
- DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \
|
|
6312 |
- DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
|
|
6313 |
- size2); \
|
|
6314 |
- DEBUG_PRINT1 ("'\n"); \
|
|
6315 |
- PUSH_FAILURE_ITEM (string_place); \
|
|
6316 |
- \
|
|
6317 |
- DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \
|
|
6318 |
- DEBUG_PUSH (failure_id); \
|
|
6319 |
- } while (0)
|
|
6320 |
-
|
|
6321 |
-/* This is the number of items that are pushed and popped on the stack
|
|
6322 |
- for each register. */
|
|
6323 |
-#define NUM_REG_ITEMS 3
|
|
6324 |
-
|
|
6325 |
-/* Individual items aside from the registers. */
|
|
6326 |
-#ifdef DEBUG
|
|
6327 |
-#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
|
|
6328 |
-#else
|
|
6329 |
-#define NUM_NONREG_ITEMS 4
|
|
6330 |
-#endif
|
|
6331 |
-
|
|
6332 |
-/* We push at most this many items on the stack. */
|
|
6333 |
-#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
|
|
6334 |
-
|
|
6335 |
-/* We actually push this many items. */
|
|
6336 |
-#define NUM_FAILURE_ITEMS \
|
|
6337 |
- ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \
|
|
6338 |
- + NUM_NONREG_ITEMS)
|
|
6339 |
-
|
|
6340 |
-/* How many items can still be added to the stack without overflowing it. */
|
|
6341 |
-#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
|
|
6342 |
-
|
|
6343 |
-
|
|
6344 |
-/* Pops what PUSH_FAIL_STACK pushes.
|
|
6345 |
-
|
|
6346 |
- We restore into the parameters, all of which should be lvalues:
|
|
6347 |
- STR -- the saved data position.
|
|
6348 |
- PAT -- the saved pattern position.
|
|
6349 |
- LOW_REG, HIGH_REG -- the highest and lowest active registers.
|
|
6350 |
- REGSTART, REGEND -- arrays of string positions.
|
|
6351 |
- REG_INFO -- array of information about each subexpression.
|
|
6352 |
-
|
|
6353 |
- Also assumes the variables `fail_stack' and (if debugging), `bufp',
|
|
6354 |
- `pend', `string1', `size1', `string2', and `size2'. */
|
|
6355 |
-
|
|
6356 |
-#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
|
|
6357 |
-{ \
|
|
6358 |
- DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
|
|
6359 |
- int this_reg; \
|
|
6360 |
- const unsigned char *string_temp; \
|
|
6361 |
- \
|
|
6362 |
- assert (!FAIL_STACK_EMPTY ()); \
|
|
6363 |
- \
|
|
6364 |
- /* Remove failure points and point to how many regs pushed. */ \
|
|
6365 |
- DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \
|
|
6366 |
- DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \
|
|
6367 |
- DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \
|
|
6368 |
- \
|
|
6369 |
- assert (fail_stack.avail >= NUM_NONREG_ITEMS); \
|
|
6370 |
- \
|
|
6371 |
- DEBUG_POP (&failure_id); \
|
|
6372 |
- DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \
|
|
6373 |
- \
|
|
6374 |
- /* If the saved string location is NULL, it came from an \
|
|
6375 |
- on_failure_keep_string_jump opcode, and we want to throw away the \
|
|
6376 |
- saved NULL, thus retaining our current position in the string. */ \
|
|
6377 |
- string_temp = POP_FAILURE_ITEM (); \
|
|
6378 |
- if (string_temp != NULL) \
|
|
6379 |
- str = (const char *) string_temp; \
|
|
6380 |
- \
|
|
6381 |
- DEBUG_PRINT2 (" Popping string 0x%x: `", str); \
|
|
6382 |
- DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
|
|
6383 |
- DEBUG_PRINT1 ("'\n"); \
|
|
6384 |
- \
|
|
6385 |
- pat = (unsigned char *) POP_FAILURE_ITEM (); \
|
|
6386 |
- DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \
|
|
6387 |
- DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
|
|
6388 |
- \
|
|
6389 |
- /* Restore register info. */ \
|
|
6390 |
- high_reg = (unsigned) POP_FAILURE_ITEM (); \
|
|
6391 |
- DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
|
|
6392 |
- \
|
|
6393 |
- low_reg = (unsigned) POP_FAILURE_ITEM (); \
|
|
6394 |
- DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
|
|
6395 |
- \
|
|
6396 |
- for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
|
|
6397 |
- { \
|
|
6398 |
- DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \
|
|
6399 |
- \
|
|
6400 |
- reg_info[this_reg].word = POP_FAILURE_ITEM (); \
|
|
6401 |
- DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \
|
|
6402 |
- \
|
|
6403 |
- regend[this_reg] = (const char *) POP_FAILURE_ITEM (); \
|
|
6404 |
- DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
|
|
6405 |
- \
|
|
6406 |
- regstart[this_reg] = (const char *) POP_FAILURE_ITEM (); \
|
|
6407 |
- DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
|
|
6408 |
- } \
|
|
6409 |
- \
|
|
6410 |
- DEBUG_STATEMENT (nfailure_points_popped++); \
|
|
6411 |
-} /* POP_FAILURE_POINT */
|
|
6412 |
-
|
|
6413 |
-/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
|
|
6414 |
- BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
|
|
6415 |
- characters can start a string that matches the pattern. This fastmap
|
|
6416 |
- is used by re_search to skip quickly over impossible starting points.
|
|
6417 |
-
|
|
6418 |
- The caller must supply the address of a (1 << BYTEWIDTH)-byte data
|
|
6419 |
- area as BUFP->fastmap.
|
|
6420 |
-
|
|
6421 |
- We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
|
|
6422 |
- the pattern buffer.
|
|
6423 |
-
|
|
6424 |
- Returns 0 if we succeed, -2 if an internal error. */
|
|
6425 |
-
|
|
6426 |
-int
|
|
6427 |
-re_compile_fastmap (bufp)
|
|
6428 |
- struct re_pattern_buffer *bufp;
|
|
6429 |
-{
|
|
6430 |
- int j, k;
|
|
6431 |
- fail_stack_type fail_stack;
|
|
6432 |
-#ifndef REGEX_MALLOC
|
|
6433 |
- char *destination;
|
|
6434 |
-#endif
|
|
6435 |
- /* We don't push any register information onto the failure stack. */
|
|
6436 |
- unsigned num_regs = 0;
|
|
6437 |
-
|
|
6438 |
- register char *fastmap = bufp->fastmap;
|
|
6439 |
- unsigned char *pattern = bufp->buffer;
|
|
6440 |
- unsigned long size = bufp->used;
|
|
6441 |
- const unsigned char *p = pattern;
|
|
6442 |
- register unsigned char *pend = pattern + size;
|
|
6443 |
-
|
|
6444 |
- /* Assume that each path through the pattern can be null until
|
|
6445 |
- proven otherwise. We set this false at the bottom of switch
|
|
6446 |
- statement, to which we get only if a particular path doesn't
|
|
6447 |
- match the empty string. */
|
|
6448 |
- boolean path_can_be_null = true;
|
|
6449 |
-
|
|
6450 |
- /* We aren't doing a `succeed_n' to begin with. */
|
|
6451 |
- boolean succeed_n_p = false;
|
|
6452 |
-
|
|
6453 |
- assert (fastmap != NULL && p != NULL);
|
|
6454 |
-
|
|
6455 |
- INIT_FAIL_STACK ();
|
|
6456 |
- bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
|
|
6457 |
- bufp->fastmap_accurate = 1; /* It will be when we're done. */
|
|
6458 |
- bufp->can_be_null = 0;
|
|
6459 |
-
|
|
6460 |
- while (p != pend || !FAIL_STACK_EMPTY ())
|
|
6461 |
- {
|
|
6462 |
- if (p == pend)
|
|
6463 |
- {
|
|
6464 |
- bufp->can_be_null |= path_can_be_null;
|
|
6465 |
-
|
|
6466 |
- /* Reset for next path. */
|
|
6467 |
- path_can_be_null = true;
|
|
6468 |
-
|
|
6469 |
- p = fail_stack.stack[--fail_stack.avail];
|
|
6470 |
- }
|
|
6471 |
-
|
|
6472 |
- /* We should never be about to go beyond the end of the pattern. */
|
|
6473 |
- assert (p < pend);
|
|
6474 |
-
|
|
6475 |
-#ifdef SWITCH_ENUM_BUG
|
|
6476 |
- switch ((int) ((re_opcode_t) *p++))
|
|
6477 |
-#else
|
|
6478 |
- switch ((re_opcode_t) *p++)
|
|
6479 |
-#endif
|
|
6480 |
- {
|
|
6481 |
-
|
|
6482 |
- /* I guess the idea here is to simply not bother with a fastmap
|
|
6483 |
- if a backreference is used, since it's too hard to figure out
|
|
6484 |
- the fastmap for the corresponding group. Setting
|
|
6485 |
- `can_be_null' stops `re_search_2' from using the fastmap, so
|
|
6486 |
- that is all we do. */
|
|
6487 |
- case duplicate:
|
|
6488 |
- bufp->can_be_null = 1;
|
|
6489 |
- return 0;
|
|
6490 |
-
|
|
6491 |
-
|
|
6492 |
- /* Following are the cases which match a character. These end
|
|
6493 |
- with `break'. */
|
|
6494 |
-
|
|
6495 |
- case exactn:
|
|
6496 |
- fastmap[p[1]] = 1;
|
|
6497 |
- break;
|
|
6498 |
-
|
|
6499 |
-
|
|
6500 |
- case charset:
|
|
6501 |
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
|
|
6502 |
- if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
|
|
6503 |
- fastmap[j] = 1;
|
|
6504 |
- break;
|
|
6505 |
-
|
|
6506 |
-
|
|
6507 |
- case charset_not:
|
|
6508 |
- /* Chars beyond end of map must be allowed. */
|
|
6509 |
- for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
|
|
6510 |
- fastmap[j] = 1;
|
|
6511 |
-
|
|
6512 |
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
|
|
6513 |
- if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
|
|
6514 |
- fastmap[j] = 1;
|
|
6515 |
- break;
|
|
6516 |
-
|
|
6517 |
-
|
|
6518 |
- case wordchar:
|
|
6519 |
- for (j = 0; j < (1 << BYTEWIDTH); j++)
|
|
6520 |
- if (SYNTAX (j) == Sword)
|
|
6521 |
- fastmap[j] = 1;
|
|
6522 |
- break;
|
|
6523 |
-
|
|
6524 |
-
|
|
6525 |
- case notwordchar:
|
|
6526 |
- for (j = 0; j < (1 << BYTEWIDTH); j++)
|
|
6527 |
- if (SYNTAX (j) != Sword)
|
|
6528 |
- fastmap[j] = 1;
|
|
6529 |
- break;
|
|
6530 |
-
|
|
6531 |
-
|
|
6532 |
- case anychar:
|
|
6533 |
- /* `.' matches anything ... */
|
|
6534 |
- for (j = 0; j < (1 << BYTEWIDTH); j++)
|
|
6535 |
- fastmap[j] = 1;
|
|
6536 |
-
|
|
6537 |
- /* ... except perhaps newline. */
|
|
6538 |
- if (!(bufp->syntax & RE_DOT_NEWLINE))
|
|
6539 |
- fastmap['\n'] = 0;
|
|
6540 |
-
|
|
6541 |
- /* Return if we have already set `can_be_null'; if we have,
|
|
6542 |
- then the fastmap is irrelevant. Something's wrong here. */
|
|
6543 |
- else if (bufp->can_be_null)
|
|
6544 |
- return 0;
|
|
6545 |
-
|
|
6546 |
- /* Otherwise, have to check alternative paths. */
|
|
6547 |
- break;
|
|
6548 |
-
|
|
6549 |
-
|
|
6550 |
-#ifdef emacs
|
|
6551 |
- case syntaxspec:
|
|
6552 |
- k = *p++;
|
|
6553 |
- for (j = 0; j < (1 << BYTEWIDTH); j++)
|
|
6554 |
- if (SYNTAX (j) == (enum syntaxcode) k)
|
|
6555 |
- fastmap[j] = 1;
|
|
6556 |
- break;
|
|
6557 |
-
|
|
6558 |
-
|
|
6559 |
- case notsyntaxspec:
|
|
6560 |
- k = *p++;
|
|
6561 |
- for (j = 0; j < (1 << BYTEWIDTH); j++)
|
|
6562 |
- if (SYNTAX (j) != (enum syntaxcode) k)
|
|
6563 |
- fastmap[j] = 1;
|
|
6564 |
- break;
|
|
6565 |
-
|
|
6566 |
-
|
|
6567 |
- /* All cases after this match the empty string. These end with
|
|
6568 |
- `continue'. */
|
|
6569 |
-
|
|
6570 |
-
|
|
6571 |
- case before_dot:
|
|
6572 |
- case at_dot:
|
|
6573 |
- case after_dot:
|
|
6574 |
- continue;
|
|
6575 |
-#endif /* not emacs */
|
|
6576 |
-
|
|
6577 |
-
|
|
6578 |
- case no_op:
|
|
6579 |
- case begline:
|
|
6580 |
- case endline:
|
|
6581 |
- case begbuf:
|
|
6582 |
- case endbuf:
|
|
6583 |
- case wordbound:
|
|
6584 |
- case notwordbound:
|
|
6585 |
- case wordbeg:
|
|
6586 |
- case wordend:
|
|
6587 |
- case push_dummy_failure:
|
|
6588 |
- continue;
|
|
6589 |
-
|
|
6590 |
-
|
|
6591 |
- case jump_n:
|
|
6592 |
- case pop_failure_jump:
|
|
6593 |
- case maybe_pop_jump:
|
|
6594 |
- case jump:
|
|
6595 |
- case jump_past_alt:
|
|
6596 |
- case dummy_failure_jump:
|
|
6597 |
- EXTRACT_NUMBER_AND_INCR (j, p);
|
|
6598 |
- p += j;
|
|
6599 |
- if (j > 0)
|
|
6600 |
- continue;
|
|
6601 |
-
|
|
6602 |
- /* Jump backward implies we just went through the body of a
|
|
6603 |
- loop and matched nothing. Opcode jumped to should be
|
|
6604 |
- `on_failure_jump' or `succeed_n'. Just treat it like an
|
|
6605 |
- ordinary jump. For a * loop, it has pushed its failure
|
|
6606 |
- point already; if so, discard that as redundant. */
|
|
6607 |
- if ((re_opcode_t) *p != on_failure_jump
|
|
6608 |
- && (re_opcode_t) *p != succeed_n)
|
|
6609 |
- continue;
|
|
6610 |
-
|
|
6611 |
- p++;
|
|
6612 |
- EXTRACT_NUMBER_AND_INCR (j, p);
|
|
6613 |
- p += j;
|
|
6614 |
-
|
|
6615 |
- /* If what's on the stack is where we are now, pop it. */
|
|
6616 |
- if (!FAIL_STACK_EMPTY ()
|
|
6617 |
- && fail_stack.stack[fail_stack.avail - 1] == p)
|
|
6618 |
- fail_stack.avail--;
|
|
6619 |
-
|
|
6620 |
- continue;
|
|
6621 |
-
|
|
6622 |
-
|
|
6623 |
- case on_failure_jump:
|
|
6624 |
- case on_failure_keep_string_jump:
|
|
6625 |
- handle_on_failure_jump:
|
|
6626 |
- EXTRACT_NUMBER_AND_INCR (j, p);
|
|
6627 |
-
|
|
6628 |
- /* For some patterns, e.g., `(a?)?', `p+j' here points to the
|
|
6629 |
- end of the pattern. We don't want to push such a point,
|
|
6630 |
- since when we restore it above, entering the switch will
|
|
6631 |
- increment `p' past the end of the pattern. We don't need
|
|
6632 |
- to push such a point since we obviously won't find any more
|
|
6633 |
- fastmap entries beyond `pend'. Such a pattern can match
|
|
6634 |
- the null string, though. */
|
|
6635 |
- if (p + j < pend)
|
|
6636 |
- {
|
|
6637 |
- if (!PUSH_PATTERN_OP (p + j, fail_stack))
|
|
6638 |
- return -2;
|
|
6639 |
- }
|
|
6640 |
- else
|
|
6641 |
- bufp->can_be_null = 1;
|
|
6642 |
-
|
|
6643 |
- if (succeed_n_p)
|
|
6644 |
- {
|
|
6645 |
- EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */
|
|
6646 |
- succeed_n_p = false;
|
|
6647 |
- }
|
|
6648 |
-
|
|
6649 |
- continue;
|
|
6650 |
-
|
|
6651 |
-
|
|
6652 |
- case succeed_n:
|
|
6653 |
- /* Get to the number of times to succeed. */
|
|
6654 |
- p += 2;
|
|
6655 |
-
|
|
6656 |
- /* Increment p past the n for when k != 0. */
|
|
6657 |
- EXTRACT_NUMBER_AND_INCR (k, p);
|
|
6658 |
- if (k == 0)
|
|
6659 |
- {
|
|
6660 |
- p -= 4;
|
|
6661 |
- succeed_n_p = true; /* Spaghetti code alert. */
|
|
6662 |
- goto handle_on_failure_jump;
|
|
6663 |
- }
|
|
6664 |
- continue;
|
|
6665 |
-
|
|
6666 |
-
|
|
6667 |
- case set_number_at:
|
|
6668 |
- p += 4;
|
|
6669 |
- continue;
|
|
6670 |
-
|
|
6671 |
-
|
|
6672 |
- case start_memory:
|
|
6673 |
- case stop_memory:
|
|
6674 |
- p += 2;
|
|
6675 |
- continue;
|
|
6676 |
-
|
|
6677 |
-
|
|
6678 |
- default:
|
|
6679 |
- abort (); /* We have listed all the cases. */
|
|
6680 |
- } /* switch *p++ */
|
|
6681 |
-
|
|
6682 |
- /* Getting here means we have found the possible starting
|
|
6683 |
- characters for one path of the pattern -- and that the empty
|
|
6684 |
- string does not match. We need not follow this path further.
|
|
6685 |
- Instead, look at the next alternative (remembered on the
|
|
6686 |
- stack), or quit if no more. The test at the top of the loop
|
|
6687 |
- does these things. */
|
|
6688 |
- path_can_be_null = false;
|
|
6689 |
- p = pend;
|
|
6690 |
- } /* while p */
|
|
6691 |
-
|
|
6692 |
- /* Set `can_be_null' for the last path (also the first path, if the
|
|
6693 |
- pattern is empty). */
|
|
6694 |
- bufp->can_be_null |= path_can_be_null;
|
|
6695 |
- return 0;
|
|
6696 |
-} /* re_compile_fastmap */
|
|
6697 |
-
|
|
6698 |
-/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
|
|
6699 |
- ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
|
|
6700 |
- this memory for recording register information. STARTS and ENDS
|
|
6701 |
- must be allocated using the malloc library routine, and must each
|
|
6702 |
- be at least NUM_REGS * sizeof (regoff_t) bytes long.
|
|
6703 |
-
|
|
6704 |
- If NUM_REGS == 0, then subsequent matches should allocate their own
|
|
6705 |
- register data.
|
|
6706 |
-
|
|
6707 |
- Unless this function is called, the first search or match using
|
|
6708 |
- PATTERN_BUFFER will allocate its own register data, without
|
|
6709 |
- freeing the old data. */
|
|
6710 |
-
|
|
6711 |
-void
|
|
6712 |
-re_set_registers (bufp, regs, num_regs, starts, ends)
|
|
6713 |
- struct re_pattern_buffer *bufp;
|
|
6714 |
- struct re_registers *regs;
|
|
6715 |
- unsigned num_regs;
|
|
6716 |
- regoff_t *starts, *ends;
|
|
6717 |
-{
|
|
6718 |
- if (num_regs)
|
|
6719 |
- {
|
|
6720 |
- bufp->regs_allocated = REGS_REALLOCATE;
|
|
6721 |
- regs->num_regs = num_regs;
|
|
6722 |
- regs->start = starts;
|
|
6723 |
- regs->end = ends;
|
|
6724 |
- }
|
|
6725 |
- else
|
|
6726 |
- {
|
|
6727 |
- bufp->regs_allocated = REGS_UNALLOCATED;
|
|
6728 |
- regs->num_regs = 0;
|
|
6729 |
- regs->start = regs->end = (regoff_t) 0;
|
|
6730 |
- }
|
|
6731 |
-}
|
|
6732 |
-
|
|
6733 |
-/* Searching routines. */
|
|
6734 |
-
|
|
6735 |
-/* Like re_search_2, below, but only one string is specified, and
|
|
6736 |
- doesn't let you say where to stop matching. */
|
|
6737 |
-
|
|
6738 |
-int
|
|
6739 |
-re_search (bufp, string, size, startpos, range, regs)
|
|
6740 |
- struct re_pattern_buffer *bufp;
|
|
6741 |
- const char *string;
|
|
6742 |
- int size, startpos, range;
|
|
6743 |
- struct re_registers *regs;
|
|
6744 |
-{
|
|
6745 |
- return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
|
|
6746 |
- regs, size);
|
|
6747 |
-}
|
|
6748 |
-
|
|
6749 |
-
|
|
6750 |
-/* Using the compiled pattern in BUFP->buffer, first tries to match the
|
|
6751 |
- virtual concatenation of STRING1 and STRING2, starting first at index
|
|
6752 |
- STARTPOS, then at STARTPOS + 1, and so on.
|
|
6753 |
-
|
|
6754 |
- STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
|
|
6755 |
-
|
|
6756 |
- RANGE is how far to scan while trying to match. RANGE = 0 means try
|
|
6757 |
- only at STARTPOS; in general, the last start tried is STARTPOS +
|
|
6758 |
- RANGE.
|
|
6759 |
-
|
|
6760 |
- In REGS, return the indices of the virtual concatenation of STRING1
|
|
6761 |
- and STRING2 that matched the entire BUFP->buffer and its contained
|
|
6762 |
- subexpressions.
|
|
6763 |
-
|
|
6764 |
- Do not consider matching one past the index STOP in the virtual
|
|
6765 |
- concatenation of STRING1 and STRING2.
|
|
6766 |
-
|
|
6767 |
- We return either the position in the strings at which the match was
|
|
6768 |
- found, -1 if no match, or -2 if error (such as failure
|
|
6769 |
- stack overflow). */
|
|
6770 |
-
|
|
6771 |
-int
|
|
6772 |
-re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
|
6773 |
- struct re_pattern_buffer *bufp;
|
|
6774 |
- const char *string1, *string2;
|
|
6775 |
- int size1, size2;
|
|
6776 |
- int startpos;
|
|
6777 |
- int range;
|
|
6778 |
- struct re_registers *regs;
|
|
6779 |
- int stop;
|
|
6780 |
-{
|
|
6781 |
- int val;
|
|
6782 |
- register char *fastmap = bufp->fastmap;
|
|
6783 |
- register char *translate = bufp->translate;
|
|
6784 |
- int total_size = size1 + size2;
|
|
6785 |
- int endpos = startpos + range;
|
|
6786 |
-
|
|
6787 |
- /* Check for out-of-range STARTPOS. */
|
|
6788 |
- if (startpos < 0 || startpos > total_size)
|
|
6789 |
- return -1;
|
|
6790 |
-
|
|
6791 |
- /* Fix up RANGE if it might eventually take us outside
|
|
6792 |
- the virtual concatenation of STRING1 and STRING2. */
|
|
6793 |
- if (endpos < -1)
|
|
6794 |
- range = -1 - startpos;
|
|
6795 |
- else if (endpos > total_size)
|
|
6796 |
- range = total_size - startpos;
|
|
6797 |
-
|
|
6798 |
- /* If the search isn't to be a backwards one, don't waste time in a
|
|
6799 |
- search for a pattern that must be anchored. */
|
|
6800 |
- if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
|
|
6801 |
- {
|
|
6802 |
- if (startpos > 0)
|
|
6803 |
- return -1;
|
|
6804 |
- else
|
|
6805 |
- range = 1;
|
|
6806 |
- }
|
|
6807 |
-
|
|
6808 |
- /* Update the fastmap now if not correct already. */
|
|
6809 |
- if (fastmap && !bufp->fastmap_accurate)
|
|
6810 |
- if (re_compile_fastmap (bufp) == -2)
|
|
6811 |
- return -2;
|
|
6812 |
-
|
|
6813 |
- /* Loop through the string, looking for a place to start matching. */
|
|
6814 |
- for (;;)
|
|
6815 |
- {
|
|
6816 |
- /* If a fastmap is supplied, skip quickly over characters that
|
|
6817 |
- cannot be the start of a match. If the pattern can match the
|
|
6818 |
- null string, however, we don't need to skip characters; we want
|
|
6819 |
- the first null string. */
|
|
6820 |
- if (fastmap && startpos < total_size && !bufp->can_be_null)
|
|
6821 |
- {
|
|
6822 |
- if (range > 0) /* Searching forwards. */
|
|
6823 |
- {
|
|
6824 |
- register const char *d;
|
|
6825 |
- register int lim = 0;
|
|
6826 |
- int irange = range;
|
|
6827 |
-
|
|
6828 |
- if (startpos < size1 && startpos + range >= size1)
|
|
6829 |
- lim = range - (size1 - startpos);
|
|
6830 |
-
|
|
6831 |
- d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
|
|
6832 |
-
|
|
6833 |
- /* Written out as an if-else to avoid testing `translate'
|
|
6834 |
- inside the loop. */
|
|
6835 |
- if (translate)
|
|
6836 |
- while (range > lim
|
|
6837 |
- && !fastmap[(unsigned char)
|
|
6838 |
- translate[(unsigned char) *d++]])
|
|
6839 |
- range--;
|
|
6840 |
- else
|
|
6841 |
- while (range > lim && !fastmap[(unsigned char) *d++])
|
|
6842 |
- range--;
|
|
6843 |
-
|
|
6844 |
- startpos += irange - range;
|
|
6845 |
- }
|
|
6846 |
- else /* Searching backwards. */
|
|
6847 |
- {
|
|
6848 |
- register char c = (size1 == 0 || startpos >= size1
|
|
6849 |
- ? string2[startpos - size1]
|
|
6850 |
- : string1[startpos]);
|
|
6851 |
-
|
|
6852 |
- if (!fastmap[(unsigned char) TRANSLATE (c)])
|
|
6853 |
- goto advance;
|
|
6854 |
- }
|
|
6855 |
- }
|
|
6856 |
-
|
|
6857 |
- /* If can't match the null string, and that's all we have left, fail. */
|
|
6858 |
- if (range >= 0 && startpos == total_size && fastmap
|
|
6859 |
- && !bufp->can_be_null)
|
|
6860 |
- return -1;
|
|
6861 |
-
|
|
6862 |
- val = re_match_2 (bufp, string1, size1, string2, size2,
|
|
6863 |
- startpos, regs, stop);
|
|
6864 |
- if (val >= 0)
|
|
6865 |
- return startpos;
|
|
6866 |
-
|
|
6867 |
- if (val == -2)
|
|
6868 |
- return -2;
|
|
6869 |
-
|
|
6870 |
- advance:
|
|
6871 |
- if (!range)
|
|
6872 |
- break;
|
|
6873 |
- else if (range > 0)
|
|
6874 |
- {
|
|
6875 |
- range--;
|
|
6876 |
- startpos++;
|
|
6877 |
- }
|
|
6878 |
- else
|
|
6879 |
- {
|
|
6880 |
- range++;
|
|
6881 |
- startpos--;
|
|
6882 |
- }
|
|
6883 |
- }
|
|
6884 |
- return -1;
|
|
6885 |
-} /* re_search_2 */
|
|
6886 |
-
|
|
6887 |
-/* Declarations and macros for re_match_2. */
|
|
6888 |
-
|
|
6889 |
-static int bcmp_translate ();
|
|
6890 |
-static boolean alt_match_null_string_p (),
|
|
6891 |
- common_op_match_null_string_p (),
|
|
6892 |
- group_match_null_string_p ();
|
|
6893 |
-
|
|
6894 |
-/* Structure for per-register (a.k.a. per-group) information.
|
|
6895 |
- This must not be longer than one word, because we push this value
|
|
6896 |
- onto the failure stack. Other register information, such as the
|
|
6897 |
- starting and ending positions (which are addresses), and the list of
|
|
6898 |
- inner groups (which is a bits list) are maintained in separate
|
|
6899 |
- variables.
|
|
6900 |
-
|
|
6901 |
- We are making a (strictly speaking) nonportable assumption here: that
|
|
6902 |
- the compiler will pack our bit fields into something that fits into
|
|
6903 |
- the type of `word', i.e., is something that fits into one item on the
|
|
6904 |
- failure stack. */
|
|
6905 |
-typedef union
|
|
6906 |
-{
|
|
6907 |
- fail_stack_elt_t word;
|
|
6908 |
- struct
|
|
6909 |
- {
|
|
6910 |
- /* This field is one if this group can match the empty string,
|
|
6911 |
- zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */
|
|
6912 |
-#define MATCH_NULL_UNSET_VALUE 3
|
|
6913 |
- unsigned match_null_string_p : 2;
|
|
6914 |
- unsigned is_active : 1;
|
|
6915 |
- unsigned matched_something : 1;
|
|
6916 |
- unsigned ever_matched_something : 1;
|
|
6917 |
- } bits;
|
|
6918 |
-} register_info_type;
|
|
6919 |
-
|
|
6920 |
-#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
|
|
6921 |
-#define IS_ACTIVE(R) ((R).bits.is_active)
|
|
6922 |
-#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
|
|
6923 |
-#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something)
|
|
6924 |
-
|
|
6925 |
-
|
|
6926 |
-/* Call this when have matched a real character; it sets `matched' flags
|
|
6927 |
- for the subexpressions which we are currently inside. Also records
|
|
6928 |
- that those subexprs have matched. */
|
|
6929 |
-#define SET_REGS_MATCHED() \
|
|
6930 |
- do \
|
|
6931 |
- { \
|
|
6932 |
- unsigned r; \
|
|
6933 |
- for (r = lowest_active_reg; r <= highest_active_reg; r++) \
|
|
6934 |
- { \
|
|
6935 |
- MATCHED_SOMETHING (reg_info[r]) \
|
|
6936 |
- = EVER_MATCHED_SOMETHING (reg_info[r]) \
|
|
6937 |
- = 1; \
|
|
6938 |
- } \
|
|
6939 |
- } \
|
|
6940 |
- while (0)
|
|
6941 |
-
|
|
6942 |
-
|
|
6943 |
-/* This converts PTR, a pointer into one of the search strings `string1'
|
|
6944 |
- and `string2' into an offset from the beginning of that string. */
|
|
6945 |
-#define POINTER_TO_OFFSET(ptr) \
|
|
6946 |
- (FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1)
|
|
6947 |
-
|
|
6948 |
-/* Registers are set to a sentinel when they haven't yet matched. */
|
|
6949 |
-#define REG_UNSET_VALUE ((char *) -1)
|
|
6950 |
-#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
|
|
6951 |
-
|
|
6952 |
-
|
|
6953 |
-/* Macros for dealing with the split strings in re_match_2. */
|
|
6954 |
-
|
|
6955 |
-#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
|
|
6956 |
-
|
|
6957 |
-/* Call before fetching a character with *d. This switches over to
|
|
6958 |
- string2 if necessary. */
|
|
6959 |
-#define PREFETCH() \
|
|
6960 |
- while (d == dend) \
|
|
6961 |
- { \
|
|
6962 |
- /* End of string2 => fail. */ \
|
|
6963 |
- if (dend == end_match_2) \
|
|
6964 |
- goto fail; \
|
|
6965 |
- /* End of string1 => advance to string2. */ \
|
|
6966 |
- d = string2; \
|
|
6967 |
- dend = end_match_2; \
|
|
6968 |
- }
|
|
6969 |
-
|
|
6970 |
-
|
|
6971 |
-/* Test if at very beginning or at very end of the virtual concatenation
|
|
6972 |
- of `string1' and `string2'. If only one string, it's `string2'. */
|
|
6973 |
-#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
|
|
6974 |
-#define AT_STRINGS_END(d) ((d) == end2)
|
|
6975 |
-
|
|
6976 |
-
|
|
6977 |
-/* Test if D points to a character which is word-constituent. We have
|
|
6978 |
- two special cases to check for: if past the end of string1, look at
|
|
6979 |
- the first character in string2; and if before the beginning of
|
|
6980 |
- string2, look at the last character in string1. */
|
|
6981 |
-#define WORDCHAR_P(d) \
|
|
6982 |
- (SYNTAX ((d) == end1 ? *string2 \
|
|
6983 |
- : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
|
|
6984 |
- == Sword)
|
|
6985 |
-
|
|
6986 |
-/* Test if the character before D and the one at D differ with respect
|
|
6987 |
- to being word-constituent. */
|
|
6988 |
-#define AT_WORD_BOUNDARY(d) \
|
|
6989 |
- (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
|
|
6990 |
- || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
|
|
6991 |
-
|
|
6992 |
-
|
|
6993 |
-/* Free everything we malloc. */
|
|
6994 |
-#ifdef REGEX_MALLOC
|
|
6995 |
-#define FREE_VAR(var) if (var) free (var); var = NULL
|
|
6996 |
-#define FREE_VARIABLES() \
|
|
6997 |
- do { \
|
|
6998 |
- FREE_VAR (fail_stack.stack); \
|
|
6999 |
- FREE_VAR (regstart); \
|
|
7000 |
- FREE_VAR (regend); \
|
|
7001 |
- FREE_VAR (old_regstart); \
|
|
7002 |
- FREE_VAR (old_regend); \
|
|
7003 |
- FREE_VAR (best_regstart); \
|
|
7004 |
- FREE_VAR (best_regend); \
|
|
7005 |
- FREE_VAR (reg_info); \
|
|
7006 |
- FREE_VAR (reg_dummy); \
|
|
7007 |
- FREE_VAR (reg_info_dummy); \
|
|
7008 |
- } while (0)
|
|
7009 |
-#else /* not REGEX_MALLOC */
|
|
7010 |
-/* Some MIPS systems (at least) want this to free alloca'd storage. */
|
|
7011 |
-#define FREE_VARIABLES() alloca (0)
|
|
7012 |
-#endif /* not REGEX_MALLOC */
|
|
7013 |
-
|
|
7014 |
-
|
|
7015 |
-/* These values must meet several constraints. They must not be valid
|
|
7016 |
- register values; since we have a limit of 255 registers (because
|
|
7017 |
- we use only one byte in the pattern for the register number), we can
|
|
7018 |
- use numbers larger than 255. They must differ by 1, because of
|
|
7019 |
- NUM_FAILURE_ITEMS above. And the value for the lowest register must
|
|
7020 |
- be larger than the value for the highest register, so we do not try
|
|
7021 |
- to actually save any registers when none are active. */
|
|
7022 |
-#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
|
|
7023 |
-#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
|
|
7024 |
-
|
|
7025 |
-/* Matching routines. */
|
|
7026 |
-
|
|
7027 |
-#ifndef emacs /* Emacs never uses this. */
|
|
7028 |
-/* re_match is like re_match_2 except it takes only a single string. */
|
|
7029 |
-
|
|
7030 |
-int
|
|
7031 |
-re_match (bufp, string, size, pos, regs)
|
|
7032 |
- struct re_pattern_buffer *bufp;
|
|
7033 |
- const char *string;
|
|
7034 |
- int size, pos;
|
|
7035 |
- struct re_registers *regs;
|
|
7036 |
- {
|
|
7037 |
- return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
|
|
7038 |
-}
|
|
7039 |
-#endif /* not emacs */
|
|
7040 |
-
|
|
7041 |
-
|
|
7042 |
-/* re_match_2 matches the compiled pattern in BUFP against the
|
|
7043 |
- the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
|
|
7044 |
- and SIZE2, respectively). We start matching at POS, and stop
|
|
7045 |
- matching at STOP.
|
|
7046 |
-
|
|
7047 |
- If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
|
|
7048 |
- store offsets for the substring each group matched in REGS. See the
|
|
7049 |
- documentation for exactly how many groups we fill.
|
|
7050 |
-
|
|
7051 |
- We return -1 if no match, -2 if an internal error (such as the
|
|
7052 |
- failure stack overflowing). Otherwise, we return the length of the
|
|
7053 |
- matched substring. */
|
|
7054 |
-
|
|
7055 |
-int
|
|
7056 |
-re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
|
7057 |
- struct re_pattern_buffer *bufp;
|
|
7058 |
- const char *string1, *string2;
|
|
7059 |
- int size1, size2;
|
|
7060 |
- int pos;
|
|
7061 |
- struct re_registers *regs;
|
|
7062 |
- int stop;
|
|
7063 |
-{
|
|
7064 |
- /* General temporaries. */
|
|
7065 |
- int mcnt;
|
|
7066 |
- unsigned char *p1;
|
|
7067 |
-
|
|
7068 |
- /* Just past the end of the corresponding string. */
|
|
7069 |
- const char *end1, *end2;
|
|
7070 |
-
|
|
7071 |
- /* Pointers into string1 and string2, just past the last characters in
|
|
7072 |
- each to consider matching. */
|
|
7073 |
- const char *end_match_1, *end_match_2;
|
|
7074 |
-
|
|
7075 |
- /* Where we are in the data, and the end of the current string. */
|
|
7076 |
- const char *d, *dend;
|
|
7077 |
-
|
|
7078 |
- /* Where we are in the pattern, and the end of the pattern. */
|
|
7079 |
- unsigned char *p = bufp->buffer;
|
|
7080 |
- register unsigned char *pend = p + bufp->used;
|
|
7081 |
-
|
|
7082 |
- /* We use this to map every character in the string. */
|
|
7083 |
- char *translate = bufp->translate;
|
|
7084 |
-
|
|
7085 |
- /* Failure point stack. Each place that can handle a failure further
|
|
7086 |
- down the line pushes a failure point on this stack. It consists of
|
|
7087 |
- restart, regend, and reg_info for all registers corresponding to
|
|
7088 |
- the subexpressions we're currently inside, plus the number of such
|
|
7089 |
- registers, and, finally, two char *'s. The first char * is where
|
|
7090 |
- to resume scanning the pattern; the second one is where to resume
|
|
7091 |
- scanning the strings. If the latter is zero, the failure point is
|
|
7092 |
- a ``dummy''; if a failure happens and the failure point is a dummy,
|
|
7093 |
- it gets discarded and the next next one is tried. */
|
|
7094 |
- fail_stack_type fail_stack;
|
|
7095 |
-#ifdef DEBUG
|
|
7096 |
- static unsigned failure_id = 0;
|
|
7097 |
- unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
|
|
7098 |
-#endif
|
|
7099 |
-
|
|
7100 |
- /* We fill all the registers internally, independent of what we
|
|
7101 |
- return, for use in backreferences. The number here includes
|
|
7102 |
- an element for register zero. */
|
|
7103 |
- unsigned num_regs = bufp->re_nsub + 1;
|
|
7104 |
-
|
|
7105 |
- /* The currently active registers. */
|
|
7106 |
- unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
|
|
7107 |
- unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
|
|
7108 |
-
|
|
7109 |
- /* Information on the contents of registers. These are pointers into
|
|
7110 |
- the input strings; they record just what was matched (on this
|
|
7111 |
- attempt) by a subexpression part of the pattern, that is, the
|
|
7112 |
- regnum-th regstart pointer points to where in the pattern we began
|
|
7113 |
- matching and the regnum-th regend points to right after where we
|
|
7114 |
- stopped matching the regnum-th subexpression. (The zeroth register
|
|
7115 |
- keeps track of what the whole pattern matches.) */
|
|
7116 |
- const char **regstart, **regend;
|
|
7117 |
-
|
|
7118 |
- /* If a group that's operated upon by a repetition operator fails to
|
|
7119 |
- match anything, then the register for its start will need to be
|
|
7120 |
- restored because it will have been set to wherever in the string we
|
|
7121 |
- are when we last see its open-group operator. Similarly for a
|
|
7122 |
- register's end. */
|
|
7123 |
- const char **old_regstart, **old_regend;
|
|
7124 |
-
|
|
7125 |
- /* The is_active field of reg_info helps us keep track of which (possibly
|
|
7126 |
- nested) subexpressions we are currently in. The matched_something
|
|
7127 |
- field of reg_info[reg_num] helps us tell whether or not we have
|
|
7128 |
- matched any of the pattern so far this time through the reg_num-th
|
|
7129 |
- subexpression. These two fields get reset each time through any
|
|
7130 |
- loop their register is in. */
|
|
7131 |
- register_info_type *reg_info;
|
|
7132 |
-
|
|
7133 |
- /* The following record the register info as found in the above
|
|
7134 |
- variables when we find a match better than any we've seen before.
|
|
7135 |
- This happens as we backtrack through the failure points, which in
|
|
7136 |
- turn happens only if we have not yet matched the entire string. */
|
|
7137 |
- unsigned best_regs_set = false;
|
|
7138 |
- const char **best_regstart, **best_regend;
|
|
7139 |
-
|
|
7140 |
- /* Logically, this is `best_regend[0]'. But we don't want to have to
|
|
7141 |
- allocate space for that if we're not allocating space for anything
|
|
7142 |
- else (see below). Also, we never need info about register 0 for
|
|
7143 |
- any of the other register vectors, and it seems rather a kludge to
|
|
7144 |
- treat `best_regend' differently than the rest. So we keep track of
|
|
7145 |
- the end of the best match so far in a separate variable. We
|
|
7146 |
- initialize this to NULL so that when we backtrack the first time
|
|
7147 |
- and need to test it, it's not garbage. */
|
|
7148 |
- const char *match_end = NULL;
|
|
7149 |
-
|
|
7150 |
- /* Used when we pop values we don't care about. */
|
|
7151 |
- const char **reg_dummy;
|
|
7152 |
- register_info_type *reg_info_dummy;
|
|
7153 |
-
|
|
7154 |
-#ifdef DEBUG
|
|
7155 |
- /* Counts the total number of registers pushed. */
|
|
7156 |
- unsigned num_regs_pushed = 0;
|
|
7157 |
-#endif
|
|
7158 |
-
|
|
7159 |
- DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
|
|
7160 |
-
|
|
7161 |
- INIT_FAIL_STACK ();
|
|
7162 |
-
|
|
7163 |
- /* Do not bother to initialize all the register variables if there are
|
|
7164 |
- no groups in the pattern, as it takes a fair amount of time. If
|
|
7165 |
- there are groups, we include space for register 0 (the whole
|
|
7166 |
- pattern), even though we never use it, since it simplifies the
|
|
7167 |
- array indexing. We should fix this. */
|
|
7168 |
- if (bufp->re_nsub)
|
|
7169 |
- {
|
|
7170 |
- regstart = REGEX_TALLOC (num_regs, const char *);
|
|
7171 |
- regend = REGEX_TALLOC (num_regs, const char *);
|
|
7172 |
- old_regstart = REGEX_TALLOC (num_regs, const char *);
|
|
7173 |
- old_regend = REGEX_TALLOC (num_regs, const char *);
|
|
7174 |
- best_regstart = REGEX_TALLOC (num_regs, const char *);
|
|
7175 |
- best_regend = REGEX_TALLOC (num_regs, const char *);
|
|
7176 |
- reg_info = REGEX_TALLOC (num_regs, register_info_type);
|
|
7177 |
- reg_dummy = REGEX_TALLOC (num_regs, const char *);
|
|
7178 |
- reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
|
|
7179 |
-
|
|
7180 |
- if (!(regstart && regend && old_regstart && old_regend && reg_info
|
|
7181 |
- && best_regstart && best_regend && reg_dummy && reg_info_dummy))
|
|
7182 |
- {
|
|
7183 |
- FREE_VARIABLES ();
|
|
7184 |
- return -2;
|
|
7185 |
- }
|
|
7186 |
- }
|
|
7187 |
-#ifdef REGEX_MALLOC
|
|
7188 |
- else
|
|
7189 |
- {
|
|
7190 |
- /* We must initialize all our variables to NULL, so that
|
|
7191 |
- `FREE_VARIABLES' doesn't try to free them. */
|
|
7192 |
- regstart = regend = old_regstart = old_regend = best_regstart
|
|
7193 |
- = best_regend = reg_dummy = NULL;
|
|
7194 |
- reg_info = reg_info_dummy = (register_info_type *) NULL;
|
|
7195 |
- }
|
|
7196 |
-#endif /* REGEX_MALLOC */
|
|
7197 |
-
|
|
7198 |
- /* The starting position is bogus. */
|
|
7199 |
- if (pos < 0 || pos > size1 + size2)
|
|
7200 |
- {
|
|
7201 |
- FREE_VARIABLES ();
|
|
7202 |
- return -1;
|
|
7203 |
- }
|
|
7204 |
-
|
|
7205 |
- /* Initialize subexpression text positions to -1 to mark ones that no
|
|
7206 |
- start_memory/stop_memory has been seen for. Also initialize the
|
|
7207 |
- register information struct. */
|
|
7208 |
- for (mcnt = 1; mcnt < num_regs; mcnt++)
|
|
7209 |
- {
|
|
7210 |
- regstart[mcnt] = regend[mcnt]
|
|
7211 |
- = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
|
|
7212 |
-
|
|
7213 |
- REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
|
|
7214 |
- IS_ACTIVE (reg_info[mcnt]) = 0;
|
|
7215 |
- MATCHED_SOMETHING (reg_info[mcnt]) = 0;
|
|
7216 |
- EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
|
|
7217 |
- }
|
|
7218 |
-
|
|
7219 |
- /* We move `string1' into `string2' if the latter's empty -- but not if
|
|
7220 |
- `string1' is null. */
|
|
7221 |
- if (size2 == 0 && string1 != NULL)
|
|
7222 |
- {
|
|
7223 |
- string2 = string1;
|
|
7224 |
- size2 = size1;
|
|
7225 |
- string1 = 0;
|
|
7226 |
- size1 = 0;
|
|
7227 |
- }
|
|
7228 |
- end1 = string1 + size1;
|
|
7229 |
- end2 = string2 + size2;
|
|
7230 |
-
|
|
7231 |
- /* Compute where to stop matching, within the two strings. */
|
|
7232 |
- if (stop <= size1)
|
|
7233 |
- {
|
|
7234 |
- end_match_1 = string1 + stop;
|
|
7235 |
- end_match_2 = string2;
|
|
7236 |
- }
|
|
7237 |
- else
|
|
7238 |
- {
|
|
7239 |
- end_match_1 = end1;
|
|
7240 |
- end_match_2 = string2 + stop - size1;
|
|
7241 |
- }
|
|
7242 |
-
|
|
7243 |
- /* `p' scans through the pattern as `d' scans through the data.
|
|
7244 |
- `dend' is the end of the input string that `d' points within. `d'
|
|
7245 |
- is advanced into the following input string whenever necessary, but
|
|
7246 |
- this happens before fetching; therefore, at the beginning of the
|
|
7247 |
- loop, `d' can be pointing at the end of a string, but it cannot
|
|
7248 |
- equal `string2'. */
|
|
7249 |
- if (size1 > 0 && pos <= size1)
|
|
7250 |
- {
|
|
7251 |
- d = string1 + pos;
|
|
7252 |
- dend = end_match_1;
|
|
7253 |
- }
|
|
7254 |
- else
|
|
7255 |
- {
|
|
7256 |
- d = string2 + pos - size1;
|
|
7257 |
- dend = end_match_2;
|
|
7258 |
- }
|
|
7259 |
-
|
|
7260 |
- DEBUG_PRINT1 ("The compiled pattern is: ");
|
|
7261 |
- DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
|
|
7262 |
- DEBUG_PRINT1 ("The string to match is: `");
|
|
7263 |
- DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
|
|
7264 |
- DEBUG_PRINT1 ("'\n");
|
|
7265 |
-
|
|
7266 |
- /* This loops over pattern commands. It exits by returning from the
|
|
7267 |
- function if the match is complete, or it drops through if the match
|
|
7268 |
- fails at this starting point in the input data. */
|
|
7269 |
- for (;;)
|
|
7270 |
- {
|
|
7271 |
- DEBUG_PRINT2 ("\n0x%x: ", p);
|
|
7272 |
-
|
|
7273 |
- if (p == pend)
|
|
7274 |
- { /* End of pattern means we might have succeeded. */
|
|
7275 |
- DEBUG_PRINT1 ("end of pattern ... ");
|
|
7276 |
-
|
|
7277 |
- /* If we haven't matched the entire string, and we want the
|
|
7278 |
- longest match, try backtracking. */
|
|
7279 |
- if (d != end_match_2)
|
|
7280 |
- {
|
|
7281 |
- DEBUG_PRINT1 ("backtracking.\n");
|
|
7282 |
-
|
|
7283 |
- if (!FAIL_STACK_EMPTY ())
|
|
7284 |
- { /* More failure points to try. */
|
|
7285 |
- boolean same_str_p = (FIRST_STRING_P (match_end)
|
|
7286 |
- == MATCHING_IN_FIRST_STRING);
|
|
7287 |
-
|
|
7288 |
- /* If exceeds best match so far, save it. */
|
|
7289 |
- if (!best_regs_set
|
|
7290 |
- || (same_str_p && d > match_end)
|
|
7291 |
- || (!same_str_p && !MATCHING_IN_FIRST_STRING))
|
|
7292 |
- {
|
|
7293 |
- best_regs_set = true;
|
|
7294 |
- match_end = d;
|
|
7295 |
-
|
|
7296 |
- DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
|
|
7297 |
-
|
|
7298 |
- for (mcnt = 1; mcnt < num_regs; mcnt++)
|
|
7299 |
- {
|
|
7300 |
- best_regstart[mcnt] = regstart[mcnt];
|
|
7301 |
- best_regend[mcnt] = regend[mcnt];
|
|
7302 |
- }
|
|
7303 |
- }
|
|
7304 |
- goto fail;
|
|
7305 |
- }
|
|
7306 |
-
|
|
7307 |
- /* If no failure points, don't restore garbage. */
|
|
7308 |
- else if (best_regs_set)
|
|
7309 |
- {
|
|
7310 |
- restore_best_regs:
|
|
7311 |
- /* Restore best match. It may happen that `dend ==
|
|
7312 |
- end_match_1' while the restored d is in string2.
|
|
7313 |
- For example, the pattern `x.*y.*z' against the
|
|
7314 |
- strings `x-' and `y-z-', if the two strings are
|
|
7315 |
- not consecutive in memory. */
|
|
7316 |
- DEBUG_PRINT1 ("Restoring best registers.\n");
|
|
7317 |
-
|
|
7318 |
- d = match_end;
|
|
7319 |
- dend = ((d >= string1 && d <= end1)
|
|
7320 |
- ? end_match_1 : end_match_2);
|
|
7321 |
-
|
|
7322 |
- for (mcnt = 1; mcnt < num_regs; mcnt++)
|
|
7323 |
- {
|
|
7324 |
- regstart[mcnt] = best_regstart[mcnt];
|
|
7325 |
- regend[mcnt] = best_regend[mcnt];
|
|
7326 |
- }
|
|
7327 |
- }
|
|
7328 |
- } /* d != end_match_2 */
|
|
7329 |
-
|
|
7330 |
- DEBUG_PRINT1 ("Accepting match.\n");
|
|
7331 |
-
|
|
7332 |
- /* If caller wants register contents data back, do it. */
|
|
7333 |
- if (regs && !bufp->no_sub)
|
|
7334 |
- {
|
|
7335 |
- /* Have the register data arrays been allocated? */
|
|
7336 |
- if (bufp->regs_allocated == REGS_UNALLOCATED)
|
|
7337 |
- { /* No. So allocate them with malloc. We need one
|
|
7338 |
- extra element beyond `num_regs' for the `-1' marker
|
|
7339 |
- GNU code uses. */
|
|
7340 |
- regs->num_regs = MAX (RE_NREGS, num_regs + 1);
|
|
7341 |
- regs->start = TALLOC (regs->num_regs, regoff_t);
|
|
7342 |
- regs->end = TALLOC (regs->num_regs, regoff_t);
|
|
7343 |
- if (regs->start == NULL || regs->end == NULL)
|
|
7344 |
- return -2;
|
|
7345 |
- bufp->regs_allocated = REGS_REALLOCATE;
|
|
7346 |
- }
|
|
7347 |
- else if (bufp->regs_allocated == REGS_REALLOCATE)
|
|
7348 |
- { /* Yes. If we need more elements than were already
|
|
7349 |
- allocated, reallocate them. If we need fewer, just
|
|
7350 |
- leave it alone. */
|
|
7351 |
- if (regs->num_regs < num_regs + 1)
|
|
7352 |
- {
|
|
7353 |
- regs->num_regs = num_regs + 1;
|
|
7354 |
- RETALLOC (regs->start, regs->num_regs, regoff_t);
|
|
7355 |
- RETALLOC (regs->end, regs->num_regs, regoff_t);
|
|
7356 |
- if (regs->start == NULL || regs->end == NULL)
|
|
7357 |
- return -2;
|
|
7358 |
- }
|
|
7359 |
- }
|
|
7360 |
- else
|
|
7361 |
- assert (bufp->regs_allocated == REGS_FIXED);
|
|
7362 |
-
|
|
7363 |
- /* Convert the pointer data in `regstart' and `regend' to
|
|
7364 |
- indices. Register zero has to be set differently,
|
|
7365 |
- since we haven't kept track of any info for it. */
|
|
7366 |
- if (regs->num_regs > 0)
|
|
7367 |
- {
|
|
7368 |
- regs->start[0] = pos;
|
|
7369 |
- regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
|
|
7370 |
- : d - string2 + size1);
|
|
7371 |
- }
|
|
7372 |
-
|
|
7373 |
- /* Go through the first `min (num_regs, regs->num_regs)'
|
|
7374 |
- registers, since that is all we initialized. */
|
|
7375 |
- for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
|
|
7376 |
- {
|
|
7377 |
- if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
|
|
7378 |
- regs->start[mcnt] = regs->end[mcnt] = -1;
|
|
7379 |
- else
|
|
7380 |
- {
|
|
7381 |
- regs->start[mcnt] = POINTER_TO_OFFSET (regstart[mcnt]);
|
|
7382 |
- regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
|
|
7383 |
- }
|
|
7384 |
- }
|
|
7385 |
-
|
|
7386 |
- /* If the regs structure we return has more elements than
|
|
7387 |
- were in the pattern, set the extra elements to -1. If
|
|
7388 |
- we (re)allocated the registers, this is the case,
|
|
7389 |
- because we always allocate enough to have at least one
|
|
7390 |
- -1 at the end. */
|
|
7391 |
- for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
|
|
7392 |
- regs->start[mcnt] = regs->end[mcnt] = -1;
|
|
7393 |
- } /* regs && !bufp->no_sub */
|
|
7394 |
-
|
|
7395 |
- FREE_VARIABLES ();
|
|
7396 |
- DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
|
|
7397 |
- nfailure_points_pushed, nfailure_points_popped,
|
|
7398 |
- nfailure_points_pushed - nfailure_points_popped);
|
|
7399 |
- DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
|
|
7400 |
-
|
|
7401 |
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING
|
|
7402 |
- ? string1
|
|
7403 |
- : string2 - size1);
|
|
7404 |
-
|
|
7405 |
- DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
|
|
7406 |
-
|
|
7407 |
- return mcnt;
|
|
7408 |
- }
|
|
7409 |
-
|
|
7410 |
- /* Otherwise match next pattern command. */
|
|
7411 |
-#ifdef SWITCH_ENUM_BUG
|
|
7412 |
- switch ((int) ((re_opcode_t) *p++))
|
|
7413 |
-#else
|
|
7414 |
- switch ((re_opcode_t) *p++)
|
|
7415 |
-#endif
|
|
7416 |
- {
|
|
7417 |
- /* Ignore these. Used to ignore the n of succeed_n's which
|
|
7418 |
- currently have n == 0. */
|
|
7419 |
- case no_op:
|
|
7420 |
- DEBUG_PRINT1 ("EXECUTING no_op.\n");
|
|
7421 |
- break;
|
|
7422 |
-
|
|
7423 |
-
|
|
7424 |
- /* Match the next n pattern characters exactly. The following
|
|
7425 |
- byte in the pattern defines n, and the n bytes after that
|
|
7426 |
- are the characters to match. */
|
|
7427 |
- case exactn:
|
|
7428 |
- mcnt = *p++;
|
|
7429 |
- DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
|
|
7430 |
-
|
|
7431 |
- /* This is written out as an if-else so we don't waste time
|
|
7432 |
- testing `translate' inside the loop. */
|
|
7433 |
- if (translate)
|
|
7434 |
- {
|
|
7435 |
- do
|
|
7436 |
- {
|
|
7437 |
- PREFETCH ();
|
|
7438 |
- if (translate[(unsigned char) *d++] != (char) *p++)
|
|
7439 |
- goto fail;
|
|
7440 |
- }
|
|
7441 |
- while (--mcnt);
|
|
7442 |
- }
|
|
7443 |
- else
|
|
7444 |
- {
|
|
7445 |
- do
|
|
7446 |
- {
|
|
7447 |
- PREFETCH ();
|
|
7448 |
- if (*d++ != (char) *p++) goto fail;
|
|
7449 |
- }
|
|
7450 |
- while (--mcnt);
|
|
7451 |
- }
|
|
7452 |
- SET_REGS_MATCHED ();
|
|
7453 |
- break;
|
|
7454 |
-
|
|
7455 |
-
|
|
7456 |
- /* Match any character except possibly a newline or a null. */
|
|
7457 |
- case anychar:
|
|
7458 |
- DEBUG_PRINT1 ("EXECUTING anychar.\n");
|
|
7459 |
-
|
|
7460 |
- PREFETCH ();
|
|
7461 |
-
|
|
7462 |
- if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
|
|
7463 |
- || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
|
|
7464 |
- goto fail;
|
|
7465 |
-
|
|
7466 |
- SET_REGS_MATCHED ();
|
|
7467 |
- DEBUG_PRINT2 (" Matched `%d'.\n", *d);
|
|
7468 |
- d++;
|
|
7469 |
- break;
|
|
7470 |
-
|
|
7471 |
-
|
|
7472 |
- case charset:
|
|
7473 |
- case charset_not:
|
|
7474 |
- {
|
|
7475 |
- register unsigned char c;
|
|
7476 |
- boolean not = (re_opcode_t) *(p - 1) == charset_not;
|
|
7477 |
-
|
|
7478 |
- DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
|
|
7479 |
-
|
|
7480 |
- PREFETCH ();
|
|
7481 |
- c = TRANSLATE (*d); /* The character to match. */
|
|
7482 |
-
|
|
7483 |
- /* Cast to `unsigned' instead of `unsigned char' in case the
|
|
7484 |
- bit list is a full 32 bytes long. */
|
|
7485 |
- if (c < (unsigned) (*p * BYTEWIDTH)
|
|
7486 |
- && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
|
|
7487 |
- not = !not;
|
|
7488 |
-
|
|
7489 |
- p += 1 + *p;
|
|
7490 |
-
|
|
7491 |
- if (!not) goto fail;
|
|
7492 |
-
|
|
7493 |
- SET_REGS_MATCHED ();
|
|
7494 |
- d++;
|
|
7495 |
- break;
|
|
7496 |
- }
|
|
7497 |
-
|
|
7498 |
-
|
|
7499 |
- /* The beginning of a group is represented by start_memory.
|
|
7500 |
- The arguments are the register number in the next byte, and the
|
|
7501 |
- number of groups inner to this one in the next. The text
|
|
7502 |
- matched within the group is recorded (in the internal
|
|
7503 |
- registers data structure) under the register number. */
|
|
7504 |
- case start_memory:
|
|
7505 |
- DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]);
|
|
7506 |
-
|
|
7507 |
- /* Find out if this group can match the empty string. */
|
|
7508 |
- p1 = p; /* To send to group_match_null_string_p. */
|
|
7509 |
-
|
|
7510 |
- if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
|
|
7511 |
- REG_MATCH_NULL_STRING_P (reg_info[*p])
|
|
7512 |
- = group_match_null_string_p (&p1, pend, reg_info);
|
|
7513 |
-
|
|
7514 |
- /* Save the position in the string where we were the last time
|
|
7515 |
- we were at this open-group operator in case the group is
|
|
7516 |
- operated upon by a repetition operator, e.g., with `(a*)*b'
|
|
7517 |
- against `ab'; then we want to ignore where we are now in
|
|
7518 |
- the string in case this attempt to match fails. */
|
|
7519 |
- old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
|
|
7520 |
- ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
|
|
7521 |
- : regstart[*p];
|
|
7522 |
- DEBUG_PRINT2 (" old_regstart: %d\n",
|
|
7523 |
- POINTER_TO_OFFSET (old_regstart[*p]));
|
|
7524 |
-
|
|
7525 |
- regstart[*p] = d;
|
|
7526 |
- DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
|
|
7527 |
-
|
|
7528 |
- IS_ACTIVE (reg_info[*p]) = 1;
|
|
7529 |
- MATCHED_SOMETHING (reg_info[*p]) = 0;
|
|
7530 |
-
|
|
7531 |
- /* This is the new highest active register. */
|
|
7532 |
- highest_active_reg = *p;
|
|
7533 |
-
|
|
7534 |
- /* If nothing was active before, this is the new lowest active
|
|
7535 |
- register. */
|
|
7536 |
- if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
|
|
7537 |
- lowest_active_reg = *p;
|
|
7538 |
-
|
|
7539 |
- /* Move past the register number and inner group count. */
|
|
7540 |
- p += 2;
|
|
7541 |
- break;
|
|
7542 |
-
|
|
7543 |
-
|
|
7544 |
- /* The stop_memory opcode represents the end of a group. Its
|
|
7545 |
- arguments are the same as start_memory's: the register
|
|
7546 |
- number, and the number of inner groups. */
|
|
7547 |
- case stop_memory:
|
|
7548 |
- DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
|
|
7549 |
-
|
|
7550 |
- /* We need to save the string position the last time we were at
|
|
7551 |
- this close-group operator in case the group is operated
|
|
7552 |
- upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
|
|
7553 |
- against `aba'; then we want to ignore where we are now in
|
|
7554 |
- the string in case this attempt to match fails. */
|
|
7555 |
- old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
|
|
7556 |
- ? REG_UNSET (regend[*p]) ? d : regend[*p]
|
|
7557 |
- : regend[*p];
|
|
7558 |
- DEBUG_PRINT2 (" old_regend: %d\n",
|
|
7559 |
- POINTER_TO_OFFSET (old_regend[*p]));
|
|
7560 |
-
|
|
7561 |
- regend[*p] = d;
|
|
7562 |
- DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
|
|
7563 |
-
|
|
7564 |
- /* This register isn't active anymore. */
|
|
7565 |
- IS_ACTIVE (reg_info[*p]) = 0;
|
|
7566 |
-
|
|
7567 |
- /* If this was the only register active, nothing is active
|
|
7568 |
- anymore. */
|
|
7569 |
- if (lowest_active_reg == highest_active_reg)
|
|
7570 |
- {
|
|
7571 |
- lowest_active_reg = NO_LOWEST_ACTIVE_REG;
|
|
7572 |
- highest_active_reg = NO_HIGHEST_ACTIVE_REG;
|
|
7573 |
- }
|
|
7574 |
- else
|
|
7575 |
- { /* We must scan for the new highest active register, since
|
|
7576 |
- it isn't necessarily one less than now: consider
|
|
7577 |
- (a(b)c(d(e)f)g). When group 3 ends, after the f), the
|
|
7578 |
- new highest active register is 1. */
|
|
7579 |
- unsigned char r = *p - 1;
|
|
7580 |
- while (r > 0 && !IS_ACTIVE (reg_info[r]))
|
|
7581 |
- r--;
|
|
7582 |
-
|
|
7583 |
- /* If we end up at register zero, that means that we saved
|
|
7584 |
- the registers as the result of an `on_failure_jump', not
|
|
7585 |
- a `start_memory', and we jumped to past the innermost
|
|
7586 |
- `stop_memory'. For example, in ((.)*) we save
|
|
7587 |
- registers 1 and 2 as a result of the *, but when we pop
|
|
7588 |
- back to the second ), we are at the stop_memory 1.
|
|
7589 |
- Thus, nothing is active. */
|
|
7590 |
- if (r == 0)
|
|
7591 |
- {
|
|
7592 |
- lowest_active_reg = NO_LOWEST_ACTIVE_REG;
|
|
7593 |
- highest_active_reg = NO_HIGHEST_ACTIVE_REG;
|
|
7594 |
- }
|
|
7595 |
- else
|
|
7596 |
- highest_active_reg = r;
|
|
7597 |
- }
|
|
7598 |
-
|
|
7599 |
- /* If just failed to match something this time around with a
|
|
7600 |
- group that's operated on by a repetition operator, try to
|
|
7601 |
- force exit from the ``loop'', and restore the register
|
|
7602 |
- information for this group that we had before trying this
|
|
7603 |
- last match. */
|
|
7604 |
- if ((!MATCHED_SOMETHING (reg_info[*p])
|
|
7605 |
- || (re_opcode_t) p[-3] == start_memory)
|
|
7606 |
- && (p + 2) < pend)
|
|
7607 |
- {
|
|
7608 |
- boolean is_a_jump_n = false;
|
|
7609 |
-
|
|
7610 |
- p1 = p + 2;
|
|
7611 |
- mcnt = 0;
|
|
7612 |
- switch ((re_opcode_t) *p1++)
|
|
7613 |
- {
|
|
7614 |
- case jump_n:
|
|
7615 |
- is_a_jump_n = true;
|
|
7616 |
- case pop_failure_jump:
|
|
7617 |
- case maybe_pop_jump:
|
|
7618 |
- case jump:
|
|
7619 |
- case dummy_failure_jump:
|
|
7620 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
7621 |
- if (is_a_jump_n)
|
|
7622 |
- p1 += 2;
|
|
7623 |
- break;
|
|
7624 |
-
|
|
7625 |
- default:
|
|
7626 |
- /* do nothing */ ;
|
|
7627 |
- }
|
|
7628 |
- p1 += mcnt;
|
|
7629 |
-
|
|
7630 |
- /* If the next operation is a jump backwards in the pattern
|
|
7631 |
- to an on_failure_jump right before the start_memory
|
|
7632 |
- corresponding to this stop_memory, exit from the loop
|
|
7633 |
- by forcing a failure after pushing on the stack the
|
|
7634 |
- on_failure_jump's jump in the pattern, and d. */
|
|
7635 |
- if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
|
|
7636 |
- && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
|
|
7637 |
- {
|
|
7638 |
- /* If this group ever matched anything, then restore
|
|
7639 |
- what its registers were before trying this last
|
|
7640 |
- failed match, e.g., with `(a*)*b' against `ab' for
|
|
7641 |
- regstart[1], and, e.g., with `((a*)*(b*)*)*'
|
|
7642 |
- against `aba' for regend[3].
|
|
7643 |
-
|
|
7644 |
- Also restore the registers for inner groups for,
|
|
7645 |
- e.g., `((a*)(b*))*' against `aba' (register 3 would
|
|
7646 |
- otherwise get trashed). */
|
|
7647 |
-
|
|
7648 |
- if (EVER_MATCHED_SOMETHING (reg_info[*p]))
|
|
7649 |
- {
|
|
7650 |
- unsigned r;
|
|
7651 |
-
|
|
7652 |
- EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
|
|
7653 |
-
|
|
7654 |
- /* Restore this and inner groups' (if any) registers. */
|
|
7655 |
- for (r = *p; r < *p + *(p + 1); r++)
|
|
7656 |
- {
|
|
7657 |
- regstart[r] = old_regstart[r];
|
|
7658 |
-
|
|
7659 |
- /* xx why this test? */
|
|
7660 |
- if ((int) old_regend[r] >= (int) regstart[r])
|
|
7661 |
- regend[r] = old_regend[r];
|
|
7662 |
- }
|
|
7663 |
- }
|
|
7664 |
- p1++;
|
|
7665 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
7666 |
- PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
|
|
7667 |
-
|
|
7668 |
- goto fail;
|
|
7669 |
- }
|
|
7670 |
- }
|
|
7671 |
-
|
|
7672 |
- /* Move past the register number and the inner group count. */
|
|
7673 |
- p += 2;
|
|
7674 |
- break;
|
|
7675 |
-
|
|
7676 |
-
|
|
7677 |
- /* \<digit> has been turned into a `duplicate' command which is
|
|
7678 |
- followed by the numeric value of <digit> as the register number. */
|
|
7679 |
- case duplicate:
|
|
7680 |
- {
|
|
7681 |
- register const char *d2, *dend2;
|
|
7682 |
- int regno = *p++; /* Get which register to match against. */
|
|
7683 |
- DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
|
|
7684 |
-
|
|
7685 |
- /* Can't back reference a group which we've never matched. */
|
|
7686 |
- if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
|
|
7687 |
- goto fail;
|
|
7688 |
-
|
|
7689 |
- /* Where in input to try to start matching. */
|
|
7690 |
- d2 = regstart[regno];
|
|
7691 |
-
|
|
7692 |
- /* Where to stop matching; if both the place to start and
|
|
7693 |
- the place to stop matching are in the same string, then
|
|
7694 |
- set to the place to stop, otherwise, for now have to use
|
|
7695 |
- the end of the first string. */
|
|
7696 |
-
|
|
7697 |
- dend2 = ((FIRST_STRING_P (regstart[regno])
|
|
7698 |
- == FIRST_STRING_P (regend[regno]))
|
|
7699 |
- ? regend[regno] : end_match_1);
|
|
7700 |
- for (;;)
|
|
7701 |
- {
|
|
7702 |
- /* If necessary, advance to next segment in register
|
|
7703 |
- contents. */
|
|
7704 |
- while (d2 == dend2)
|
|
7705 |
- {
|
|
7706 |
- if (dend2 == end_match_2) break;
|
|
7707 |
- if (dend2 == regend[regno]) break;
|
|
7708 |
-
|
|
7709 |
- /* End of string1 => advance to string2. */
|
|
7710 |
- d2 = string2;
|
|
7711 |
- dend2 = regend[regno];
|
|
7712 |
- }
|
|
7713 |
- /* At end of register contents => success */
|
|
7714 |
- if (d2 == dend2) break;
|
|
7715 |
-
|
|
7716 |
- /* If necessary, advance to next segment in data. */
|
|
7717 |
- PREFETCH ();
|
|
7718 |
-
|
|
7719 |
- /* How many characters left in this segment to match. */
|
|
7720 |
- mcnt = dend - d;
|
|
7721 |
-
|
|
7722 |
- /* Want how many consecutive characters we can match in
|
|
7723 |
- one shot, so, if necessary, adjust the count. */
|
|
7724 |
- if (mcnt > dend2 - d2)
|
|
7725 |
- mcnt = dend2 - d2;
|
|
7726 |
-
|
|
7727 |
- /* Compare that many; failure if mismatch, else move
|
|
7728 |
- past them. */
|
|
7729 |
- if (translate
|
|
7730 |
- ? bcmp_translate (d, d2, mcnt, translate)
|
|
7731 |
- : bcmp (d, d2, mcnt))
|
|
7732 |
- goto fail;
|
|
7733 |
- d += mcnt, d2 += mcnt;
|
|
7734 |
- }
|
|
7735 |
- }
|
|
7736 |
- break;
|
|
7737 |
-
|
|
7738 |
-
|
|
7739 |
- /* begline matches the empty string at the beginning of the string
|
|
7740 |
- (unless `not_bol' is set in `bufp'), and, if
|
|
7741 |
- `newline_anchor' is set, after newlines. */
|
|
7742 |
- case begline:
|
|
7743 |
- DEBUG_PRINT1 ("EXECUTING begline.\n");
|
|
7744 |
-
|
|
7745 |
- if (AT_STRINGS_BEG (d))
|
|
7746 |
- {
|
|
7747 |
- if (!bufp->not_bol) break;
|
|
7748 |
- }
|
|
7749 |
- else if (d[-1] == '\n' && bufp->newline_anchor)
|
|
7750 |
- {
|
|
7751 |
- break;
|
|
7752 |
- }
|
|
7753 |
- /* In all other cases, we fail. */
|
|
7754 |
- goto fail;
|
|
7755 |
-
|
|
7756 |
-
|
|
7757 |
- /* endline is the dual of begline. */
|
|
7758 |
- case endline:
|
|
7759 |
- DEBUG_PRINT1 ("EXECUTING endline.\n");
|
|
7760 |
-
|
|
7761 |
- if (AT_STRINGS_END (d))
|
|
7762 |
- {
|
|
7763 |
- if (!bufp->not_eol) break;
|
|
7764 |
- }
|
|
7765 |
-
|
|
7766 |
- /* We have to ``prefetch'' the next character. */
|
|
7767 |
- else if ((d == end1 ? *string2 : *d) == '\n'
|
|
7768 |
- && bufp->newline_anchor)
|
|
7769 |
- {
|
|
7770 |
- break;
|
|
7771 |
- }
|
|
7772 |
- goto fail;
|
|
7773 |
-
|
|
7774 |
-
|
|
7775 |
- /* Match at the very beginning of the data. */
|
|
7776 |
- case begbuf:
|
|
7777 |
- DEBUG_PRINT1 ("EXECUTING begbuf.\n");
|
|
7778 |
- if (AT_STRINGS_BEG (d))
|
|
7779 |
- break;
|
|
7780 |
- goto fail;
|
|
7781 |
-
|
|
7782 |
-
|
|
7783 |
- /* Match at the very end of the data. */
|
|
7784 |
- case endbuf:
|
|
7785 |
- DEBUG_PRINT1 ("EXECUTING endbuf.\n");
|
|
7786 |
- if (AT_STRINGS_END (d))
|
|
7787 |
- break;
|
|
7788 |
- goto fail;
|
|
7789 |
-
|
|
7790 |
-
|
|
7791 |
- /* on_failure_keep_string_jump is used to optimize `.*\n'. It
|
|
7792 |
- pushes NULL as the value for the string on the stack. Then
|
|
7793 |
- `pop_failure_point' will keep the current value for the
|
|
7794 |
- string, instead of restoring it. To see why, consider
|
|
7795 |
- matching `foo\nbar' against `.*\n'. The .* matches the foo;
|
|
7796 |
- then the . fails against the \n. But the next thing we want
|
|
7797 |
- to do is match the \n against the \n; if we restored the
|
|
7798 |
- string value, we would be back at the foo.
|
|
7799 |
-
|
|
7800 |
- Because this is used only in specific cases, we don't need to
|
|
7801 |
- check all the things that `on_failure_jump' does, to make
|
|
7802 |
- sure the right things get saved on the stack. Hence we don't
|
|
7803 |
- share its code. The only reason to push anything on the
|
|
7804 |
- stack at all is that otherwise we would have to change
|
|
7805 |
- `anychar's code to do something besides goto fail in this
|
|
7806 |
- case; that seems worse than this. */
|
|
7807 |
- case on_failure_keep_string_jump:
|
|
7808 |
- DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
|
|
7809 |
-
|
|
7810 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
|
|
7811 |
- DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
|
|
7812 |
-
|
|
7813 |
- PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
|
|
7814 |
- break;
|
|
7815 |
-
|
|
7816 |
-
|
|
7817 |
- /* Uses of on_failure_jump:
|
|
7818 |
-
|
|
7819 |
- Each alternative starts with an on_failure_jump that points
|
|
7820 |
- to the beginning of the next alternative. Each alternative
|
|
7821 |
- except the last ends with a jump that in effect jumps past
|
|
7822 |
- the rest of the alternatives. (They really jump to the
|
|
7823 |
- ending jump of the following alternative, because tensioning
|
|
7824 |
- these jumps is a hassle.)
|
|
7825 |
-
|
|
7826 |
- Repeats start with an on_failure_jump that points past both
|
|
7827 |
- the repetition text and either the following jump or
|
|
7828 |
- pop_failure_jump back to this on_failure_jump. */
|
|
7829 |
- case on_failure_jump:
|
|
7830 |
- on_failure:
|
|
7831 |
- DEBUG_PRINT1 ("EXECUTING on_failure_jump");
|
|
7832 |
-
|
|
7833 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
|
|
7834 |
- DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
|
|
7835 |
-
|
|
7836 |
- /* If this on_failure_jump comes right before a group (i.e.,
|
|
7837 |
- the original * applied to a group), save the information
|
|
7838 |
- for that group and all inner ones, so that if we fail back
|
|
7839 |
- to this point, the group's information will be correct.
|
|
7840 |
- For example, in \(a*\)*\1, we need the preceding group,
|
|
7841 |
- and in \(\(a*\)b*\)\2, we need the inner group. */
|
|
7842 |
-
|
|
7843 |
- /* We can't use `p' to check ahead because we push
|
|
7844 |
- a failure point to `p + mcnt' after we do this. */
|
|
7845 |
- p1 = p;
|
|
7846 |
-
|
|
7847 |
- /* We need to skip no_op's before we look for the
|
|
7848 |
- start_memory in case this on_failure_jump is happening as
|
|
7849 |
- the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
|
|
7850 |
- against aba. */
|
|
7851 |
- while (p1 < pend && (re_opcode_t) *p1 == no_op)
|
|
7852 |
- p1++;
|
|
7853 |
-
|
|
7854 |
- if (p1 < pend && (re_opcode_t) *p1 == start_memory)
|
|
7855 |
- {
|
|
7856 |
- /* We have a new highest active register now. This will
|
|
7857 |
- get reset at the start_memory we are about to get to,
|
|
7858 |
- but we will have saved all the registers relevant to
|
|
7859 |
- this repetition op, as described above. */
|
|
7860 |
- highest_active_reg = *(p1 + 1) + *(p1 + 2);
|
|
7861 |
- if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
|
|
7862 |
- lowest_active_reg = *(p1 + 1);
|
|
7863 |
- }
|
|
7864 |
-
|
|
7865 |
- DEBUG_PRINT1 (":\n");
|
|
7866 |
- PUSH_FAILURE_POINT (p + mcnt, d, -2);
|
|
7867 |
- break;
|
|
7868 |
-
|
|
7869 |
-
|
|
7870 |
- /* A smart repeat ends with `maybe_pop_jump'.
|
|
7871 |
- We change it to either `pop_failure_jump' or `jump'. */
|
|
7872 |
- case maybe_pop_jump:
|
|
7873 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
|
|
7874 |
- DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
|
|
7875 |
- {
|
|
7876 |
- register unsigned char *p2 = p;
|
|
7877 |
-
|
|
7878 |
- /* Compare the beginning of the repeat with what in the
|
|
7879 |
- pattern follows its end. If we can establish that there
|
|
7880 |
- is nothing that they would both match, i.e., that we
|
|
7881 |
- would have to backtrack because of (as in, e.g., `a*a')
|
|
7882 |
- then we can change to pop_failure_jump, because we'll
|
|
7883 |
- never have to backtrack.
|
|
7884 |
-
|
|
7885 |
- This is not true in the case of alternatives: in
|
|
7886 |
- `(a|ab)*' we do need to backtrack to the `ab' alternative
|
|
7887 |
- (e.g., if the string was `ab'). But instead of trying to
|
|
7888 |
- detect that here, the alternative has put on a dummy
|
|
7889 |
- failure point which is what we will end up popping. */
|
|
7890 |
-
|
|
7891 |
- /* Skip over open/close-group commands. */
|
|
7892 |
- while (p2 + 2 < pend
|
|
7893 |
- && ((re_opcode_t) *p2 == stop_memory
|
|
7894 |
- || (re_opcode_t) *p2 == start_memory))
|
|
7895 |
- p2 += 3; /* Skip over args, too. */
|
|
7896 |
-
|
|
7897 |
- /* If we're at the end of the pattern, we can change. */
|
|
7898 |
- if (p2 == pend)
|
|
7899 |
- {
|
|
7900 |
- /* Consider what happens when matching ":\(.*\)"
|
|
7901 |
- against ":/". I don't really understand this code
|
|
7902 |
- yet. */
|
|
7903 |
- p[-3] = (unsigned char) pop_failure_jump;
|
|
7904 |
- DEBUG_PRINT1
|
|
7905 |
- (" End of pattern: change to `pop_failure_jump'.\n");
|
|
7906 |
- }
|
|
7907 |
-
|
|
7908 |
- else if ((re_opcode_t) *p2 == exactn
|
|
7909 |
- || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
|
|
7910 |
- {
|
|
7911 |
- register unsigned char c
|
|
7912 |
- = *p2 == (unsigned char) endline ? '\n' : p2[2];
|
|
7913 |
- p1 = p + mcnt;
|
|
7914 |
-
|
|
7915 |
- /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
|
|
7916 |
- to the `maybe_finalize_jump' of this case. Examine what
|
|
7917 |
- follows. */
|
|
7918 |
- if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
|
|
7919 |
- {
|
|
7920 |
- p[-3] = (unsigned char) pop_failure_jump;
|
|
7921 |
- DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
|
|
7922 |
- c, p1[5]);
|
|
7923 |
- }
|
|
7924 |
-
|
|
7925 |
- else if ((re_opcode_t) p1[3] == charset
|
|
7926 |
- || (re_opcode_t) p1[3] == charset_not)
|
|
7927 |
- {
|
|
7928 |
- int not = (re_opcode_t) p1[3] == charset_not;
|
|
7929 |
-
|
|
7930 |
- if (c < (unsigned char) (p1[4] * BYTEWIDTH)
|
|
7931 |
- && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
|
|
7932 |
- not = !not;
|
|
7933 |
-
|
|
7934 |
- /* `not' is equal to 1 if c would match, which means
|
|
7935 |
- that we can't change to pop_failure_jump. */
|
|
7936 |
- if (!not)
|
|
7937 |
- {
|
|
7938 |
- p[-3] = (unsigned char) pop_failure_jump;
|
|
7939 |
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
|
|
7940 |
- }
|
|
7941 |
- }
|
|
7942 |
- }
|
|
7943 |
- }
|
|
7944 |
- p -= 2; /* Point at relative address again. */
|
|
7945 |
- if ((re_opcode_t) p[-1] != pop_failure_jump)
|
|
7946 |
- {
|
|
7947 |
- p[-1] = (unsigned char) jump;
|
|
7948 |
- DEBUG_PRINT1 (" Match => jump.\n");
|
|
7949 |
- goto unconditional_jump;
|
|
7950 |
- }
|
|
7951 |
- /* Note fall through. */
|
|
7952 |
-
|
|
7953 |
-
|
|
7954 |
- /* The end of a simple repeat has a pop_failure_jump back to
|
|
7955 |
- its matching on_failure_jump, where the latter will push a
|
|
7956 |
- failure point. The pop_failure_jump takes off failure
|
|
7957 |
- points put on by this pop_failure_jump's matching
|
|
7958 |
- on_failure_jump; we got through the pattern to here from the
|
|
7959 |
- matching on_failure_jump, so didn't fail. */
|
|
7960 |
- case pop_failure_jump:
|
|
7961 |
- {
|
|
7962 |
- /* We need to pass separate storage for the lowest and
|
|
7963 |
- highest registers, even though we don't care about the
|
|
7964 |
- actual values. Otherwise, we will restore only one
|
|
7965 |
- register from the stack, since lowest will == highest in
|
|
7966 |
- `pop_failure_point'. */
|
|
7967 |
- unsigned dummy_low_reg, dummy_high_reg;
|
|
7968 |
- unsigned char *pdummy;
|
|
7969 |
- const char *sdummy;
|
|
7970 |
-
|
|
7971 |
- DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
|
|
7972 |
- POP_FAILURE_POINT (sdummy, pdummy,
|
|
7973 |
- dummy_low_reg, dummy_high_reg,
|
|
7974 |
- reg_dummy, reg_dummy, reg_info_dummy);
|
|
7975 |
- }
|
|
7976 |
- /* Note fall through. */
|
|
7977 |
-
|
|
7978 |
-
|
|
7979 |
- /* Unconditionally jump (without popping any failure points). */
|
|
7980 |
- case jump:
|
|
7981 |
- unconditional_jump:
|
|
7982 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */
|
|
7983 |
- DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
|
|
7984 |
- p += mcnt; /* Do the jump. */
|
|
7985 |
- DEBUG_PRINT2 ("(to 0x%x).\n", p);
|
|
7986 |
- break;
|
|
7987 |
-
|
|
7988 |
-
|
|
7989 |
- /* We need this opcode so we can detect where alternatives end
|
|
7990 |
- in `group_match_null_string_p' et al. */
|
|
7991 |
- case jump_past_alt:
|
|
7992 |
- DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
|
|
7993 |
- goto unconditional_jump;
|
|
7994 |
-
|
|
7995 |
-
|
|
7996 |
- /* Normally, the on_failure_jump pushes a failure point, which
|
|
7997 |
- then gets popped at pop_failure_jump. We will end up at
|
|
7998 |
- pop_failure_jump, also, and with a pattern of, say, `a+', we
|
|
7999 |
- are skipping over the on_failure_jump, so we have to push
|
|
8000 |
- something meaningless for pop_failure_jump to pop. */
|
|
8001 |
- case dummy_failure_jump:
|
|
8002 |
- DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
|
|
8003 |
- /* It doesn't matter what we push for the string here. What
|
|
8004 |
- the code at `fail' tests is the value for the pattern. */
|
|
8005 |
- PUSH_FAILURE_POINT (0, 0, -2);
|
|
8006 |
- goto unconditional_jump;
|
|
8007 |
-
|
|
8008 |
-
|
|
8009 |
- /* At the end of an alternative, we need to push a dummy failure
|
|
8010 |
- point in case we are followed by a `pop_failure_jump', because
|
|
8011 |
- we don't want the failure point for the alternative to be
|
|
8012 |
- popped. For example, matching `(a|ab)*' against `aab'
|
|
8013 |
- requires that we match the `ab' alternative. */
|
|
8014 |
- case push_dummy_failure:
|
|
8015 |
- DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
|
|
8016 |
- /* See comments just above at `dummy_failure_jump' about the
|
|
8017 |
- two zeroes. */
|
|
8018 |
- PUSH_FAILURE_POINT (0, 0, -2);
|
|
8019 |
- break;
|
|
8020 |
-
|
|
8021 |
- /* Have to succeed matching what follows at least n times.
|
|
8022 |
- After that, handle like `on_failure_jump'. */
|
|
8023 |
- case succeed_n:
|
|
8024 |
- EXTRACT_NUMBER (mcnt, p + 2);
|
|
8025 |
- DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
|
|
8026 |
-
|
|
8027 |
- assert (mcnt >= 0);
|
|
8028 |
- /* Originally, this is how many times we HAVE to succeed. */
|
|
8029 |
- if (mcnt > 0)
|
|
8030 |
- {
|
|
8031 |
- mcnt--;
|
|
8032 |
- p += 2;
|
|
8033 |
- STORE_NUMBER_AND_INCR (p, mcnt);
|
|
8034 |
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt);
|
|
8035 |
- }
|
|
8036 |
- else if (mcnt == 0)
|
|
8037 |
- {
|
|
8038 |
- DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2);
|
|
8039 |
- p[2] = (unsigned char) no_op;
|
|
8040 |
- p[3] = (unsigned char) no_op;
|
|
8041 |
- goto on_failure;
|
|
8042 |
- }
|
|
8043 |
- break;
|
|
8044 |
-
|
|
8045 |
- case jump_n:
|
|
8046 |
- EXTRACT_NUMBER (mcnt, p + 2);
|
|
8047 |
- DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
|
|
8048 |
-
|
|
8049 |
- /* Originally, this is how many times we CAN jump. */
|
|
8050 |
- if (mcnt)
|
|
8051 |
- {
|
|
8052 |
- mcnt--;
|
|
8053 |
- STORE_NUMBER (p + 2, mcnt);
|
|
8054 |
- goto unconditional_jump;
|
|
8055 |
- }
|
|
8056 |
- /* If don't have to jump any more, skip over the rest of command. */
|
|
8057 |
- else
|
|
8058 |
- p += 4;
|
|
8059 |
- break;
|
|
8060 |
-
|
|
8061 |
- case set_number_at:
|
|
8062 |
- {
|
|
8063 |
- DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
|
|
8064 |
-
|
|
8065 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
|
|
8066 |
- p1 = p + mcnt;
|
|
8067 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
|
|
8068 |
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt);
|
|
8069 |
- STORE_NUMBER (p1, mcnt);
|
|
8070 |
- break;
|
|
8071 |
- }
|
|
8072 |
-
|
|
8073 |
- case wordbound:
|
|
8074 |
- DEBUG_PRINT1 ("EXECUTING wordbound.\n");
|
|
8075 |
- if (AT_WORD_BOUNDARY (d))
|
|
8076 |
- break;
|
|
8077 |
- goto fail;
|
|
8078 |
-
|
|
8079 |
- case notwordbound:
|
|
8080 |
- DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
|
|
8081 |
- if (AT_WORD_BOUNDARY (d))
|
|
8082 |
- goto fail;
|
|
8083 |
- break;
|
|
8084 |
-
|
|
8085 |
- case wordbeg:
|
|
8086 |
- DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
|
|
8087 |
- if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
|
|
8088 |
- break;
|
|
8089 |
- goto fail;
|
|
8090 |
-
|
|
8091 |
- case wordend:
|
|
8092 |
- DEBUG_PRINT1 ("EXECUTING wordend.\n");
|
|
8093 |
- if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
|
|
8094 |
- && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
|
|
8095 |
- break;
|
|
8096 |
- goto fail;
|
|
8097 |
-
|
|
8098 |
-#ifdef emacs
|
|
8099 |
-#ifdef emacs19
|
|
8100 |
- case before_dot:
|
|
8101 |
- DEBUG_PRINT1 ("EXECUTING before_dot.\n");
|
|
8102 |
- if (PTR_CHAR_POS ((unsigned char *) d) >= point)
|
|
8103 |
- goto fail;
|
|
8104 |
- break;
|
|
8105 |
-
|
|
8106 |
- case at_dot:
|
|
8107 |
- DEBUG_PRINT1 ("EXECUTING at_dot.\n");
|
|
8108 |
- if (PTR_CHAR_POS ((unsigned char *) d) != point)
|
|
8109 |
- goto fail;
|
|
8110 |
- break;
|
|
8111 |
-
|
|
8112 |
- case after_dot:
|
|
8113 |
- DEBUG_PRINT1 ("EXECUTING after_dot.\n");
|
|
8114 |
- if (PTR_CHAR_POS ((unsigned char *) d) <= point)
|
|
8115 |
- goto fail;
|
|
8116 |
- break;
|
|
8117 |
-#else /* not emacs19 */
|
|
8118 |
- case at_dot:
|
|
8119 |
- DEBUG_PRINT1 ("EXECUTING at_dot.\n");
|
|
8120 |
- if (PTR_CHAR_POS ((unsigned char *) d) + 1 != point)
|
|
8121 |
- goto fail;
|
|
8122 |
- break;
|
|
8123 |
-#endif /* not emacs19 */
|
|
8124 |
-
|
|
8125 |
- case syntaxspec:
|
|
8126 |
- DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
|
|
8127 |
- mcnt = *p++;
|
|
8128 |
- goto matchsyntax;
|
|
8129 |
-
|
|
8130 |
- case wordchar:
|
|
8131 |
- DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
|
|
8132 |
- mcnt = (int) Sword;
|
|
8133 |
- matchsyntax:
|
|
8134 |
- PREFETCH ();
|
|
8135 |
- if (SYNTAX (*d++) != (enum syntaxcode) mcnt)
|
|
8136 |
- goto fail;
|
|
8137 |
- SET_REGS_MATCHED ();
|
|
8138 |
- break;
|
|
8139 |
-
|
|
8140 |
- case notsyntaxspec:
|
|
8141 |
- DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
|
|
8142 |
- mcnt = *p++;
|
|
8143 |
- goto matchnotsyntax;
|
|
8144 |
-
|
|
8145 |
- case notwordchar:
|
|
8146 |
- DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
|
|
8147 |
- mcnt = (int) Sword;
|
|
8148 |
- matchnotsyntax:
|
|
8149 |
- PREFETCH ();
|
|
8150 |
- if (SYNTAX (*d++) == (enum syntaxcode) mcnt)
|
|
8151 |
- goto fail;
|
|
8152 |
- SET_REGS_MATCHED ();
|
|
8153 |
- break;
|
|
8154 |
-
|
|
8155 |
-#else /* not emacs */
|
|
8156 |
- case wordchar:
|
|
8157 |
- DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
|
|
8158 |
- PREFETCH ();
|
|
8159 |
- if (!WORDCHAR_P (d))
|
|
8160 |
- goto fail;
|
|
8161 |
- SET_REGS_MATCHED ();
|
|
8162 |
- d++;
|
|
8163 |
- break;
|
|
8164 |
-
|
|
8165 |
- case notwordchar:
|
|
8166 |
- DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
|
|
8167 |
- PREFETCH ();
|
|
8168 |
- if (WORDCHAR_P (d))
|
|
8169 |
- goto fail;
|
|
8170 |
- SET_REGS_MATCHED ();
|
|
8171 |
- d++;
|
|
8172 |
- break;
|
|
8173 |
-#endif /* not emacs */
|
|
8174 |
-
|
|
8175 |
- default:
|
|
8176 |
- abort ();
|
|
8177 |
- }
|
|
8178 |
- continue; /* Successfully executed one pattern command; keep going. */
|
|
8179 |
-
|
|
8180 |
-
|
|
8181 |
- /* We goto here if a matching operation fails. */
|
|
8182 |
- fail:
|
|
8183 |
- if (!FAIL_STACK_EMPTY ())
|
|
8184 |
- { /* A restart point is known. Restore to that state. */
|
|
8185 |
- DEBUG_PRINT1 ("\nFAIL:\n");
|
|
8186 |
- POP_FAILURE_POINT (d, p,
|
|
8187 |
- lowest_active_reg, highest_active_reg,
|
|
8188 |
- regstart, regend, reg_info);
|
|
8189 |
-
|
|
8190 |
- /* If this failure point is a dummy, try the next one. */
|
|
8191 |
- if (!p)
|
|
8192 |
- goto fail;
|
|
8193 |
-
|
|
8194 |
- /* If we failed to the end of the pattern, don't examine *p. */
|
|
8195 |
- assert (p <= pend);
|
|
8196 |
- if (p < pend)
|
|
8197 |
- {
|
|
8198 |
- boolean is_a_jump_n = false;
|
|
8199 |
-
|
|
8200 |
- /* If failed to a backwards jump that's part of a repetition
|
|
8201 |
- loop, need to pop this failure point and use the next one. */
|
|
8202 |
- switch ((re_opcode_t) *p)
|
|
8203 |
- {
|
|
8204 |
- case jump_n:
|
|
8205 |
- is_a_jump_n = true;
|
|
8206 |
- case maybe_pop_jump:
|
|
8207 |
- case pop_failure_jump:
|
|
8208 |
- case jump:
|
|
8209 |
- p1 = p + 1;
|
|
8210 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
8211 |
- p1 += mcnt;
|
|
8212 |
-
|
|
8213 |
- if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
|
|
8214 |
- || (!is_a_jump_n
|
|
8215 |
- && (re_opcode_t) *p1 == on_failure_jump))
|
|
8216 |
- goto fail;
|
|
8217 |
- break;
|
|
8218 |
- default:
|
|
8219 |
- /* do nothing */ ;
|
|
8220 |
- }
|
|
8221 |
- }
|
|
8222 |
-
|
|
8223 |
- if (d >= string1 && d <= end1)
|
|
8224 |
- dend = end_match_1;
|
|
8225 |
- }
|
|
8226 |
- else
|
|
8227 |
- break; /* Matching at this starting point really fails. */
|
|
8228 |
- } /* for (;;) */
|
|
8229 |
-
|
|
8230 |
- if (best_regs_set)
|
|
8231 |
- goto restore_best_regs;
|
|
8232 |
-
|
|
8233 |
- FREE_VARIABLES ();
|
|
8234 |
-
|
|
8235 |
- return -1; /* Failure to match. */
|
|
8236 |
-} /* re_match_2 */
|
|
8237 |
-
|
|
8238 |
-/* Subroutine definitions for re_match_2. */
|
|
8239 |
-
|
|
8240 |
-
|
|
8241 |
-/* We are passed P pointing to a register number after a start_memory.
|
|
8242 |
-
|
|
8243 |
- Return true if the pattern up to the corresponding stop_memory can
|
|
8244 |
- match the empty string, and false otherwise.
|
|
8245 |
-
|
|
8246 |
- If we find the matching stop_memory, sets P to point to one past its number.
|
|
8247 |
- Otherwise, sets P to an undefined byte less than or equal to END.
|
|
8248 |
-
|
|
8249 |
- We don't handle duplicates properly (yet). */
|
|
8250 |
-
|
|
8251 |
-static boolean
|
|
8252 |
-group_match_null_string_p (p, end, reg_info)
|
|
8253 |
- unsigned char **p, *end;
|
|
8254 |
- register_info_type *reg_info;
|
|
8255 |
-{
|
|
8256 |
- int mcnt;
|
|
8257 |
- /* Point to after the args to the start_memory. */
|
|
8258 |
- unsigned char *p1 = *p + 2;
|
|
8259 |
-
|
|
8260 |
- while (p1 < end)
|
|
8261 |
- {
|
|
8262 |
- /* Skip over opcodes that can match nothing, and return true or
|
|
8263 |
- false, as appropriate, when we get to one that can't, or to the
|
|
8264 |
- matching stop_memory. */
|
|
8265 |
-
|
|
8266 |
- switch ((re_opcode_t) *p1)
|
|
8267 |
- {
|
|
8268 |
- /* Could be either a loop or a series of alternatives. */
|
|
8269 |
- case on_failure_jump:
|
|
8270 |
- p1++;
|
|
8271 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
8272 |
-
|
|
8273 |
- /* If the next operation is not a jump backwards in the
|
|
8274 |
- pattern. */
|
|
8275 |
-
|
|
8276 |
- if (mcnt >= 0)
|
|
8277 |
- {
|
|
8278 |
- /* Go through the on_failure_jumps of the alternatives,
|
|
8279 |
- seeing if any of the alternatives cannot match nothing.
|
|
8280 |
- The last alternative starts with only a jump,
|
|
8281 |
- whereas the rest start with on_failure_jump and end
|
|
8282 |
- with a jump, e.g., here is the pattern for `a|b|c':
|
|
8283 |
-
|
|
8284 |
- /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
|
|
8285 |
- /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
|
|
8286 |
- /exactn/1/c
|
|
8287 |
-
|
|
8288 |
- So, we have to first go through the first (n-1)
|
|
8289 |
- alternatives and then deal with the last one separately. */
|
|
8290 |
-
|
|
8291 |
-
|
|
8292 |
- /* Deal with the first (n-1) alternatives, which start
|
|
8293 |
- with an on_failure_jump (see above) that jumps to right
|
|
8294 |
- past a jump_past_alt. */
|
|
8295 |
-
|
|
8296 |
- while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
|
|
8297 |
- {
|
|
8298 |
- /* `mcnt' holds how many bytes long the alternative
|
|
8299 |
- is, including the ending `jump_past_alt' and
|
|
8300 |
- its number. */
|
|
8301 |
-
|
|
8302 |
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
|
|
8303 |
- reg_info))
|
|
8304 |
- return false;
|
|
8305 |
-
|
|
8306 |
- /* Move to right after this alternative, including the
|
|
8307 |
- jump_past_alt. */
|
|
8308 |
- p1 += mcnt;
|
|
8309 |
-
|
|
8310 |
- /* Break if it's the beginning of an n-th alternative
|
|
8311 |
- that doesn't begin with an on_failure_jump. */
|
|
8312 |
- if ((re_opcode_t) *p1 != on_failure_jump)
|
|
8313 |
- break;
|
|
8314 |
-
|
|
8315 |
- /* Still have to check that it's not an n-th
|
|
8316 |
- alternative that starts with an on_failure_jump. */
|
|
8317 |
- p1++;
|
|
8318 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
8319 |
- if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
|
|
8320 |
- {
|
|
8321 |
- /* Get to the beginning of the n-th alternative. */
|
|
8322 |
- p1 -= 3;
|
|
8323 |
- break;
|
|
8324 |
- }
|
|
8325 |
- }
|
|
8326 |
-
|
|
8327 |
- /* Deal with the last alternative: go back and get number
|
|
8328 |
- of the `jump_past_alt' just before it. `mcnt' contains
|
|
8329 |
- the length of the alternative. */
|
|
8330 |
- EXTRACT_NUMBER (mcnt, p1 - 2);
|
|
8331 |
-
|
|
8332 |
- if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
|
|
8333 |
- return false;
|
|
8334 |
-
|
|
8335 |
- p1 += mcnt; /* Get past the n-th alternative. */
|
|
8336 |
- } /* if mcnt > 0 */
|
|
8337 |
- break;
|
|
8338 |
-
|
|
8339 |
-
|
|
8340 |
- case stop_memory:
|
|
8341 |
- assert (p1[1] == **p);
|
|
8342 |
- *p = p1 + 2;
|
|
8343 |
- return true;
|
|
8344 |
-
|
|
8345 |
-
|
|
8346 |
- default:
|
|
8347 |
- if (!common_op_match_null_string_p (&p1, end, reg_info))
|
|
8348 |
- return false;
|
|
8349 |
- }
|
|
8350 |
- } /* while p1 < end */
|
|
8351 |
-
|
|
8352 |
- return false;
|
|
8353 |
-} /* group_match_null_string_p */
|
|
8354 |
-
|
|
8355 |
-
|
|
8356 |
-/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
|
|
8357 |
- It expects P to be the first byte of a single alternative and END one
|
|
8358 |
- byte past the last. The alternative can contain groups. */
|
|
8359 |
-
|
|
8360 |
-static boolean
|
|
8361 |
-alt_match_null_string_p (p, end, reg_info)
|
|
8362 |
- unsigned char *p, *end;
|
|
8363 |
- register_info_type *reg_info;
|
|
8364 |
-{
|
|
8365 |
- int mcnt;
|
|
8366 |
- unsigned char *p1 = p;
|
|
8367 |
-
|
|
8368 |
- while (p1 < end)
|
|
8369 |
- {
|
|
8370 |
- /* Skip over opcodes that can match nothing, and break when we get
|
|
8371 |
- to one that can't. */
|
|
8372 |
-
|
|
8373 |
- switch ((re_opcode_t) *p1)
|
|
8374 |
- {
|
|
8375 |
- /* It's a loop. */
|
|
8376 |
- case on_failure_jump:
|
|
8377 |
- p1++;
|
|
8378 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
8379 |
- p1 += mcnt;
|
|
8380 |
- break;
|
|
8381 |
-
|
|
8382 |
- default:
|
|
8383 |
- if (!common_op_match_null_string_p (&p1, end, reg_info))
|
|
8384 |
- return false;
|
|
8385 |
- }
|
|
8386 |
- } /* while p1 < end */
|
|
8387 |
-
|
|
8388 |
- return true;
|
|
8389 |
-} /* alt_match_null_string_p */
|
|
8390 |
-
|
|
8391 |
-
|
|
8392 |
-/* Deals with the ops common to group_match_null_string_p and
|
|
8393 |
- alt_match_null_string_p.
|
|
8394 |
-
|
|
8395 |
- Sets P to one after the op and its arguments, if any. */
|
|
8396 |
-
|
|
8397 |
-static boolean
|
|
8398 |
-common_op_match_null_string_p (p, end, reg_info)
|
|
8399 |
- unsigned char **p, *end;
|
|
8400 |
- register_info_type *reg_info;
|
|
8401 |
-{
|
|
8402 |
- int mcnt;
|
|
8403 |
- boolean ret;
|
|
8404 |
- int reg_no;
|
|
8405 |
- unsigned char *p1 = *p;
|
|
8406 |
-
|
|
8407 |
- switch ((re_opcode_t) *p1++)
|
|
8408 |
- {
|
|
8409 |
- case no_op:
|
|
8410 |
- case begline:
|
|
8411 |
- case endline:
|
|
8412 |
- case begbuf:
|
|
8413 |
- case endbuf:
|
|
8414 |
- case wordbeg:
|
|
8415 |
- case wordend:
|
|
8416 |
- case wordbound:
|
|
8417 |
- case notwordbound:
|
|
8418 |
-#ifdef emacs
|
|
8419 |
- case before_dot:
|
|
8420 |
- case at_dot:
|
|
8421 |
- case after_dot:
|
|
8422 |
-#endif
|
|
8423 |
- break;
|
|
8424 |
-
|
|
8425 |
- case start_memory:
|
|
8426 |
- reg_no = *p1;
|
|
8427 |
- assert (reg_no > 0 && reg_no <= MAX_REGNUM);
|
|
8428 |
- ret = group_match_null_string_p (&p1, end, reg_info);
|
|
8429 |
-
|
|
8430 |
- /* Have to set this here in case we're checking a group which
|
|
8431 |
- contains a group and a back reference to it. */
|
|
8432 |
-
|
|
8433 |
- if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
|
|
8434 |
- REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
|
|
8435 |
-
|
|
8436 |
- if (!ret)
|
|
8437 |
- return false;
|
|
8438 |
- break;
|
|
8439 |
-
|
|
8440 |
- /* If this is an optimized succeed_n for zero times, make the jump. */
|
|
8441 |
- case jump:
|
|
8442 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
8443 |
- if (mcnt >= 0)
|
|
8444 |
- p1 += mcnt;
|
|
8445 |
- else
|
|
8446 |
- return false;
|
|
8447 |
- break;
|
|
8448 |
-
|
|
8449 |
- case succeed_n:
|
|
8450 |
- /* Get to the number of times to succeed. */
|
|
8451 |
- p1 += 2;
|
|
8452 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
8453 |
-
|
|
8454 |
- if (mcnt == 0)
|
|
8455 |
- {
|
|
8456 |
- p1 -= 4;
|
|
8457 |
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
|
|
8458 |
- p1 += mcnt;
|
|
8459 |
- }
|
|
8460 |
- else
|
|
8461 |
- return false;
|
|
8462 |
- break;
|
|
8463 |
-
|
|
8464 |
- case duplicate:
|
|
8465 |
- if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
|
|
8466 |
- return false;
|
|
8467 |
- break;
|
|
8468 |
-
|
|
8469 |
- case set_number_at:
|
|
8470 |
- p1 += 4;
|
|
8471 |
-
|
|
8472 |
- default:
|
|
8473 |
- /* All other opcodes mean we cannot match the empty string. */
|
|
8474 |
- return false;
|
|
8475 |
- }
|
|
8476 |
-
|
|
8477 |
- *p = p1;
|
|
8478 |
- return true;
|
|
8479 |
-} /* common_op_match_null_string_p */
|
|
8480 |
-
|
|
8481 |
-
|
|
8482 |
-/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
|
|
8483 |
- bytes; nonzero otherwise. */
|
|
8484 |
-
|
|
8485 |
-static int
|
|
8486 |
-bcmp_translate (s1, s2, len, translate)
|
|
8487 |
- unsigned char *s1, *s2;
|
|
8488 |
- register int len;
|
|
8489 |
- char *translate;
|
|
8490 |
-{
|
|
8491 |
- register unsigned char *p1 = s1, *p2 = s2;
|
|
8492 |
- while (len)
|
|
8493 |
- {
|
|
8494 |
- if (translate[*p1++] != translate[*p2++]) return 1;
|
|
8495 |
- len--;
|
|
8496 |
- }
|
|
8497 |
- return 0;
|
|
8498 |
-}
|
|
8499 |
-
|
|
8500 |
-/* Entry points for GNU code. */
|
|
8501 |
-
|
|
8502 |
-/* re_compile_pattern is the GNU regular expression compiler: it
|
|
8503 |
- compiles PATTERN (of length SIZE) and puts the result in BUFP.
|
|
8504 |
- Returns 0 if the pattern was valid, otherwise an error string.
|
|
8505 |
-
|
|
8506 |
- Assumes the `allocated' (and perhaps `buffer') and `translate' fields
|
|
8507 |
- are set in BUFP on entry.
|
|
8508 |
-
|
|
8509 |
- We call regex_compile to do the actual compilation. */
|
|
8510 |
-
|
|
8511 |
-const char *
|
|
8512 |
-re_compile_pattern (pattern, length, bufp)
|
|
8513 |
- const char *pattern;
|
|
8514 |
- int length;
|
|
8515 |
- struct re_pattern_buffer *bufp;
|
|
8516 |
-{
|
|
8517 |
- reg_errcode_t ret;
|
|
8518 |
-
|
|
8519 |
- /* GNU code is written to assume at least RE_NREGS registers will be set
|
|
8520 |
- (and at least one extra will be -1). */
|
|
8521 |
- bufp->regs_allocated = REGS_UNALLOCATED;
|
|
8522 |
-
|
|
8523 |
- /* And GNU code determines whether or not to get register information
|
|
8524 |
- by passing null for the REGS argument to re_match, etc., not by
|
|
8525 |
- setting no_sub. */
|
|
8526 |
- bufp->no_sub = 0;
|
|
8527 |
-
|
|
8528 |
- /* Match anchors at newline. */
|
|
8529 |
- bufp->newline_anchor = 1;
|
|
8530 |
-
|
|
8531 |
- ret = regex_compile (pattern, length, re_syntax_options, bufp);
|
|
8532 |
-
|
|
8533 |
- return re_error_msg[(int) ret];
|
|
8534 |
-}
|
|
8535 |
-
|
|
8536 |
-/* Entry points compatible with 4.2 BSD regex library. We don't define
|
|
8537 |
- them if this is an Emacs or POSIX compilation. */
|
|
8538 |
-
|
|
8539 |
-#if !defined (emacs) && !defined (_POSIX_SOURCE)
|
|
8540 |
-
|
|
8541 |
-/* BSD has one and only one pattern buffer. */
|
|
8542 |
-static struct re_pattern_buffer re_comp_buf;
|
|
8543 |
-
|
|
8544 |
-char *
|
|
8545 |
-re_comp (s)
|
|
8546 |
- const char *s;
|
|
8547 |
-{
|
|
8548 |
- reg_errcode_t ret;
|
|
8549 |
-
|
|
8550 |
- if (!s)
|
|
8551 |
- {
|
|
8552 |
- if (!re_comp_buf.buffer)
|
|
8553 |
- return "No previous regular expression";
|
|
8554 |
- return 0;
|
|
8555 |
- }
|
|
8556 |
-
|
|
8557 |
- if (!re_comp_buf.buffer)
|
|
8558 |
- {
|
|
8559 |
- re_comp_buf.buffer = (unsigned char *) malloc (200);
|
|
8560 |
- if (re_comp_buf.buffer == NULL)
|
|
8561 |
- return "Memory exhausted";
|
|
8562 |
- re_comp_buf.allocated = 200;
|
|
8563 |
-
|
|
8564 |
- re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
|
|
8565 |
- if (re_comp_buf.fastmap == NULL)
|
|
8566 |
- return "Memory exhausted";
|
|
8567 |
- }
|
|
8568 |
-
|
|
8569 |
- /* Since `re_exec' always passes NULL for the `regs' argument, we
|
|
8570 |
- don't need to initialize the pattern buffer fields which affect it. */
|
|
8571 |
-
|
|
8572 |
- /* Match anchors at newlines. */
|
|
8573 |
- re_comp_buf.newline_anchor = 1;
|
|
8574 |
-
|
|
8575 |
- ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
|
|
8576 |
-
|
|
8577 |
- /* Yes, we're discarding `const' here. */
|
|
8578 |
- return (char *) re_error_msg[(int) ret];
|
|
8579 |
-}
|
|
8580 |
-
|
|
8581 |
-
|
|
8582 |
-int
|
|
8583 |
-re_exec (s)
|
|
8584 |
- const char *s;
|
|
8585 |
-{
|
|
8586 |
- const int len = strlen (s);
|
|
8587 |
- return
|
|
8588 |
- 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
|
|
8589 |
-}
|
|
8590 |
-#endif /* not emacs and not _POSIX_SOURCE */
|
|
8591 |
-
|
|
8592 |
-/* POSIX.2 functions. Don't define these for Emacs. */
|
|
8593 |
-
|
|
8594 |
-#ifndef emacs
|
|
8595 |
-
|
|
8596 |
-/* regcomp takes a regular expression as a string and compiles it.
|
|
8597 |
-
|
|
8598 |
- PREG is a regex_t *. We do not expect any fields to be initialized,
|
|
8599 |
- since POSIX says we shouldn't. Thus, we set
|
|
8600 |
-
|
|
8601 |
- `buffer' to the compiled pattern;
|
|
8602 |
- `used' to the length of the compiled pattern;
|
|
8603 |
- `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
|
|
8604 |
- REG_EXTENDED bit in CFLAGS is set; otherwise, to
|
|
8605 |
- RE_SYNTAX_POSIX_BASIC;
|
|
8606 |
- `newline_anchor' to REG_NEWLINE being set in CFLAGS;
|
|
8607 |
- `fastmap' and `fastmap_accurate' to zero;
|
|
8608 |
- `re_nsub' to the number of subexpressions in PATTERN.
|
|
8609 |
-
|
|
8610 |
- PATTERN is the address of the pattern string.
|
|
8611 |
-
|
|
8612 |
- CFLAGS is a series of bits which affect compilation.
|
|
8613 |
-
|
|
8614 |
- If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
|
|
8615 |
- use POSIX basic syntax.
|
|
8616 |
-
|
|
8617 |
- If REG_NEWLINE is set, then . and [^...] don't match newline.
|
|
8618 |
- Also, regexec will try a match beginning after every newline.
|
|
8619 |
-
|
|
8620 |
- If REG_ICASE is set, then we considers upper- and lowercase
|
|
8621 |
- versions of letters to be equivalent when matching.
|
|
8622 |
-
|
|
8623 |
- If REG_NOSUB is set, then when PREG is passed to regexec, that
|
|
8624 |
- routine will report only success or failure, and nothing about the
|
|
8625 |
- registers.
|
|
8626 |
-
|
|
8627 |
- It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
|
|
8628 |
- the return codes and their meanings.) */
|
|
8629 |
-
|
|
8630 |
-int
|
|
8631 |
-regcomp (preg, pattern, cflags)
|
|
8632 |
- regex_t *preg;
|
|
8633 |
- const char *pattern;
|
|
8634 |
- int cflags;
|
|
8635 |
-{
|
|
8636 |
- reg_errcode_t ret;
|
|
8637 |
- unsigned syntax
|
|
8638 |
- = (cflags & REG_EXTENDED) ?
|
|
8639 |
- RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
|
|
8640 |
-
|
|
8641 |
- /* regex_compile will allocate the space for the compiled pattern. */
|
|
8642 |
- preg->buffer = 0;
|
|
8643 |
- preg->allocated = 0;
|
|
8644 |
-
|
|
8645 |
- /* Don't bother to use a fastmap when searching. This simplifies the
|
|
8646 |
- REG_NEWLINE case: if we used a fastmap, we'd have to put all the
|
|
8647 |
- characters after newlines into the fastmap. This way, we just try
|
|
8648 |
- every character. */
|
|
8649 |
- preg->fastmap = 0;
|
|
8650 |
-
|
|
8651 |
- if (cflags & REG_ICASE)
|
|
8652 |
- {
|
|
8653 |
- unsigned i;
|
|
8654 |
-
|
|
8655 |
- preg->translate = (char *) malloc (CHAR_SET_SIZE);
|
|
8656 |
- if (preg->translate == NULL)
|
|
8657 |
- return (int) REG_ESPACE;
|
|
8658 |
-
|
|
8659 |
- /* Map uppercase characters to corresponding lowercase ones. */
|
|
8660 |
- for (i = 0; i < CHAR_SET_SIZE; i++)
|
|
8661 |
- preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
|
|
8662 |
- }
|
|
8663 |
- else
|
|
8664 |
- preg->translate = NULL;
|
|
8665 |
-
|
|
8666 |
- /* If REG_NEWLINE is set, newlines are treated differently. */
|
|
8667 |
- if (cflags & REG_NEWLINE)
|
|
8668 |
- { /* REG_NEWLINE implies neither . nor [^...] match newline. */
|
|
8669 |
- syntax &= ~RE_DOT_NEWLINE;
|
|
8670 |
- syntax |= RE_HAT_LISTS_NOT_NEWLINE;
|
|
8671 |
- /* It also changes the matching behavior. */
|
|
8672 |
- preg->newline_anchor = 1;
|
|
8673 |
- }
|
|
8674 |
- else
|
|
8675 |
- preg->newline_anchor = 0;
|
|
8676 |
-
|
|
8677 |
- preg->no_sub = !!(cflags & REG_NOSUB);
|
|
8678 |
-
|
|
8679 |
- /* POSIX says a null character in the pattern terminates it, so we
|
|
8680 |
- can use strlen here in compiling the pattern. */
|
|
8681 |
- ret = regex_compile (pattern, strlen (pattern), syntax, preg);
|
|
8682 |
-
|
|
8683 |
- /* POSIX doesn't distinguish between an unmatched open-group and an
|
|
8684 |
- unmatched close-group: both are REG_EPAREN. */
|
|
8685 |
- if (ret == REG_ERPAREN) ret = REG_EPAREN;
|
|
8686 |
-
|
|
8687 |
- return (int) ret;
|
|
8688 |
-}
|
|
8689 |
-
|
|
8690 |
-
|
|
8691 |
-/* regexec searches for a given pattern, specified by PREG, in the
|
|
8692 |
- string STRING.
|
|
8693 |
-
|
|
8694 |
- If NMATCH is zero or REG_NOSUB was set in the cflags argument to
|
|
8695 |
- `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
|
|
8696 |
- least NMATCH elements, and we set them to the offsets of the
|
|
8697 |
- corresponding matched substrings.
|
|
8698 |
-
|
|
8699 |
- EFLAGS specifies `execution flags' which affect matching: if
|
|
8700 |
- REG_NOTBOL is set, then ^ does not match at the beginning of the
|
|
8701 |
- string; if REG_NOTEOL is set, then $ does not match at the end.
|
|
8702 |
-
|
|
8703 |
- We return 0 if we find a match and REG_NOMATCH if not. */
|
|
8704 |
-
|
|
8705 |
-int
|
|
8706 |
-regexec (preg, string, nmatch, pmatch, eflags)
|
|
8707 |
- const regex_t *preg;
|
|
8708 |
- const char *string;
|
|
8709 |
- size_t nmatch;
|
|
8710 |
- regmatch_t pmatch[];
|
|
8711 |
- int eflags;
|
|
8712 |
-{
|
|
8713 |
- int ret;
|
|
8714 |
- struct re_registers regs;
|
|
8715 |
- regex_t private_preg;
|
|
8716 |
- int len = strlen (string);
|
|
8717 |
- boolean want_reg_info = !preg->no_sub && nmatch > 0;
|
|
8718 |
-
|
|
8719 |
- private_preg = *preg;
|
|
8720 |
-
|
|
8721 |
- private_preg.not_bol = !!(eflags & REG_NOTBOL);
|
|
8722 |
- private_preg.not_eol = !!(eflags & REG_NOTEOL);
|
|
8723 |
-
|
|
8724 |
- /* The user has told us exactly how many registers to return
|
|
8725 |
- information about, via `nmatch'. We have to pass that on to the
|
|
8726 |
- matching routines. */
|
|
8727 |
- private_preg.regs_allocated = REGS_FIXED;
|
|
8728 |
-
|
|
8729 |
- if (want_reg_info)
|
|
8730 |
- {
|
|
8731 |
- regs.num_regs = nmatch;
|
|
8732 |
- regs.start = TALLOC (nmatch, regoff_t);
|
|
8733 |
- regs.end = TALLOC (nmatch, regoff_t);
|
|
8734 |
- if (regs.start == NULL || regs.end == NULL)
|
|
8735 |
- return (int) REG_NOMATCH;
|
|
8736 |
- }
|
|
8737 |
-
|
|
8738 |
- /* Perform the searching operation. */
|
|
8739 |
- ret = re_search (&private_preg, string, len,
|
|
8740 |
- /* start: */ 0, /* range: */ len,
|
|
8741 |
- want_reg_info ? ®s : (struct re_registers *) 0);
|
|
8742 |
-
|
|
8743 |
- /* Copy the register information to the POSIX structure. */
|
|
8744 |
- if (want_reg_info)
|
|
8745 |
- {
|
|
8746 |
- if (ret >= 0)
|
|
8747 |
- {
|
|
8748 |
- unsigned r;
|
|
8749 |
-
|
|
8750 |
- for (r = 0; r < nmatch; r++)
|
|
8751 |
- {
|
|
8752 |
- pmatch[r].rm_so = regs.start[r];
|
|
8753 |
- pmatch[r].rm_eo = regs.end[r];
|
|
8754 |
- }
|
|
8755 |
- }
|
|
8756 |
-
|
|
8757 |
- /* If we needed the temporary register info, free the space now. */
|
|
8758 |
- free (regs.start);
|
|
8759 |
- free (regs.end);
|
|
8760 |
- }
|
|
8761 |
-
|
|
8762 |
- /* We want zero return to mean success, unlike `re_search'. */
|
|
8763 |
- return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
|
|
8764 |
-}
|
|
8765 |
-
|
|
8766 |
-
|
|
8767 |
-/* Returns a message corresponding to an error code, ERRCODE, returned
|
|
8768 |
- from either regcomp or regexec. We don't use PREG here. */
|
|
8769 |
-
|
|
8770 |
-size_t
|
|
8771 |
-regerror (errcode_vc, preg, errbuf, errbuf_size)
|
|
8772 |
- int errcode_vc;
|
|
8773 |
- const regex_t *preg;
|
|
8774 |
- char *errbuf;
|
|
8775 |
- size_t errbuf_size;
|
|
8776 |
-{
|
|
8777 |
- const char *msg;
|
|
8778 |
- size_t msg_size;
|
|
8779 |
-
|
|
8780 |
- if (errcode_vc < 0
|
|
8781 |
- || errcode_vc >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
|
|
8782 |
- /* Only error codes returned by the rest of the code should be passed
|
|
8783 |
- to this routine. If we are given anything else, or if other regex
|
|
8784 |
- code generates an invalid error code, then the program has a bug.
|
|
8785 |
- Dump core so we can fix it. */
|
|
8786 |
- abort ();
|
|
8787 |
-
|
|
8788 |
- msg = re_error_msg[errcode_vc];
|
|
8789 |
-
|
|
8790 |
- /* POSIX doesn't require that we do anything in this case, but why
|
|
8791 |
- not be nice. */
|
|
8792 |
- if (! msg)
|
|
8793 |
- msg = "Success";
|
|
8794 |
-
|
|
8795 |
- msg_size = strlen (msg) + 1; /* Includes the null. */
|
|
8796 |
-
|
|
8797 |
- if (errbuf_size != 0)
|
|
8798 |
- {
|
|
8799 |
- if (msg_size > errbuf_size)
|
|
8800 |
- {
|
|
8801 |
- strncpy (errbuf, msg, errbuf_size - 1);
|
|
8802 |
- errbuf[errbuf_size - 1] = 0;
|
|
8803 |
- }
|
|
8804 |
- else
|
|
8805 |
- strcpy (errbuf, msg);
|
|
8806 |
- }
|
|
8807 |
-
|
|
8808 |
- return msg_size;
|
|
8809 |
-}
|
|
8810 |
-
|
|
8811 |
-
|
|
8812 |
-/* Free dynamically allocated space used by PREG. */
|
|
8813 |
-
|
|
8814 |
-void
|
|
8815 |
-regfree (preg)
|
|
8816 |
- regex_t *preg;
|
|
8817 |
-{
|
|
8818 |
- if (preg->buffer != NULL)
|
|
8819 |
- free (preg->buffer);
|
|
8820 |
- preg->buffer = NULL;
|
|
8821 |
-
|
|
8822 |
- preg->allocated = 0;
|
|
8823 |
- preg->used = 0;
|
|
8824 |
-
|
|
8825 |
- if (preg->fastmap != NULL)
|
|
8826 |
- free (preg->fastmap);
|
|
8827 |
- preg->fastmap = NULL;
|
|
8828 |
- preg->fastmap_accurate = 0;
|
|
8829 |
-
|
|
8830 |
- if (preg->translate != NULL)
|
|
8831 |
- free (preg->translate);
|
|
8832 |
- preg->translate = NULL;
|
|
8833 |
-}
|
|
8834 |
-
|
|
8835 |
-#endif /* not emacs */
|
|
8836 |
-
|
|
8837 |
-/*
|
|
8838 |
-Local variables:
|
|
8839 |
-make-backup-files: t
|
|
8840 |
-version-control: t
|
|
8841 |
-trim-versions-without-asking: nil
|
|
8842 |
-End:
|
|
8843 |
-*/
|
|
8844 |
--- a/windows/regex.h
|
|
8845 |
+++ /dev/null
|
|
8846 |
@@ -1,506 +0,0 @@
|
|
8847 |
-/* Definitions for data structures and routines for the regular
|
|
8848 |
- expression library, version 0.12.
|
|
8849 |
-
|
|
8850 |
- Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
|
8851 |
-
|
|
8852 |
- This program is free software; you can redistribute it and/or modify
|
|
8853 |
- it under the terms of the GNU General Public License as published by
|
|
8854 |
- the Free Software Foundation; either version 2, or (at your option)
|
|
8855 |
- any later version.
|
|
8856 |
-
|
|
8857 |
- This program is distributed in the hope that it will be useful,
|
|
8858 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
8859 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
8860 |
- GNU General Public License for more details.
|
|
8861 |
-
|
|
8862 |
- You should have received a copy of the GNU General Public License
|
|
8863 |
- along with this program; if not, write to the Free Software
|
|
8864 |
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|
8865 |
-
|
|
8866 |
-#ifndef __REGEXP_LIBRARY_H__
|
|
8867 |
-#define __REGEXP_LIBRARY_H__
|
|
8868 |
-
|
|
8869 |
-#ifdef __cplusplus
|
|
8870 |
-extern "C"
|
|
8871 |
-{
|
|
8872 |
-#endif
|
|
8873 |
-
|
|
8874 |
- /* POSIX says that <sys/types.h> must be included (by the caller) before
|
|
8875 |
- <regex.h>. */
|
|
8876 |
-
|
|
8877 |
-#ifdef VMS
|
|
8878 |
- /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
|
|
8879 |
- should be there. */
|
|
8880 |
-#include <stddef.h>
|
|
8881 |
-#endif
|
|
8882 |
-
|
|
8883 |
-
|
|
8884 |
- /* The following bits are used to determine the regexp syntax we
|
|
8885 |
- recognize. The set/not-set meanings are chosen so that Emacs syntax
|
|
8886 |
- remains the value 0. The bits are given in alphabetical order, and
|
|
8887 |
- the definitions shifted by one from the previous bit; thus, when we
|
|
8888 |
- add or remove a bit, only one other definition need change. */
|
|
8889 |
- typedef unsigned reg_syntax_t;
|
|
8890 |
-
|
|
8891 |
- /* If this bit is not set, then \ inside a bracket expression is literal.
|
|
8892 |
- If set, then such a \ quotes the following character. */
|
|
8893 |
-#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
|
|
8894 |
-
|
|
8895 |
- /* If this bit is not set, then + and ? are operators, and \+ and \? are
|
|
8896 |
- literals.
|
|
8897 |
- If set, then \+ and \? are operators and + and ? are literals. */
|
|
8898 |
-#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
|
|
8899 |
-
|
|
8900 |
- /* If this bit is set, then character classes are supported. They are:
|
|
8901 |
- [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
|
|
8902 |
- [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
|
|
8903 |
- If not set, then character classes are not supported. */
|
|
8904 |
-#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
|
|
8905 |
-
|
|
8906 |
- /* If this bit is set, then ^ and $ are always anchors (outside bracket
|
|
8907 |
- expressions, of course).
|
|
8908 |
- If this bit is not set, then it depends:
|
|
8909 |
- ^ is an anchor if it is at the beginning of a regular
|
|
8910 |
- expression or after an open-group or an alternation operator;
|
|
8911 |
- $ is an anchor if it is at the end of a regular expression, or
|
|
8912 |
- before a close-group or an alternation operator.
|
|
8913 |
-
|
|
8914 |
- This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
|
|
8915 |
- POSIX draft 11.2 says that * etc. in leading positions is undefined.
|
|
8916 |
- We already implemented a previous draft which made those constructs
|
|
8917 |
- invalid, though, so we haven't changed the code back. */
|
|
8918 |
-#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
|
|
8919 |
-
|
|
8920 |
- /* If this bit is set, then special characters are always special
|
|
8921 |
- regardless of where they are in the pattern.
|
|
8922 |
- If this bit is not set, then special characters are special only in
|
|
8923 |
- some contexts; otherwise they are ordinary. Specifically,
|
|
8924 |
- * + ? and intervals are only special when not after the beginning,
|
|
8925 |
- open-group, or alternation operator. */
|
|
8926 |
-#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
|
|
8927 |
-
|
|
8928 |
- /* If this bit is set, then *, +, ?, and { cannot be first in an re or
|
|
8929 |
- immediately after an alternation or begin-group operator. */
|
|
8930 |
-#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
|
|
8931 |
-
|
|
8932 |
- /* If this bit is set, then . matches newline.
|
|
8933 |
- If not set, then it doesn't. */
|
|
8934 |
-#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
|
|
8935 |
-
|
|
8936 |
- /* If this bit is set, then . doesn't match NUL.
|
|
8937 |
- If not set, then it does. */
|
|
8938 |
-#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
|
|
8939 |
-
|
|
8940 |
- /* If this bit is set, nonmatching lists [^...] do not match newline.
|
|
8941 |
- If not set, they do. */
|
|
8942 |
-#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
|
|
8943 |
-
|
|
8944 |
- /* If this bit is set, either \{...\} or {...} defines an
|
|
8945 |
- interval, depending on RE_NO_BK_BRACES.
|
|
8946 |
- If not set, \{, \}, {, and } are literals. */
|
|
8947 |
-#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
|
|
8948 |
-
|
|
8949 |
- /* If this bit is set, +, ? and | aren't recognized as operators.
|
|
8950 |
- If not set, they are. */
|
|
8951 |
-#define RE_LIMITED_OPS (RE_INTERVALS << 1)
|
|
8952 |
-
|
|
8953 |
- /* If this bit is set, newline is an alternation operator.
|
|
8954 |
- If not set, newline is literal. */
|
|
8955 |
-#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
|
|
8956 |
-
|
|
8957 |
- /* If this bit is set, then `{...}' defines an interval, and \{ and \}
|
|
8958 |
- are literals.
|
|
8959 |
- If not set, then `\{...\}' defines an interval. */
|
|
8960 |
-#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
|
|
8961 |
-
|
|
8962 |
- /* If this bit is set, (...) defines a group, and \( and \) are literals.
|
|
8963 |
- If not set, \(...\) defines a group, and ( and ) are literals. */
|
|
8964 |
-#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
|
|
8965 |
-
|
|
8966 |
- /* If this bit is set, then \<digit> matches <digit>.
|
|
8967 |
- If not set, then \<digit> is a back-reference. */
|
|
8968 |
-#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
|
|
8969 |
-
|
|
8970 |
- /* If this bit is set, then | is an alternation operator, and \| is literal.
|
|
8971 |
- If not set, then \| is an alternation operator, and | is literal. */
|
|
8972 |
-#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
|
|
8973 |
-
|
|
8974 |
- /* If this bit is set, then an ending range point collating higher
|
|
8975 |
- than the starting range point, as in [z-a], is invalid.
|
|
8976 |
- If not set, then when ending range point collates higher than the
|
|
8977 |
- starting range point, the range is ignored. */
|
|
8978 |
-#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
|
|
8979 |
-
|
|
8980 |
- /* If this bit is set, then an unmatched ) is ordinary.
|
|
8981 |
- If not set, then an unmatched ) is invalid. */
|
|
8982 |
-#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
|
|
8983 |
-
|
|
8984 |
- /* This global variable defines the particular regexp syntax to use (for
|
|
8985 |
- some interfaces). When a regexp is compiled, the syntax used is
|
|
8986 |
- stored in the pattern buffer, so changing this does not affect
|
|
8987 |
- already-compiled regexps. */
|
|
8988 |
- extern reg_syntax_t re_syntax_options;
|
|
8989 |
-
|
|
8990 |
- /* Define combinations of the above bits for the standard possibilities.
|
|
8991 |
- (The [[[ comments delimit what gets put into the Texinfo file, so
|
|
8992 |
- don't delete them!) */
|
|
8993 |
- /* [[[begin syntaxes]]] */
|
|
8994 |
-#define RE_SYNTAX_EMACS 0
|
|
8995 |
-
|
|
8996 |
-#define RE_SYNTAX_AWK \
|
|
8997 |
- (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
|
|
8998 |
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
|
8999 |
- | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
|
|
9000 |
- | RE_UNMATCHED_RIGHT_PAREN_ORD)
|
|
9001 |
-
|
|
9002 |
-#define RE_SYNTAX_POSIX_AWK \
|
|
9003 |
- (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
|
|
9004 |
-
|
|
9005 |
-#define RE_SYNTAX_GREP \
|
|
9006 |
- (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
|
|
9007 |
- | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
|
|
9008 |
- | RE_NEWLINE_ALT)
|
|
9009 |
-
|
|
9010 |
-#define RE_SYNTAX_EGREP \
|
|
9011 |
- (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
|
|
9012 |
- | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
|
|
9013 |
- | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
|
|
9014 |
- | RE_NO_BK_VBAR)
|
|
9015 |
-
|
|
9016 |
-#define RE_SYNTAX_POSIX_EGREP \
|
|
9017 |
- (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
|
|
9018 |
-
|
|
9019 |
- /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
|
|
9020 |
-#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
|
|
9021 |
-
|
|
9022 |
-#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
|
|
9023 |
-
|
|
9024 |
- /* Syntax bits common to both basic and extended POSIX regex syntax. */
|
|
9025 |
-#define _RE_SYNTAX_POSIX_COMMON \
|
|
9026 |
- (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
|
|
9027 |
- | RE_INTERVALS | RE_NO_EMPTY_RANGES)
|
|
9028 |
-
|
|
9029 |
-#define RE_SYNTAX_POSIX_BASIC \
|
|
9030 |
- (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
|
|
9031 |
-
|
|
9032 |
- /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
|
|
9033 |
- RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
|
|
9034 |
- isn't minimal, since other operators, such as \`, aren't disabled. */
|
|
9035 |
-#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
|
|
9036 |
- (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
|
|
9037 |
-
|
|
9038 |
-#define RE_SYNTAX_POSIX_EXTENDED \
|
|
9039 |
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
|
|
9040 |
- | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
|
|
9041 |
- | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
|
|
9042 |
- | RE_UNMATCHED_RIGHT_PAREN_ORD)
|
|
9043 |
-
|
|
9044 |
- /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
|
|
9045 |
- replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
|
|
9046 |
-#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
|
|
9047 |
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
|
|
9048 |
- | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
|
|
9049 |
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
|
|
9050 |
- | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
|
|
9051 |
- /* [[[end syntaxes]]] */
|
|
9052 |
-
|
|
9053 |
- /* Maximum number of duplicates an interval can allow. Some systems
|
|
9054 |
- (erroneously) define this in other header files, but we want our
|
|
9055 |
- value, so remove any previous define. */
|
|
9056 |
-#ifdef RE_DUP_MAX
|
|
9057 |
-#undef RE_DUP_MAX
|
|
9058 |
-#endif
|
|
9059 |
-#define RE_DUP_MAX ((1 << 15) - 1)
|
|
9060 |
-
|
|
9061 |
-
|
|
9062 |
- /* POSIX `cflags' bits (i.e., information for `regcomp'). */
|
|
9063 |
-
|
|
9064 |
- /* If this bit is set, then use extended regular expression syntax.
|
|
9065 |
- If not set, then use basic regular expression syntax. */
|
|
9066 |
-#define REG_EXTENDED 1
|
|
9067 |
-
|
|
9068 |
- /* If this bit is set, then ignore case when matching.
|
|
9069 |
- If not set, then case is significant. */
|
|
9070 |
-#define REG_ICASE (REG_EXTENDED << 1)
|
|
9071 |
-
|
|
9072 |
- /* If this bit is set, then anchors do not match at newline
|
|
9073 |
- characters in the string.
|
|
9074 |
- If not set, then anchors do match at newlines. */
|
|
9075 |
-#define REG_NEWLINE (REG_ICASE << 1)
|
|
9076 |
-
|
|
9077 |
- /* If this bit is set, then report only success or fail in regexec.
|
|
9078 |
- If not set, then returns differ between not matching and errors. */
|
|
9079 |
-#define REG_NOSUB (REG_NEWLINE << 1)
|
|
9080 |
-
|
|
9081 |
-
|
|
9082 |
- /* POSIX `eflags' bits (i.e., information for regexec). */
|
|
9083 |
-
|
|
9084 |
- /* If this bit is set, then the beginning-of-line operator doesn't match
|
|
9085 |
- the beginning of the string (presumably because it's not the
|
|
9086 |
- beginning of a line).
|
|
9087 |
- If not set, then the beginning-of-line operator does match the
|
|
9088 |
- beginning of the string. */
|
|
9089 |
-#define REG_NOTBOL 1
|
|
9090 |
-
|
|
9091 |
- /* Like REG_NOTBOL, except for the end-of-line. */
|
|
9092 |
-#define REG_NOTEOL (1 << 1)
|
|
9093 |
-
|
|
9094 |
-
|
|
9095 |
- /* If any error codes are removed, changed, or added, update the
|
|
9096 |
- `re_error_msg' table in regex.c. */
|
|
9097 |
- typedef enum {
|
|
9098 |
- REG_NOERROR = 0, /* Success. */
|
|
9099 |
- REG_NOMATCH, /* Didn't find a match (for regexec). */
|
|
9100 |
-
|
|
9101 |
- /* POSIX regcomp return error codes. (In the order listed in the
|
|
9102 |
- standard.) */
|
|
9103 |
- REG_BADPAT, /* Invalid pattern. */
|
|
9104 |
- REG_ECOLLATE, /* Not implemented. */
|
|
9105 |
- REG_ECTYPE, /* Invalid character class name. */
|
|
9106 |
- REG_EESCAPE, /* Trailing backslash. */
|
|
9107 |
- REG_ESUBREG, /* Invalid back reference. */
|
|
9108 |
- REG_EBRACK, /* Unmatched left bracket. */
|
|
9109 |
- REG_EPAREN, /* Parenthesis imbalance. */
|
|
9110 |
- REG_EBRACE, /* Unmatched \{. */
|
|
9111 |
- REG_BADBR, /* Invalid contents of \{\}. */
|
|
9112 |
- REG_ERANGE, /* Invalid range end. */
|
|
9113 |
- REG_ESPACE, /* Ran out of memory. */
|
|
9114 |
- REG_BADRPT, /* No preceding re for repetition op. */
|
|
9115 |
-
|
|
9116 |
- /* Error codes we've added. */
|
|
9117 |
- REG_EEND, /* Premature end. */
|
|
9118 |
- REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
|
|
9119 |
- REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
|
|
9120 |
- }
|
|
9121 |
- reg_errcode_t;
|
|
9122 |
-
|
|
9123 |
- /* This data structure represents a compiled pattern. Before calling
|
|
9124 |
- the pattern compiler, the fields `buffer', `allocated', `fastmap',
|
|
9125 |
- `translate', and `no_sub' can be set. After the pattern has been
|
|
9126 |
- compiled, the `re_nsub' field is available. All other fields are
|
|
9127 |
- private to the regex routines. */
|
|
9128 |
-
|
|
9129 |
- struct re_pattern_buffer {
|
|
9130 |
- /* [[[begin pattern_buffer]]] */
|
|
9131 |
- /* Space that holds the compiled pattern. It is declared as
|
|
9132 |
- `unsigned char *' because its elements are
|
|
9133 |
- sometimes used as array indexes. */
|
|
9134 |
- unsigned char *buffer;
|
|
9135 |
-
|
|
9136 |
- /* Number of bytes to which `buffer' points. */
|
|
9137 |
- unsigned long allocated;
|
|
9138 |
-
|
|
9139 |
- /* Number of bytes actually used in `buffer'. */
|
|
9140 |
- unsigned long used;
|
|
9141 |
-
|
|
9142 |
- /* Syntax setting with which the pattern was compiled. */
|
|
9143 |
- reg_syntax_t syntax;
|
|
9144 |
-
|
|
9145 |
- /* Pointer to a fastmap, if any, otherwise zero. re_search uses
|
|
9146 |
- the fastmap, if there is one, to skip over impossible
|
|
9147 |
- starting points for matches. */
|
|
9148 |
- char *fastmap;
|
|
9149 |
-
|
|
9150 |
- /* Either a translate table to apply to all characters before
|
|
9151 |
- comparing them, or zero for no translation. The translation
|
|
9152 |
- is applied to a pattern when it is compiled and to a string
|
|
9153 |
- when it is matched. */
|
|
9154 |
- char *translate;
|
|
9155 |
-
|
|
9156 |
- /* Number of subexpressions found by the compiler. */
|
|
9157 |
- size_t re_nsub;
|
|
9158 |
-
|
|
9159 |
- /* Zero if this pattern cannot match the empty string, one else.
|
|
9160 |
- Well, in truth it's used only in `re_search_2', to see
|
|
9161 |
- whether or not we should use the fastmap, so we don't set
|
|
9162 |
- this absolutely perfectly; see `re_compile_fastmap' (the
|
|
9163 |
- `duplicate' case). */
|
|
9164 |
-unsigned can_be_null :
|
|
9165 |
- 1;
|
|
9166 |
-
|
|
9167 |
- /* If REGS_UNALLOCATED, allocate space in the `regs' structure
|
|
9168 |
- for `max (RE_NREGS, re_nsub + 1)' groups.
|
|
9169 |
- If REGS_REALLOCATE, reallocate space if necessary.
|
|
9170 |
- If REGS_FIXED, use what's there. */
|
|
9171 |
-#define REGS_UNALLOCATED 0
|
|
9172 |
-#define REGS_REALLOCATE 1
|
|
9173 |
-#define REGS_FIXED 2
|
|
9174 |
-
|
|
9175 |
-unsigned regs_allocated :
|
|
9176 |
- 2;
|
|
9177 |
-
|
|
9178 |
- /* Set to zero when `regex_compile' compiles a pattern; set to one
|
|
9179 |
- by `re_compile_fastmap' if it updates the fastmap. */
|
|
9180 |
-unsigned fastmap_accurate :
|
|
9181 |
- 1;
|
|
9182 |
-
|
|
9183 |
- /* If set, `re_match_2' does not return information about
|
|
9184 |
- subexpressions. */
|
|
9185 |
-unsigned no_sub :
|
|
9186 |
- 1;
|
|
9187 |
-
|
|
9188 |
- /* If set, a beginning-of-line anchor doesn't match at the
|
|
9189 |
- beginning of the string. */
|
|
9190 |
-unsigned not_bol :
|
|
9191 |
- 1;
|
|
9192 |
-
|
|
9193 |
- /* Similarly for an end-of-line anchor. */
|
|
9194 |
-unsigned not_eol :
|
|
9195 |
- 1;
|
|
9196 |
-
|
|
9197 |
- /* If true, an anchor at a newline matches. */
|
|
9198 |
-unsigned newline_anchor :
|
|
9199 |
- 1;
|
|
9200 |
-
|
|
9201 |
- /* [[[end pattern_buffer]]] */
|
|
9202 |
- };
|
|
9203 |
-
|
|
9204 |
- typedef struct re_pattern_buffer regex_t;
|
|
9205 |
-
|
|
9206 |
-
|
|
9207 |
- /* search.c (search_buffer) in Emacs needs this one opcode value. It is
|
|
9208 |
- defined both in `regex.c' and here. */
|
|
9209 |
-#define RE_EXACTN_VALUE 1
|
|
9210 |
-
|
|
9211 |
- /* Type for byte offsets within the string. POSIX mandates this. */
|
|
9212 |
- typedef int regoff_t;
|
|
9213 |
-
|
|
9214 |
-
|
|
9215 |
- /* This is the structure we store register match data in. See
|
|
9216 |
- regex.texinfo for a full description of what registers match. */
|
|
9217 |
- struct re_registers {
|
|
9218 |
- unsigned num_regs;
|
|
9219 |
- regoff_t *start;
|
|
9220 |
- regoff_t *end;
|
|
9221 |
- };
|
|
9222 |
-
|
|
9223 |
-
|
|
9224 |
- /* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
|
|
9225 |
- `re_match_2' returns information about at least this many registers
|
|
9226 |
- the first time a `regs' structure is passed. */
|
|
9227 |
-#ifndef RE_NREGS
|
|
9228 |
-#define RE_NREGS 30
|
|
9229 |
-#endif
|
|
9230 |
-
|
|
9231 |
-
|
|
9232 |
- /* POSIX specification for registers. Aside from the different names than
|
|
9233 |
- `re_registers', POSIX uses an array of structures, instead of a
|
|
9234 |
- structure of arrays. */
|
|
9235 |
- typedef struct {
|
|
9236 |
- regoff_t rm_so; /* Byte offset from string's start to substring's start. */
|
|
9237 |
- regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
|
|
9238 |
- }
|
|
9239 |
- regmatch_t;
|
|
9240 |
-
|
|
9241 |
- /* Declarations for routines. */
|
|
9242 |
-
|
|
9243 |
- /* To avoid duplicating every routine declaration -- once with a
|
|
9244 |
- prototype (if we are ANSI), and once without (if we aren't) -- we
|
|
9245 |
- use the following macro to declare argument types. This
|
|
9246 |
- unfortunately clutters up the declarations a bit, but I think it's
|
|
9247 |
- worth it. */
|
|
9248 |
-
|
|
9249 |
-#if __STDC__
|
|
9250 |
-
|
|
9251 |
-#define _RE_ARGS(args) args
|
|
9252 |
-
|
|
9253 |
-#else /* not __STDC__ */
|
|
9254 |
-
|
|
9255 |
-#define _RE_ARGS(args) ()
|
|
9256 |
-
|
|
9257 |
-#endif /* not __STDC__ */
|
|
9258 |
-
|
|
9259 |
- /* Sets the current default syntax to SYNTAX, and return the old syntax.
|
|
9260 |
- You can also simply assign to the `re_syntax_options' variable. */
|
|
9261 |
- extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
|
9262 |
-
|
|
9263 |
- /* Compile the regular expression PATTERN, with length LENGTH
|
|
9264 |
- and syntax given by the global `re_syntax_options', into the buffer
|
|
9265 |
- BUFFER. Return NULL if successful, and an error string if not. */
|
|
9266 |
- extern const char *re_compile_pattern
|
|
9267 |
- _RE_ARGS ((const char *pattern, int length,
|
|
9268 |
- struct re_pattern_buffer *buffer));
|
|
9269 |
-
|
|
9270 |
-
|
|
9271 |
- /* Compile a fastmap for the compiled pattern in BUFFER; used to
|
|
9272 |
- accelerate searches. Return 0 if successful and -2 if was an
|
|
9273 |
- internal error. */
|
|
9274 |
- extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
|
|
9275 |
-
|
|
9276 |
-
|
|
9277 |
- /* Search in the string STRING (with length LENGTH) for the pattern
|
|
9278 |
- compiled into BUFFER. Start searching at position START, for RANGE
|
|
9279 |
- characters. Return the starting position of the match, -1 for no
|
|
9280 |
- match, or -2 for an internal error. Also return register
|
|
9281 |
- information in REGS (if REGS and BUFFER->no_sub are nonzero). */
|
|
9282 |
- extern int re_search
|
|
9283 |
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
|
9284 |
- int length, int start, int range, struct re_registers *regs));
|
|
9285 |
-
|
|
9286 |
-
|
|
9287 |
- /* Like `re_search', but search in the concatenation of STRING1 and
|
|
9288 |
- STRING2. Also, stop searching at index START + STOP. */
|
|
9289 |
- extern int re_search_2
|
|
9290 |
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
|
9291 |
- int length1, const char *string2, int length2,
|
|
9292 |
- int start, int range, struct re_registers *regs, int stop));
|
|
9293 |
-
|
|
9294 |
-
|
|
9295 |
- /* Like `re_search', but return how many characters in STRING the regexp
|
|
9296 |
- in BUFFER matched, starting at position START. */
|
|
9297 |
- extern int re_match
|
|
9298 |
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
|
9299 |
- int length, int start, struct re_registers *regs));
|
|
9300 |
-
|
|
9301 |
-
|
|
9302 |
- /* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
|
9303 |
- extern int re_match_2
|
|
9304 |
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
|
9305 |
- int length1, const char *string2, int length2,
|
|
9306 |
- int start, struct re_registers *regs, int stop));
|
|
9307 |
-
|
|
9308 |
-
|
|
9309 |
- /* Set REGS to hold NUM_REGS registers, storing them in STARTS and
|
|
9310 |
- ENDS. Subsequent matches using BUFFER and REGS will use this memory
|
|
9311 |
- for recording register information. STARTS and ENDS must be
|
|
9312 |
- allocated with malloc, and must each be at least `NUM_REGS * sizeof
|
|
9313 |
- (regoff_t)' bytes long.
|
|
9314 |
-
|
|
9315 |
- If NUM_REGS == 0, then subsequent matches should allocate their own
|
|
9316 |
- register data.
|
|
9317 |
-
|
|
9318 |
- Unless this function is called, the first search or match using
|
|
9319 |
- PATTERN_BUFFER will allocate its own register data, without
|
|
9320 |
- freeing the old data. */
|
|
9321 |
- extern void re_set_registers
|
|
9322 |
- _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
|
|
9323 |
- unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
|
9324 |
-
|
|
9325 |
- /* 4.2 bsd compatibility. */
|
|
9326 |
- extern char *re_comp _RE_ARGS ((const char *));
|
|
9327 |
- extern int re_exec _RE_ARGS ((const char *));
|
|
9328 |
-
|
|
9329 |
- /* POSIX compatibility. */
|
|
9330 |
- extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
|
|
9331 |
- extern int regexec
|
|
9332 |
- _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
|
|
9333 |
- regmatch_t pmatch[], int eflags));
|
|
9334 |
- extern size_t regerror
|
|
9335 |
- _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
|
|
9336 |
- size_t errbuf_size));
|
|
9337 |
- extern void regfree _RE_ARGS ((regex_t *preg));
|
|
9338 |
-
|
|
9339 |
-#endif /* not __REGEXP_LIBRARY_H__ */
|
|
9340 |
-
|
|
9341 |
-#ifdef __cplusplus
|
|
9342 |
-}
|
|
9343 |
-#endif
|
|
9344 |
-
|
|
9345 |
-
|
|
9346 |
-/*
|
|
9347 |
-Local variables:
|
|
9348 |
-make-backup-files: t
|
|
9349 |
-version-control: t
|
|
9350 |
-trim-versions-without-asking: nil
|
|
9351 |
-End:
|
|
9352 |
-*/
|
|
9353 |
--- a/windows/resource.rc
|
|
9354 |
+++ b/windows/resource.rc
|
|
9355 |
@@ -14,8 +14,8 @@
|
|
9356 |
|
|
9357 |
#ifndef _MAC
|
|
9358 |
VS_VERSION_INFO VERSIONINFO
|
|
9359 |
- FILEVERSION 1,9,5,0
|
|
9360 |
- PRODUCTVERSION 1,9,5,0
|
|
9361 |
+ FILEVERSION 1,9,6,0
|
|
9362 |
+ PRODUCTVERSION 1,9,6,0
|
|
9363 |
FILEFLAGSMASK 0x3fL
|
|
9364 |
#ifdef _DEBUG
|
|
9365 |
FILEFLAGS 0x1L
|
|
9366 |
@@ -33,14 +33,14 @@
|
|
9367 |
VALUE "Comments", "\0"
|
|
9368 |
VALUE "CompanyName", "Grame\0"
|
|
9369 |
VALUE "FileDescription", "Jackmp for Windows\0"
|
|
9370 |
- VALUE "FileVersion", "1, 9, 5, 0\0"
|
|
9371 |
+ VALUE "FileVersion", "1, 9, 6, 0\0"
|
|
9372 |
VALUE "InternalName", "libjackmp\0"
|
|
9373 |
- VALUE "LegalCopyright", "Copyright Grame © 2006-2009\0"
|
|
9374 |
+ VALUE "LegalCopyright", "Copyright Grame © 2006-2010\0"
|
|
9375 |
VALUE "LegalTrademarks", "\0"
|
|
9376 |
VALUE "OriginalFilename", "libjackmp.dll\0"
|
|
9377 |
VALUE "PrivateBuild", "\0"
|
|
9378 |
VALUE "ProductName", "libjackmp\0"
|
|
9379 |
- VALUE "ProductVersion", "1, 9, 5, 0\0"
|
|
9380 |
+ VALUE "ProductVersion", "1, 9, 6, 0\0"
|
|
9381 |
VALUE "SpecialBuild", "\0"
|
|
9382 |
END
|
|
9383 |
END
|
|
9384 |
--- a/wscript
|
|
9385 |
+++ b/wscript
|
|
9386 |
@@ -11,7 +11,7 @@
|
|
9387 |
import re
|
|
9388 |
import Logs
|
|
9389 |
|
|
9390 |
-VERSION='1.9.5'
|
|
9391 |
+VERSION='1.9.6'
|
|
9392 |
APPNAME='jack'
|
|
9393 |
JACK_API_VERSION = '0.1.0'
|
|
9394 |
|
|
9395 |
@@ -69,7 +69,10 @@
|
|
9396 |
opt.add_option('--mixed', action='store_true', default=False, help='Build with 32/64 bits mixed mode')
|
|
9397 |
opt.add_option('--clients', default=64, type="int", dest="clients", help='Maximum number of JACK clients')
|
|
9398 |
opt.add_option('--ports-per-application', default=768, type="int", dest="application_ports", help='Maximum number of ports per application')
|
|
9399 |
- opt.add_option('--debug', action='store_true', default=False, dest='debug', help="Build debuggable binaries")
|
|
9400 |
+ opt.add_option('--debug', action='store_true', default=False, dest='debug', help='Build debuggable binaries')
|
|
9401 |
+ opt.add_option('--firewire', action='store_true', default=False, help='Enable FireWire driver (FFADO)')
|
|
9402 |
+ opt.add_option('--freebob', action='store_true', default=False, help='Enable FreeBob driver')
|
|
9403 |
+ opt.add_option('--alsa', action='store_true', default=False, help='Enable ALSA driver')
|
|
9404 |
opt.sub_options('dbus')
|
|
9405 |
|
|
9406 |
def configure(conf):
|
|
9407 |
@@ -110,6 +113,15 @@
|
|
9408 |
conf.sub_config('common')
|
|
9409 |
if conf.env['IS_LINUX']:
|
|
9410 |
conf.sub_config('linux')
|
|
9411 |
+ if Options.options.alsa and not conf.env['BUILD_DRIVER_ALSA']:
|
|
9412 |
+ conf.fatal('ALSA driver was explicitly requested but cannot be built')
|
|
9413 |
+ if Options.options.freebob and not conf.env['BUILD_DRIVER_FREEBOB']:
|
|
9414 |
+ conf.fatal('FreeBob driver was explicitly requested but cannot be built')
|
|
9415 |
+ if Options.options.firewire and not conf.env['BUILD_DRIVER_FFADO']:
|
|
9416 |
+ conf.fatal('FFADO driver was explicitly requested but cannot be built')
|
|
9417 |
+ conf.env['BUILD_DRIVER_ALSA'] = Options.options.alsa
|
|
9418 |
+ conf.env['BUILD_DRIVER_FFADO'] = Options.options.firewire
|
|
9419 |
+ conf.env['BUILD_DRIVER_FREEBOB'] = Options.options.freebob
|
|
9420 |
if Options.options.dbus:
|
|
9421 |
conf.sub_config('dbus')
|
|
9422 |
if conf.env['BUILD_JACKDBUS'] != True:
|
|
9423 |
--- a/common/JackDriverLoader.cpp
|
|
9424 |
+++ b/common/JackDriverLoader.cpp
|
|
9425 |
@@ -152,7 +152,7 @@
|
|
9426 |
|
|
9427 |
fprintf (stderr, "Options for driver '%s':\n", desc->name);
|
|
9428 |
jack_print_driver_options (desc, stderr);
|
|
9429 |
- exit (1);
|
|
9430 |
+ return 1;
|
|
9431 |
}
|
|
9432 |
|
|
9433 |
for (param_index = 0; param_index < desc->nparams; param_index++) {
|
|
9434 |
--- a/common/jack/jack.h
|
|
9435 |
+++ b/common/jack/jack.h
|
|
9436 |
@@ -732,7 +732,7 @@
|
|
9437 |
* @return a null-terminated array of full port names to which the @a
|
|
9438 |
* port is connected. If none, returns NULL.
|
|
9439 |
*
|
|
9440 |
- * The caller is responsible for calling free(3) on any non-NULL
|
|
9441 |
+ * The caller is responsible for calling jack_free(3) on any non-NULL
|
|
9442 |
* returned value.
|
|
9443 |
*
|
|
9444 |
* @param port locally owned jack_port_t pointer.
|
|
9445 |
@@ -745,7 +745,7 @@
|
|
9446 |
* @return a null-terminated array of full port names to which the @a
|
|
9447 |
* port is connected. If none, returns NULL.
|
|
9448 |
*
|
|
9449 |
- * The caller is responsible for calling free(3) on any non-NULL
|
|
9450 |
+ * The caller is responsible for calling jack_free(3) on any non-NULL
|
|
9451 |
* returned value.
|
|
9452 |
*
|
|
9453 |
* This differs from jack_port_get_connections() in two important
|
|
9454 |
@@ -996,7 +996,7 @@
|
|
9455 |
* If zero, no selection based on flags will be carried out.
|
|
9456 |
*
|
|
9457 |
* @return a NULL-terminated array of ports that match the specified
|
|
9458 |
- * arguments. The caller is responsible for calling free(3) any
|
|
9459 |
+ * arguments. The caller is responsible for calling jack_free(3) any
|
|
9460 |
* non-NULL returned value.
|
|
9461 |
*
|
|
9462 |
* @see jack_port_name_size(), jack_port_type_size()
|
|
9463 |
--- a/dbus/sigsegv.c
|
|
9464 |
+++ b/dbus/sigsegv.c
|
|
9465 |
@@ -99,7 +99,13 @@
|
|
9466 |
jack_error("info.si_code = %d (%s)", info->si_code, si_codes[info->si_code]);
|
|
9467 |
jack_error("info.si_addr = %p", info->si_addr);
|
|
9468 |
for(i = 0; i < NGREG; i++)
|
|
9469 |
- jack_error("reg[%02d] = 0x" REGFORMAT, i, ucontext->uc_mcontext.gregs[i]);
|
|
9470 |
+ jack_error("reg[%02d] = 0x" REGFORMAT, i,
|
|
9471 |
+#if defined(__powerpc__)
|
|
9472 |
+ ucontext->uc_mcontext.uc_regs[i]
|
|
9473 |
+#else
|
|
9474 |
+ ucontext->uc_mcontext.gregs[i]
|
|
9475 |
+#endif
|
|
9476 |
+ );
|
|
9477 |
|
|
9478 |
#if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
|
|
9479 |
# if defined(SIGSEGV_STACK_IA64)
|
|
9480 |
--- a/example-clients/connect.c
|
|
9481 |
+++ b/example-clients/connect.c
|
|
9482 |
@@ -1,6 +1,6 @@
|
|
9483 |
/*
|
|
9484 |
Copyright (C) 2002 Jeremy Hall
|
|
9485 |
-
|
|
9486 |
+
|
|
9487 |
This program is free software; you can redistribute it and/or modify
|
|
9488 |
it under the terms of the GNU General Public License as published by
|
|
9489 |
the Free Software Foundation; either version 2 of the License, or
|
|
9490 |
@@ -29,9 +29,16 @@
|
|
9491 |
jack_port_t *input_port;
|
|
9492 |
jack_port_t *output_port;
|
|
9493 |
int connecting, disconnecting;
|
|
9494 |
+int done = 0;
|
|
9495 |
#define TRUE 1
|
|
9496 |
#define FALSE 0
|
|
9497 |
|
|
9498 |
+
|
|
9499 |
+void port_connect_callback(jack_port_id_t a, jack_port_id_t b, int connect, void* arg)
|
|
9500 |
+{
|
|
9501 |
+ done = 1;
|
|
9502 |
+}
|
|
9503 |
+
|
|
9504 |
int
|
|
9505 |
main (int argc, char *argv[])
|
|
9506 |
{
|
|
9507 |
@@ -43,7 +50,7 @@
|
|
9508 |
} else {
|
|
9509 |
my_name ++;
|
|
9510 |
}
|
|
9511 |
-
|
|
9512 |
+
|
|
9513 |
printf("name %s\n", my_name);
|
|
9514 |
|
|
9515 |
if (strstr(my_name, "jack_disconnect")) {
|
|
9516 |
@@ -70,7 +77,9 @@
|
|
9517 |
return 1;
|
|
9518 |
}
|
|
9519 |
|
|
9520 |
- /* display the current sample rate. once the client is activated
|
|
9521 |
+ jack_set_port_connect_callback(client, port_connect_callback, NULL);
|
|
9522 |
+
|
|
9523 |
+ /* display the current sample rate. once the client is activated
|
|
9524 |
(see below), you should rely on your own sample rate
|
|
9525 |
callback (see above) for this value.
|
|
9526 |
*/
|
|
9527 |
@@ -85,7 +94,7 @@
|
|
9528 |
fprintf (stderr, "ERROR %s not a valid port\n", argv[2]);
|
|
9529 |
goto error;
|
|
9530 |
}
|
|
9531 |
-
|
|
9532 |
+
|
|
9533 |
/* tell the JACK server that we are ready to roll */
|
|
9534 |
|
|
9535 |
if (jack_activate (client)) {
|
|
9536 |
@@ -109,12 +118,22 @@
|
|
9537 |
goto error;
|
|
9538 |
}
|
|
9539 |
}
|
|
9540 |
+
|
|
9541 |
+ // Wait for connection/disconnection to be effective
|
|
9542 |
+ while(!done) {
|
|
9543 |
+ #ifdef WIN32
|
|
9544 |
+ Sleep(10);
|
|
9545 |
+ #else
|
|
9546 |
+ usleep(10000);
|
|
9547 |
+ #endif
|
|
9548 |
+ }
|
|
9549 |
+
|
|
9550 |
jack_deactivate (client);
|
|
9551 |
jack_client_close (client);
|
|
9552 |
return 0;
|
|
9553 |
-
|
|
9554 |
+
|
|
9555 |
error:
|
|
9556 |
- if (client)
|
|
9557 |
+ if (client)
|
|
9558 |
jack_client_close (client);
|
|
9559 |
return 1;
|
|
9560 |
}
|
|
9561 |
--- a/example-clients/netsource.c
|
|
9562 |
+++ b/example-clients/netsource.c
|
|
9563 |
@@ -503,11 +503,12 @@
|
|
9564 |
if (hostinfo == NULL) {
|
|
9565 |
fprintf (stderr, "init_sockaddr_in: unknown host: %s.\n", hostname);
|
|
9566 |
fflush( stderr );
|
|
9567 |
+ return;
|
|
9568 |
}
|
|
9569 |
#ifdef WIN32
|
|
9570 |
- name->sin_addr.s_addr = inet_addr( hostname );
|
|
9571 |
+ name->sin_addr.s_addr = inet_addr( hostname );
|
|
9572 |
#else
|
|
9573 |
- name->sin_addr = *(struct in_addr *) hostinfo->h_addr ;
|
|
9574 |
+ name->sin_addr = *(struct in_addr *) hostinfo->h_addr ;
|
|
9575 |
#endif
|
|
9576 |
}
|
|
9577 |
else
|
|
9578 |
@@ -622,15 +623,15 @@
|
|
9579 |
case 'b':
|
|
9580 |
bitdepth = atoi (optarg);
|
|
9581 |
break;
|
|
9582 |
- case 'c':
|
|
9583 |
-#if HAVE_CELT
|
|
9584 |
- bitdepth = 1000;
|
|
9585 |
+ case 'c':
|
|
9586 |
+ #if HAVE_CELT
|
|
9587 |
+ bitdepth = 1000;
|
|
9588 |
factor = atoi (optarg);
|
|
9589 |
-#else
|
|
9590 |
+ #else
|
|
9591 |
printf( "not built with celt supprt\n" );
|
|
9592 |
exit(10);
|
|
9593 |
-#endif
|
|
9594 |
- break;
|
|
9595 |
+ #endif
|
|
9596 |
+ break;
|
|
9597 |
case 'm':
|
|
9598 |
mtu = atoi (optarg);
|
|
9599 |
break;
|
|
9600 |
@@ -677,18 +678,17 @@
|
|
9601 |
}
|
|
9602 |
|
|
9603 |
init_sockaddr_in ((struct sockaddr_in *) &destaddr, peer_ip, peer_port);
|
|
9604 |
- if(bind_port) {
|
|
9605 |
+ if (bind_port) {
|
|
9606 |
init_sockaddr_in ((struct sockaddr_in *) &bindaddr, NULL, bind_port);
|
|
9607 |
if( bind (outsockfd, &bindaddr, sizeof (bindaddr)) ) {
|
|
9608 |
- fprintf (stderr, "bind failure\n" );
|
|
9609 |
- }
|
|
9610 |
+ fprintf (stderr, "bind failure\n" );
|
|
9611 |
+ }
|
|
9612 |
}
|
|
9613 |
- if(reply_port)
|
|
9614 |
- {
|
|
9615 |
+ if (reply_port) {
|
|
9616 |
init_sockaddr_in ((struct sockaddr_in *) &bindaddr, NULL, reply_port);
|
|
9617 |
if( bind (insockfd, &bindaddr, sizeof (bindaddr)) ) {
|
|
9618 |
- fprintf (stderr, "bind failure\n" );
|
|
9619 |
- }
|
|
9620 |
+ fprintf (stderr, "bind failure\n" );
|
|
9621 |
+ }
|
|
9622 |
}
|
|
9623 |
|
|
9624 |
/* try to become a client of the JACK server */
|
|
9625 |
--- a/example-clients/wscript
|
|
9626 |
+++ b/example-clients/wscript
|
|
9627 |
@@ -57,7 +57,7 @@
|
|
9628 |
|
|
9629 |
conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.is_defined('HAVE_SNDFILE')
|
|
9630 |
|
|
9631 |
- conf.env['BUILD_EXAMPLE_ALSA_IO'] = conf.is_defined('HAVE_SAMPLERATE')
|
|
9632 |
+ conf.env['BUILD_EXAMPLE_ALSA_IO'] = conf.is_defined('HAVE_SAMPLERATE') and conf.is_defined('HAVE_ALSA')
|
|
9633 |
|
|
9634 |
def build(bld):
|
|
9635 |
if bld.env['IS_LINUX']:
|
|
9636 |
--- a/linux/alsa/JackAlsaDriver.cpp
|
|
9637 |
+++ b/linux/alsa/JackAlsaDriver.cpp
|
|
9638 |
@@ -260,7 +260,7 @@
|
|
9639 |
return 0;
|
|
9640 |
}
|
|
9641 |
|
|
9642 |
-void
|
|
9643 |
+int
|
|
9644 |
JackAlsaDriver::alsa_driver_setup_io_function_pointers (alsa_driver_t *driver)
|
|
9645 |
{
|
|
9646 |
if (driver->playback_handle) {
|
|
9647 |
@@ -340,7 +340,7 @@
|
|
9648 |
default:
|
|
9649 |
jack_error ("impossible sample width (%d) discovered!",
|
|
9650 |
driver->playback_sample_bytes);
|
|
9651 |
- exit (1);
|
|
9652 |
+ return -1;
|
|
9653 |
}
|
|
9654 |
}
|
|
9655 |
}
|
|
9656 |
@@ -364,6 +364,8 @@
|
|
9657 |
break;
|
|
9658 |
}
|
|
9659 |
}
|
|
9660 |
+
|
|
9661 |
+ return 0;
|
|
9662 |
}
|
|
9663 |
|
|
9664 |
int
|
|
9665 |
@@ -779,7 +781,7 @@
|
|
9666 |
default:
|
|
9667 |
jack_error ("programming error: unhandled format "
|
|
9668 |
"type for playback");
|
|
9669 |
- exit (1);
|
|
9670 |
+ return -1;
|
|
9671 |
}
|
|
9672 |
}
|
|
9673 |
|
|
9674 |
@@ -797,7 +799,7 @@
|
|
9675 |
default:
|
|
9676 |
jack_error ("programming error: unhandled format "
|
|
9677 |
"type for capture");
|
|
9678 |
- exit (1);
|
|
9679 |
+ return -1;
|
|
9680 |
}
|
|
9681 |
}
|
|
9682 |
|
|
9683 |
@@ -836,7 +838,8 @@
|
|
9684 |
driver->user_nchannels = driver->playback_nchannels;
|
|
9685 |
}
|
|
9686 |
|
|
9687 |
- alsa_driver_setup_io_function_pointers (driver);
|
|
9688 |
+ if (alsa_driver_setup_io_function_pointers (driver) != 0)
|
|
9689 |
+ return -1;
|
|
9690 |
|
|
9691 |
/* Allocate and initialize structures that rely on the
|
|
9692 |
channels counts.
|
|
9693 |
--- a/linux/alsa/JackAlsaDriver.h
|
|
9694 |
+++ b/linux/alsa/JackAlsaDriver.h
|
|
9695 |
@@ -53,7 +53,7 @@
|
|
9696 |
int alsa_driver_generic_hardware(alsa_driver_t *driver);
|
|
9697 |
int alsa_driver_hw_specific(alsa_driver_t *driver, int hw_monitoring,
|
|
9698 |
int hw_metering);
|
|
9699 |
- void alsa_driver_setup_io_function_pointers (alsa_driver_t *driver);
|
|
9700 |
+ int alsa_driver_setup_io_function_pointers (alsa_driver_t *driver);
|
|
9701 |
int alsa_driver_configure_stream(alsa_driver_t *driver, char *device_name,
|
|
9702 |
const char *stream_name,
|
|
9703 |
snd_pcm_t *handle,
|
|
9704 |
--- a/linux/JackAtomic_os.h
|
|
9705 |
+++ b/linux/JackAtomic_os.h
|
|
9706 |
@@ -42,9 +42,9 @@
|
|
9707 |
"1: \n"
|
|
9708 |
" li %0, 0 \n"
|
|
9709 |
"2: \n"
|
|
9710 |
- : "=r" (result)
|
|
9711 |
- : "r" (addr), "r" (value), "r" (newvalue), "r" (tmp)
|
|
9712 |
- );
|
|
9713 |
+ : "=r" (result)
|
|
9714 |
+ : "r" (addr), "r" (value), "r" (newvalue), "r" (tmp)
|
|
9715 |
+ );
|
|
9716 |
return result;
|
|
9717 |
}
|
|
9718 |
|
|
9719 |
@@ -61,13 +61,23 @@
|
|
9720 |
"# CAS \n\t"
|
|
9721 |
LOCK "cmpxchg %2, (%1) \n\t"
|
|
9722 |
"sete %0 \n\t"
|
|
9723 |
- : "=a" (ret)
|
|
9724 |
- : "c" (addr), "d" (newvalue), "a" (value)
|
|
9725 |
- );
|
|
9726 |
+ : "=a" (ret)
|
|
9727 |
+ : "c" (addr), "d" (newvalue), "a" (value)
|
|
9728 |
+ );
|
|
9729 |
return ret;
|
|
9730 |
}
|
|
9731 |
|
|
9732 |
#endif
|
|
9733 |
|
|
9734 |
+#if !defined(__i386__) && !defined(__x86_64__) && !defined(__PPC__)
|
|
9735 |
+#warning using builtin gcc (version > 4.1) atomic
|
|
9736 |
+
|
|
9737 |
+static inline char CAS(volatile UInt32 value, UInt32 newvalue, volatile void* addr)
|
|
9738 |
+{
|
|
9739 |
+ return __sync_bool_compare_and_swap (&addr, value, newvalue);
|
|
9740 |
+}
|
|
9741 |
+#endif
|
|
9742 |
+
|
|
9743 |
+
|
|
9744 |
#endif
|
|
9745 |
|
|
9746 |
--- a/linux/JackPlatformPlug_os.h
|
|
9747 |
+++ b/linux/JackPlatformPlug_os.h
|
|
9748 |
@@ -20,6 +20,10 @@
|
|
9749 |
#ifndef __JackPlatformPlug_linux__
|
|
9750 |
#define __JackPlatformPlug_linux__
|
|
9751 |
|
|
9752 |
+#define jack_server_dir "/dev/shm"
|
|
9753 |
+#define jack_client_dir "/dev/shm"
|
|
9754 |
+#define JACK_DEFAULT_DRIVER "alsa"
|
|
9755 |
+
|
|
9756 |
namespace Jack
|
|
9757 |
{
|
|
9758 |
struct JackRequest;
|
|
9759 |
@@ -45,8 +49,13 @@
|
|
9760 |
namespace Jack { typedef JackPosixThread JackThread; }
|
|
9761 |
|
|
9762 |
/* __JackPlatformSynchro__ client activation */
|
|
9763 |
+/*
|
|
9764 |
#include "JackFifo.h"
|
|
9765 |
namespace Jack { typedef JackFifo JackSynchro; }
|
|
9766 |
+*/
|
|
9767 |
+
|
|
9768 |
+#include "JackPosixSemaphore.h"
|
|
9769 |
+namespace Jack { typedef JackPosixSemaphore JackSynchro; }
|
|
9770 |
|
|
9771 |
/* __JackPlatformChannelTransaction__ */
|
|
9772 |
#include "JackSocket.h"
|
|
9773 |
--- a/macosx/JackAtomic_os.h
|
|
9774 |
+++ b/macosx/JackAtomic_os.h
|
|
9775 |
@@ -41,10 +41,10 @@
|
|
9776 |
"1: \n"
|
|
9777 |
" li %0, 0 \n"
|
|
9778 |
"2: \n"
|
|
9779 |
- : "=r" (result)
|
|
9780 |
- : "r" (addr), "r" (value), "r" (newvalue)
|
|
9781 |
- : "r0"
|
|
9782 |
- );
|
|
9783 |
+ : "=r" (result)
|
|
9784 |
+ : "r" (addr), "r" (value), "r" (newvalue)
|
|
9785 |
+ : "r0"
|
|
9786 |
+ );
|
|
9787 |
return result;
|
|
9788 |
}
|
|
9789 |
|
|
9790 |
@@ -61,9 +61,9 @@
|
|
9791 |
"# CAS \n\t"
|
|
9792 |
LOCK "cmpxchg %2, (%1) \n\t"
|
|
9793 |
"sete %0 \n\t"
|
|
9794 |
- : "=a" (ret)
|
|
9795 |
- : "c" (addr), "d" (newvalue), "a" (value)
|
|
9796 |
- );
|
|
9797 |
+ : "=a" (ret)
|
|
9798 |
+ : "c" (addr), "d" (newvalue), "a" (value)
|
|
9799 |
+ );
|
|
9800 |
return ret;
|
|
9801 |
}
|
|
9802 |
|
|
9803 |
--- a/macosx/JackPlatformPlug_os.h
|
|
9804 |
+++ b/macosx/JackPlatformPlug_os.h
|
|
9805 |
@@ -20,6 +20,10 @@
|
|
9806 |
#ifndef __JackPlatformPlug_APPLE__
|
|
9807 |
#define __JackPlatformPlug_APPLE__
|
|
9808 |
|
|
9809 |
+#define jack_server_dir "/tmp"
|
|
9810 |
+#define jack_client_dir "/tmp"
|
|
9811 |
+#define JACK_DEFAULT_DRIVER "coreaudio"
|
|
9812 |
+
|
|
9813 |
namespace Jack
|
|
9814 |
{
|
|
9815 |
class JackPosixMutex;
|
|
9816 |
--- a/posix/JackFifo.cpp
|
|
9817 |
+++ b/posix/JackFifo.cpp
|
|
9818 |
@@ -20,7 +20,7 @@
|
|
9819 |
#include "JackFifo.h"
|
|
9820 |
#include "JackTools.h"
|
|
9821 |
#include "JackError.h"
|
|
9822 |
-#include "JackConstants.h"
|
|
9823 |
+#include "JackPlatformPlug.h"
|
|
9824 |
#include <sys/types.h>
|
|
9825 |
#include <sys/stat.h>
|
|
9826 |
#include <unistd.h>
|
|
9827 |
--- a/solaris/JackPlatformPlug_os.h
|
|
9828 |
+++ b/solaris/JackPlatformPlug_os.h
|
|
9829 |
@@ -20,6 +20,10 @@
|
|
9830 |
#ifndef __JackPlatformPlug_sun__
|
|
9831 |
#define __JackPlatformPlug_sun__
|
|
9832 |
|
|
9833 |
+#define jack_server_dir "/tmp"
|
|
9834 |
+#define jack_client_dir "/tmp"
|
|
9835 |
+#define JACK_DEFAULT_DRIVER "oss"
|
|
9836 |
+
|
|
9837 |
namespace Jack
|
|
9838 |
{
|
|
9839 |
struct JackRequest;
|
|
9840 |
--- a/common/JackAPI.cpp
|
|
9841 |
+++ b/common/JackAPI.cpp
|
|
9842 |
@@ -56,9 +56,9 @@
|
|
9843 |
const char *
|
|
9844 |
jack_get_version_string();
|
|
9845 |
|
|
9846 |
- EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
|
|
9847 |
+ jack_client_t * jack_client_new_aux (const char *client_name,
|
|
9848 |
jack_options_t options,
|
|
9849 |
- jack_status_t *status, va_list ap);
|
|
9850 |
+ jack_status_t *status);
|
|
9851 |
EXPORT jack_client_t * jack_client_open (const char *client_name,
|
|
9852 |
jack_options_t options,
|
|
9853 |
jack_status_t *status, ...);
|
|
9854 |
@@ -300,7 +300,7 @@
|
|
9855 |
int options = JackUseExactName;
|
|
9856 |
if (getenv("JACK_START_SERVER") == NULL)
|
|
9857 |
options |= JackNoStartServer;
|
|
9858 |
- jack_client_t* res = jack_client_open_aux(client_name, (jack_options_t)options, NULL, NULL);
|
|
9859 |
+ jack_client_t* res = jack_client_new_aux(client_name, (jack_options_t)options, NULL);
|
|
9860 |
JackGlobals::fOpenMutex->Unlock();
|
|
9861 |
return res;
|
|
9862 |
} catch (std::bad_alloc& e) {
|
|
9863 |
@@ -317,11 +317,7 @@
|
|
9864 |
#ifdef __CLIENTDEBUG__
|
|
9865 |
JackGlobals::CheckContext("jack_port_get_buffer");
|
|
9866 |
#endif
|
|
9867 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9868 |
- uint64_t port_aux = (uint64_t)port;
|
|
9869 |
-#else
|
|
9870 |
- uint32_t port_aux = (uint32_t)port;
|
|
9871 |
-#endif
|
|
9872 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9873 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
9874 |
if (!CheckPort(myport)) {
|
|
9875 |
jack_error("jack_port_get_buffer called with an incorrect port %ld", myport);
|
|
9876 |
@@ -337,11 +333,7 @@
|
|
9877 |
#ifdef __CLIENTDEBUG__
|
|
9878 |
JackGlobals::CheckContext("jack_port_name");
|
|
9879 |
#endif
|
|
9880 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9881 |
- uint64_t port_aux = (uint64_t)port;
|
|
9882 |
-#else
|
|
9883 |
- uint32_t port_aux = (uint32_t)port;
|
|
9884 |
-#endif
|
|
9885 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9886 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
9887 |
if (!CheckPort(myport)) {
|
|
9888 |
jack_error("jack_port_name called with an incorrect port %ld", myport);
|
|
9889 |
@@ -357,11 +349,7 @@
|
|
9890 |
#ifdef __CLIENTDEBUG__
|
|
9891 |
JackGlobals::CheckContext("jack_port_short_name");
|
|
9892 |
#endif
|
|
9893 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9894 |
- uint64_t port_aux = (uint64_t)port;
|
|
9895 |
-#else
|
|
9896 |
- uint32_t port_aux = (uint32_t)port;
|
|
9897 |
-#endif
|
|
9898 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9899 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
9900 |
if (!CheckPort(myport)) {
|
|
9901 |
jack_error("jack_port_short_name called with an incorrect port %ld", myport);
|
|
9902 |
@@ -377,11 +365,7 @@
|
|
9903 |
#ifdef __CLIENTDEBUG__
|
|
9904 |
JackGlobals::CheckContext("jack_port_flags");
|
|
9905 |
#endif
|
|
9906 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9907 |
- uint64_t port_aux = (uint64_t)port;
|
|
9908 |
-#else
|
|
9909 |
- uint32_t port_aux = (uint32_t)port;
|
|
9910 |
-#endif
|
|
9911 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9912 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
9913 |
if (!CheckPort(myport)) {
|
|
9914 |
jack_error("jack_port_flags called with an incorrect port %ld", myport);
|
|
9915 |
@@ -397,11 +381,7 @@
|
|
9916 |
#ifdef __CLIENTDEBUG__
|
|
9917 |
JackGlobals::CheckContext("jack_port_type");
|
|
9918 |
#endif
|
|
9919 |
- #if defined(__x86_64__) || defined(__ppc64__)
|
|
9920 |
- uint64_t port_aux = (uint64_t)port;
|
|
9921 |
-#else
|
|
9922 |
- uint32_t port_aux = (uint32_t)port;
|
|
9923 |
-#endif
|
|
9924 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9925 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
9926 |
if (!CheckPort(myport)) {
|
|
9927 |
jack_error("jack_port_flags called an incorrect port %ld", myport);
|
|
9928 |
@@ -417,11 +397,7 @@
|
|
9929 |
#ifdef __CLIENTDEBUG__
|
|
9930 |
JackGlobals::CheckContext("jack_port_type_id");
|
|
9931 |
#endif
|
|
9932 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9933 |
- uint64_t port_aux = (uint64_t)port;
|
|
9934 |
-#else
|
|
9935 |
- uint32_t port_aux = (uint32_t)port;
|
|
9936 |
-#endif
|
|
9937 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9938 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
9939 |
if (!CheckPort(myport)) {
|
|
9940 |
jack_error("jack_port_type_id called an incorrect port %ld", myport);
|
|
9941 |
@@ -437,11 +413,7 @@
|
|
9942 |
#ifdef __CLIENTDEBUG__
|
|
9943 |
JackGlobals::CheckContext("jack_port_connected");
|
|
9944 |
#endif
|
|
9945 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9946 |
- uint64_t port_aux = (uint64_t)port;
|
|
9947 |
-#else
|
|
9948 |
- uint32_t port_aux = (uint32_t)port;
|
|
9949 |
-#endif
|
|
9950 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9951 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
9952 |
if (!CheckPort(myport)) {
|
|
9953 |
jack_error("jack_port_connected called with an incorrect port %ld", myport);
|
|
9954 |
@@ -458,11 +430,7 @@
|
|
9955 |
#ifdef __CLIENTDEBUG__
|
|
9956 |
JackGlobals::CheckContext("jack_port_connected_to");
|
|
9957 |
#endif
|
|
9958 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9959 |
- uint64_t port_aux = (uint64_t)port;
|
|
9960 |
-#else
|
|
9961 |
- uint32_t port_aux = (uint32_t)port;
|
|
9962 |
-#endif
|
|
9963 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
9964 |
jack_port_id_t src = (jack_port_id_t)port_aux;
|
|
9965 |
if (!CheckPort(src)) {
|
|
9966 |
jack_error("jack_port_connected_to called with an incorrect port %ld", src);
|
|
9967 |
@@ -488,21 +456,13 @@
|
|
9968 |
#ifdef __CLIENTDEBUG__
|
|
9969 |
JackGlobals::CheckContext("jack_port_tie");
|
|
9970 |
#endif
|
|
9971 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9972 |
- uint64_t src_aux = (uint64_t)src;
|
|
9973 |
-#else
|
|
9974 |
- uint32_t src_aux = (uint32_t)src;
|
|
9975 |
-#endif
|
|
9976 |
+ uintptr_t src_aux = (uintptr_t)src;
|
|
9977 |
jack_port_id_t mysrc = (jack_port_id_t)src_aux;
|
|
9978 |
if (!CheckPort(mysrc)) {
|
|
9979 |
jack_error("jack_port_tie called with a NULL src port");
|
|
9980 |
return -1;
|
|
9981 |
}
|
|
9982 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9983 |
- uint64_t dst_aux = (uint64_t)dst;
|
|
9984 |
-#else
|
|
9985 |
- uint32_t dst_aux = (uint32_t)dst;
|
|
9986 |
-#endif
|
|
9987 |
+ uintptr_t dst_aux = (uintptr_t)dst;
|
|
9988 |
jack_port_id_t mydst = (jack_port_id_t)dst_aux;
|
|
9989 |
if (!CheckPort(mydst)) {
|
|
9990 |
jack_error("jack_port_tie called with a NULL dst port");
|
|
9991 |
@@ -522,11 +482,7 @@
|
|
9992 |
#ifdef __CLIENTDEBUG__
|
|
9993 |
JackGlobals::CheckContext("jack_port_untie");
|
|
9994 |
#endif
|
|
9995 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
9996 |
- uint64_t port_aux = (uint64_t)port;
|
|
9997 |
-#else
|
|
9998 |
- uint32_t port_aux = (uint32_t)port;
|
|
9999 |
-#endif
|
|
10000 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10001 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10002 |
if (!CheckPort(myport)) {
|
|
10003 |
jack_error("jack_port_untie called with an incorrect port %ld", myport);
|
|
10004 |
@@ -542,11 +498,7 @@
|
|
10005 |
#ifdef __CLIENTDEBUG__
|
|
10006 |
JackGlobals::CheckContext("jack_port_get_latency");
|
|
10007 |
#endif
|
|
10008 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10009 |
- uint64_t port_aux = (uint64_t)port;
|
|
10010 |
-#else
|
|
10011 |
- uint32_t port_aux = (uint32_t)port;
|
|
10012 |
-#endif
|
|
10013 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10014 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10015 |
if (!CheckPort(myport)) {
|
|
10016 |
jack_error("jack_port_get_latency called with an incorrect port %ld", myport);
|
|
10017 |
@@ -563,11 +515,7 @@
|
|
10018 |
#ifdef __CLIENTDEBUG__
|
|
10019 |
JackGlobals::CheckContext("jack_port_set_latency");
|
|
10020 |
#endif
|
|
10021 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10022 |
- uint64_t port_aux = (uint64_t)port;
|
|
10023 |
-#else
|
|
10024 |
- uint32_t port_aux = (uint32_t)port;
|
|
10025 |
-#endif
|
|
10026 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10027 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10028 |
if (!CheckPort(myport)) {
|
|
10029 |
jack_error("jack_port_set_latency called with an incorrect port %ld", myport);
|
|
10030 |
@@ -585,11 +533,7 @@
|
|
10031 |
#endif
|
|
10032 |
|
|
10033 |
JackClient* client = (JackClient*)ext_client;
|
|
10034 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10035 |
- uint64_t port_aux = (uint64_t)port;
|
|
10036 |
-#else
|
|
10037 |
- uint32_t port_aux = (uint32_t)port;
|
|
10038 |
-#endif
|
|
10039 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10040 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10041 |
if (client == NULL) {
|
|
10042 |
jack_error("jack_recompute_total_latencies called with a NULL client");
|
|
10043 |
@@ -630,11 +574,7 @@
|
|
10044 |
#ifdef __CLIENTDEBUG__
|
|
10045 |
JackGlobals::CheckContext("jack_port_set_name");
|
|
10046 |
#endif
|
|
10047 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10048 |
- uint64_t port_aux = (uint64_t)port;
|
|
10049 |
-#else
|
|
10050 |
- uint32_t port_aux = (uint32_t)port;
|
|
10051 |
-#endif
|
|
10052 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10053 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10054 |
if (!CheckPort(myport)) {
|
|
10055 |
jack_error("jack_port_set_name called with an incorrect port %ld", myport);
|
|
10056 |
@@ -660,11 +600,7 @@
|
|
10057 |
#ifdef __CLIENTDEBUG__
|
|
10058 |
JackGlobals::CheckContext("jack_port_set_alias");
|
|
10059 |
#endif
|
|
10060 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10061 |
- uint64_t port_aux = (uint64_t)port;
|
|
10062 |
-#else
|
|
10063 |
- uint32_t port_aux = (uint32_t)port;
|
|
10064 |
-#endif
|
|
10065 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10066 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10067 |
if (!CheckPort(myport)) {
|
|
10068 |
jack_error("jack_port_set_alias called with an incorrect port %ld", myport);
|
|
10069 |
@@ -683,11 +619,7 @@
|
|
10070 |
#ifdef __CLIENTDEBUG__
|
|
10071 |
JackGlobals::CheckContext("jack_port_unset_alias");
|
|
10072 |
#endif
|
|
10073 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10074 |
- uint64_t port_aux = (uint64_t)port;
|
|
10075 |
-#else
|
|
10076 |
- uint32_t port_aux = (uint32_t)port;
|
|
10077 |
-#endif
|
|
10078 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10079 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10080 |
if (!CheckPort(myport)) {
|
|
10081 |
jack_error("jack_port_unset_alias called with an incorrect port %ld", myport);
|
|
10082 |
@@ -706,11 +638,7 @@
|
|
10083 |
#ifdef __CLIENTDEBUG__
|
|
10084 |
JackGlobals::CheckContext("jack_port_get_aliases");
|
|
10085 |
#endif
|
|
10086 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10087 |
- uint64_t port_aux = (uint64_t)port;
|
|
10088 |
-#else
|
|
10089 |
- uint32_t port_aux = (uint32_t)port;
|
|
10090 |
-#endif
|
|
10091 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10092 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10093 |
if (!CheckPort(myport)) {
|
|
10094 |
jack_error("jack_port_get_aliases called with an incorrect port %ld", myport);
|
|
10095 |
@@ -726,11 +654,7 @@
|
|
10096 |
#ifdef __CLIENTDEBUG__
|
|
10097 |
JackGlobals::CheckContext("jack_port_request_monitor");
|
|
10098 |
#endif
|
|
10099 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10100 |
- uint64_t port_aux = (uint64_t)port;
|
|
10101 |
-#else
|
|
10102 |
- uint32_t port_aux = (uint32_t)port;
|
|
10103 |
-#endif
|
|
10104 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10105 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10106 |
if (!CheckPort(myport)) {
|
|
10107 |
jack_error("jack_port_request_monitor called with an incorrect port %ld", myport);
|
|
10108 |
@@ -769,11 +693,7 @@
|
|
10109 |
#ifdef __CLIENTDEBUG__
|
|
10110 |
JackGlobals::CheckContext("jack_port_ensure_monitor");
|
|
10111 |
#endif
|
|
10112 |
- #if defined(__x86_64__) || defined(__ppc64__)
|
|
10113 |
- uint64_t port_aux = (uint64_t)port;
|
|
10114 |
-#else
|
|
10115 |
- uint32_t port_aux = (uint32_t)port;
|
|
10116 |
-#endif
|
|
10117 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10118 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10119 |
if (!CheckPort(myport)) {
|
|
10120 |
jack_error("jack_port_ensure_monitor called with an incorrect port %ld", myport);
|
|
10121 |
@@ -789,11 +709,7 @@
|
|
10122 |
#ifdef __CLIENTDEBUG__
|
|
10123 |
JackGlobals::CheckContext("jack_port_monitoring_input");
|
|
10124 |
#endif
|
|
10125 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10126 |
- uint64_t port_aux = (uint64_t)port;
|
|
10127 |
-#else
|
|
10128 |
- uint32_t port_aux = (uint32_t)port;
|
|
10129 |
-#endif
|
|
10130 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10131 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10132 |
if (!CheckPort(myport)) {
|
|
10133 |
jack_error("jack_port_monitoring_input called with an incorrect port %ld", myport);
|
|
10134 |
@@ -1128,11 +1044,7 @@
|
|
10135 |
jack_error("jack_port_register called with a NULL port name or a NULL port_type");
|
|
10136 |
return NULL;
|
|
10137 |
} else {
|
|
10138 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10139 |
- return (jack_port_t *)((uint64_t)client->PortRegister(port_name, port_type, flags, buffer_size));
|
|
10140 |
-#else
|
|
10141 |
- return (jack_port_t *)client->PortRegister(port_name, port_type, flags, buffer_size);
|
|
10142 |
-#endif
|
|
10143 |
+ return (jack_port_t *)((uintptr_t)client->PortRegister(port_name, port_type, flags, buffer_size));
|
|
10144 |
}
|
|
10145 |
}
|
|
10146 |
|
|
10147 |
@@ -1146,11 +1058,7 @@
|
|
10148 |
jack_error("jack_port_unregister called with a NULL client");
|
|
10149 |
return -1;
|
|
10150 |
}
|
|
10151 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10152 |
- uint64_t port_aux = (uint64_t)port;
|
|
10153 |
-#else
|
|
10154 |
- uint32_t port_aux = (uint32_t)port;
|
|
10155 |
-#endif
|
|
10156 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10157 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10158 |
if (!CheckPort(myport)) {
|
|
10159 |
jack_error("jack_port_unregister called with an incorrect port %ld", myport);
|
|
10160 |
@@ -1169,11 +1077,7 @@
|
|
10161 |
jack_error("jack_port_is_mine called with a NULL client");
|
|
10162 |
return -1;
|
|
10163 |
}
|
|
10164 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10165 |
- uint64_t port_aux = (uint64_t)port;
|
|
10166 |
-#else
|
|
10167 |
- uint32_t port_aux = (uint32_t)port;
|
|
10168 |
-#endif
|
|
10169 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10170 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10171 |
if (!CheckPort(myport)) {
|
|
10172 |
jack_error("jack_port_is_mine called with an incorrect port %ld", myport);
|
|
10173 |
@@ -1187,11 +1091,7 @@
|
|
10174 |
#ifdef __CLIENTDEBUG__
|
|
10175 |
JackGlobals::CheckContext("jack_port_get_connections");
|
|
10176 |
#endif
|
|
10177 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10178 |
- uint64_t port_aux = (uint64_t)port;
|
|
10179 |
-#else
|
|
10180 |
- uint32_t port_aux = (uint32_t)port;
|
|
10181 |
-#endif
|
|
10182 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10183 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10184 |
if (!CheckPort(myport)) {
|
|
10185 |
jack_error("jack_port_get_connections called with an incorrect port %ld", myport);
|
|
10186 |
@@ -1215,11 +1115,7 @@
|
|
10187 |
return NULL;
|
|
10188 |
}
|
|
10189 |
|
|
10190 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10191 |
- uint64_t port_aux = (uint64_t)port;
|
|
10192 |
-#else
|
|
10193 |
- uint32_t port_aux = (uint32_t)port;
|
|
10194 |
-#endif
|
|
10195 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10196 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10197 |
if (!CheckPort(myport)) {
|
|
10198 |
jack_error("jack_port_get_all_connections called with an incorrect port %ld", myport);
|
|
10199 |
@@ -1242,11 +1138,7 @@
|
|
10200 |
return 0;
|
|
10201 |
}
|
|
10202 |
|
|
10203 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10204 |
- uint64_t port_aux = (uint64_t)port;
|
|
10205 |
-#else
|
|
10206 |
- uint32_t port_aux = (uint32_t)port;
|
|
10207 |
-#endif
|
|
10208 |
+ uintptr_t port_aux = (uintptr_t)port;
|
|
10209 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10210 |
if (!CheckPort(myport)) {
|
|
10211 |
jack_error("jack_port_get_total_latency called with an incorrect port %ld", myport);
|
|
10212 |
@@ -1307,11 +1199,7 @@
|
|
10213 |
jack_error("jack_port_disconnect called with a NULL client");
|
|
10214 |
return -1;
|
|
10215 |
}
|
|
10216 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10217 |
- uint64_t port_aux = (uint64_t)src;
|
|
10218 |
-#else
|
|
10219 |
- uint32_t port_aux = (uint32_t)src;
|
|
10220 |
-#endif
|
|
10221 |
+ uintptr_t port_aux = (uintptr_t)src;
|
|
10222 |
jack_port_id_t myport = (jack_port_id_t)port_aux;
|
|
10223 |
if (!CheckPort(myport)) {
|
|
10224 |
jack_error("jack_port_disconnect called with an incorrect port %ld", myport);
|
|
10225 |
@@ -1383,11 +1271,7 @@
|
|
10226 |
if (!manager)
|
|
10227 |
return NULL;
|
|
10228 |
int res = manager->GetPort(portname); // returns a port index at least > 1
|
|
10229 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10230 |
- return (res == NO_PORT) ? NULL : (jack_port_t*)((uint64_t)res);
|
|
10231 |
-#else
|
|
10232 |
- return (res == NO_PORT) ? NULL : (jack_port_t*)res;
|
|
10233 |
-#endif
|
|
10234 |
+ return (res == NO_PORT) ? NULL : (jack_port_t*)((uintptr_t)res);
|
|
10235 |
}
|
|
10236 |
}
|
|
10237 |
|
|
10238 |
@@ -1397,11 +1281,7 @@
|
|
10239 |
JackGlobals::CheckContext("jack_port_by_id");
|
|
10240 |
#endif
|
|
10241 |
/* jack_port_t* type is actually the port index */
|
|
10242 |
-#if defined(__x86_64__) || defined(__ppc64__)
|
|
10243 |
- return (jack_port_t*)((uint64_t)id);
|
|
10244 |
-#else
|
|
10245 |
- return (jack_port_t*)id;
|
|
10246 |
-#endif
|
|
10247 |
+ return (jack_port_t*)((uintptr_t)id);
|
|
10248 |
}
|
|
10249 |
|
|
10250 |
EXPORT int jack_engine_takeover_timebase(jack_client_t* ext_client)
|
|
10251 |
--- a/common/JackLibAPI.cpp
|
|
10252 |
+++ b/common/JackLibAPI.cpp
|
|
10253 |
@@ -36,7 +36,10 @@
|
|
10254 |
{
|
|
10255 |
#endif
|
|
10256 |
|
|
10257 |
- EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
|
|
10258 |
+ jack_client_t * jack_client_new_aux (const char *client_name,
|
|
10259 |
+ jack_options_t options,
|
|
10260 |
+ jack_status_t *status);
|
|
10261 |
+ jack_client_t * jack_client_open_aux (const char *client_name,
|
|
10262 |
jack_options_t options,
|
|
10263 |
jack_status_t *status, va_list ap);
|
|
10264 |
EXPORT jack_client_t * jack_client_open (const char *client_name,
|
|
10265 |
@@ -52,18 +55,18 @@
|
|
10266 |
JackLibGlobals* JackLibGlobals::fGlobals = NULL;
|
|
10267 |
int JackLibGlobals::fClientCount = 0;
|
|
10268 |
|
|
10269 |
-EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
|
|
10270 |
+jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t options, jack_status_t* status)
|
|
10271 |
{
|
|
10272 |
jack_varargs_t va; /* variable arguments */
|
|
10273 |
jack_status_t my_status;
|
|
10274 |
JackClient* client;
|
|
10275 |
|
|
10276 |
if (client_name == NULL) {
|
|
10277 |
- jack_error("jack_client_open called with a NULL client_name");
|
|
10278 |
+ jack_error("jack_client_new called with a NULL client_name");
|
|
10279 |
return NULL;
|
|
10280 |
}
|
|
10281 |
|
|
10282 |
- jack_log("jack_client_open %s", client_name);
|
|
10283 |
+ jack_log("jack_client_new %s", client_name);
|
|
10284 |
|
|
10285 |
if (status == NULL) /* no status from caller? */
|
|
10286 |
status = &my_status; /* use local status word */
|
|
10287 |
@@ -77,11 +80,60 @@
|
|
10288 |
}
|
|
10289 |
|
|
10290 |
/* parse variable arguments */
|
|
10291 |
- if (ap) {
|
|
10292 |
- jack_varargs_parse(options, ap, &va);
|
|
10293 |
+ jack_varargs_init(&va);
|
|
10294 |
+
|
|
10295 |
+ JackLibGlobals::Init(); // jack library initialisation
|
|
10296 |
+
|
|
10297 |
+ if (try_start_server(&va, options, status)) {
|
|
10298 |
+ jack_error("jack server is not running or cannot be started");
|
|
10299 |
+ JackLibGlobals::Destroy(); // jack library destruction
|
|
10300 |
+ return 0;
|
|
10301 |
+ }
|
|
10302 |
+
|
|
10303 |
+ if (JACK_DEBUG) {
|
|
10304 |
+ client = new JackDebugClient(new JackLibClient(GetSynchroTable())); // Debug mode
|
|
10305 |
} else {
|
|
10306 |
- jack_varargs_init(&va);
|
|
10307 |
+ client = new JackLibClient(GetSynchroTable());
|
|
10308 |
+ }
|
|
10309 |
+
|
|
10310 |
+ int res = client->Open(va.server_name, client_name, options, status);
|
|
10311 |
+ if (res < 0) {
|
|
10312 |
+ delete client;
|
|
10313 |
+ JackLibGlobals::Destroy(); // jack library destruction
|
|
10314 |
+ int my_status1 = (JackFailure | JackServerError);
|
|
10315 |
+ *status = (jack_status_t)my_status1;
|
|
10316 |
+ return NULL;
|
|
10317 |
+ } else {
|
|
10318 |
+ return (jack_client_t*)client;
|
|
10319 |
+ }
|
|
10320 |
+}
|
|
10321 |
+
|
|
10322 |
+jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
|
|
10323 |
+{
|
|
10324 |
+ jack_varargs_t va; /* variable arguments */
|
|
10325 |
+ jack_status_t my_status;
|
|
10326 |
+ JackClient* client;
|
|
10327 |
+
|
|
10328 |
+ if (client_name == NULL) {
|
|
10329 |
+ jack_error("jack_client_open called with a NULL client_name");
|
|
10330 |
+ return NULL;
|
|
10331 |
}
|
|
10332 |
+
|
|
10333 |
+ jack_log("jack_client_open %s", client_name);
|
|
10334 |
+
|
|
10335 |
+ if (status == NULL) /* no status from caller? */
|
|
10336 |
+ status = &my_status; /* use local status word */
|
|
10337 |
+ *status = (jack_status_t)0;
|
|
10338 |
+
|
|
10339 |
+ /* validate parameters */
|
|
10340 |
+ if ((options & ~JackOpenOptions)) {
|
|
10341 |
+ int my_status1 = *status | (JackFailure | JackInvalidOption);
|
|
10342 |
+ *status = (jack_status_t)my_status1;
|
|
10343 |
+ return NULL;
|
|
10344 |
+ }
|
|
10345 |
+
|
|
10346 |
+ /* parse variable arguments */
|
|
10347 |
+ jack_varargs_parse(options, ap, &va);
|
|
10348 |
|
|
10349 |
JackLibGlobals::Init(); // jack library initialisation
|
|
10350 |
|
|
10351 |
@@ -111,10 +163,10 @@
|
|
10352 |
|
|
10353 |
EXPORT jack_client_t* jack_client_open(const char* ext_client_name, jack_options_t options, jack_status_t* status, ...)
|
|
10354 |
{
|
|
10355 |
- try {
|
|
10356 |
#ifdef __CLIENTDEBUG__
|
|
10357 |
JackGlobals::CheckContext("jack_client_open");
|
|
10358 |
#endif
|
|
10359 |
+ try {
|
|
10360 |
assert(JackGlobals::fOpenMutex);
|
|
10361 |
JackGlobals::fOpenMutex->Lock();
|
|
10362 |
va_list ap;
|
|
10363 |
--- a/common/JackServerAPI.cpp
|
|
10364 |
+++ b/common/JackServerAPI.cpp
|
|
10365 |
@@ -33,7 +33,10 @@
|
|
10366 |
{
|
|
10367 |
#endif
|
|
10368 |
|
|
10369 |
- EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
|
|
10370 |
+ jack_client_t * jack_client_new_aux (const char *client_name,
|
|
10371 |
+ jack_options_t options,
|
|
10372 |
+ jack_status_t *status);
|
|
10373 |
+ jack_client_t * jack_client_open_aux (const char *client_name,
|
|
10374 |
jack_options_t options,
|
|
10375 |
jack_status_t *status, va_list ap);
|
|
10376 |
EXPORT jack_client_t * jack_client_open (const char *client_name,
|
|
10377 |
@@ -48,18 +51,18 @@
|
|
10378 |
|
|
10379 |
using namespace Jack;
|
|
10380 |
|
|
10381 |
-EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
|
|
10382 |
+jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t options, jack_status_t* status)
|
|
10383 |
{
|
|
10384 |
jack_varargs_t va; /* variable arguments */
|
|
10385 |
jack_status_t my_status;
|
|
10386 |
JackClient* client;
|
|
10387 |
|
|
10388 |
if (client_name == NULL) {
|
|
10389 |
- jack_error("jack_client_open called with a NULL client_name");
|
|
10390 |
+ jack_error("jack_client_new called with a NULL client_name");
|
|
10391 |
return NULL;
|
|
10392 |
}
|
|
10393 |
|
|
10394 |
- jack_log("jack_client_open %s", client_name);
|
|
10395 |
+ jack_log("jack_client_new %s", client_name);
|
|
10396 |
|
|
10397 |
if (status == NULL) /* no status from caller? */
|
|
10398 |
status = &my_status; /* use local status word */
|
|
10399 |
@@ -73,12 +76,59 @@
|
|
10400 |
}
|
|
10401 |
|
|
10402 |
/* parse variable arguments */
|
|
10403 |
- if (ap) {
|
|
10404 |
- jack_varargs_parse(options, ap, &va);
|
|
10405 |
+ jack_varargs_init(&va);
|
|
10406 |
+
|
|
10407 |
+ if (!JackServerGlobals::Init()) { // jack server initialisation
|
|
10408 |
+ int my_status1 = (JackFailure | JackServerError);
|
|
10409 |
+ *status = (jack_status_t)my_status1;
|
|
10410 |
+ return NULL;
|
|
10411 |
+ }
|
|
10412 |
+
|
|
10413 |
+ if (JACK_DEBUG) {
|
|
10414 |
+ client = new JackDebugClient(new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable())); // Debug mode
|
|
10415 |
} else {
|
|
10416 |
- jack_varargs_init(&va);
|
|
10417 |
+ client = new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable());
|
|
10418 |
+ }
|
|
10419 |
+
|
|
10420 |
+ int res = client->Open(va.server_name, client_name, options, status);
|
|
10421 |
+ if (res < 0) {
|
|
10422 |
+ delete client;
|
|
10423 |
+ JackServerGlobals::Destroy(); // jack server destruction
|
|
10424 |
+ int my_status1 = (JackFailure | JackServerError);
|
|
10425 |
+ *status = (jack_status_t)my_status1;
|
|
10426 |
+ return NULL;
|
|
10427 |
+ } else {
|
|
10428 |
+ return (jack_client_t*)client;
|
|
10429 |
+ }
|
|
10430 |
+}
|
|
10431 |
+
|
|
10432 |
+jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
|
|
10433 |
+{
|
|
10434 |
+ jack_varargs_t va; /* variable arguments */
|
|
10435 |
+ jack_status_t my_status;
|
|
10436 |
+ JackClient* client;
|
|
10437 |
+
|
|
10438 |
+ if (client_name == NULL) {
|
|
10439 |
+ jack_error("jack_client_open called with a NULL client_name");
|
|
10440 |
+ return NULL;
|
|
10441 |
}
|
|
10442 |
|
|
10443 |
+ jack_log("jack_client_open %s", client_name);
|
|
10444 |
+
|
|
10445 |
+ if (status == NULL) /* no status from caller? */
|
|
10446 |
+ status = &my_status; /* use local status word */
|
|
10447 |
+ *status = (jack_status_t)0;
|
|
10448 |
+
|
|
10449 |
+ /* validate parameters */
|
|
10450 |
+ if ((options & ~JackOpenOptions)) {
|
|
10451 |
+ int my_status1 = *status | (JackFailure | JackInvalidOption);
|
|
10452 |
+ *status = (jack_status_t)my_status1;
|
|
10453 |
+ return NULL;
|
|
10454 |
+ }
|
|
10455 |
+
|
|
10456 |
+ /* parse variable arguments */
|
|
10457 |
+ jack_varargs_parse(options, ap, &va);
|
|
10458 |
+
|
|
10459 |
if (!JackServerGlobals::Init()) { // jack server initialisation
|
|
10460 |
int my_status1 = (JackFailure | JackServerError);
|
|
10461 |
*status = (jack_status_t)my_status1;
|
|
10462 |
--- a/linux/cycles.h
|
|
10463 |
+++ b/linux/cycles.h
|
|
10464 |
@@ -103,6 +103,20 @@
|
|
10465 |
|
|
10466 |
#endif
|
|
10467 |
|
|
10468 |
+/* everything else but x86, amd64 or ppc */
|
|
10469 |
+#if !defined (__PPC__) && !defined (__x86_64__) && !defined (__i386__)
|
|
10470 |
+
|
|
10471 |
+#warning No suitable get_cycles() implementation. Returning 0 instead
|
|
10472 |
+
|
|
10473 |
+typedef unsigned long long cycles_t;
|
|
10474 |
+
|
|
10475 |
+static inline cycles_t get_cycles(void)
|
|
10476 |
+{
|
|
10477 |
+ return 0;
|
|
10478 |
+}
|
|
10479 |
+
|
|
10480 |
+#endif
|
|
10481 |
+
|
|
10482 |
#endif
|
|
10483 |
|
|
10484 |
#endif /* __jack_cycles_h__ */
|
|
10485 |
--- a/macosx/coremidi/JackCoreMidiDriver.cpp
|
|
10486 |
+++ b/macosx/coremidi/JackCoreMidiDriver.cpp
|
|
10487 |
@@ -40,11 +40,13 @@
|
|
10488 |
void JackCoreMidiDriver::ReadProcAux(const MIDIPacketList *pktlist, jack_ringbuffer_t* ringbuffer)
|
|
10489 |
{
|
|
10490 |
// Write the number of packets
|
|
10491 |
- size_t size = jack_ringbuffer_write(ringbuffer, (char*)&pktlist->numPackets, sizeof(UInt32));
|
|
10492 |
- if (size != sizeof(UInt32)) {
|
|
10493 |
+ size_t size = jack_ringbuffer_write_space(ringbuffer);
|
|
10494 |
+ if (size < sizeof(UInt32)) {
|
|
10495 |
jack_error("ReadProc : ring buffer is full, skip events...");
|
|
10496 |
return;
|
|
10497 |
- }
|
|
10498 |
+ }
|
|
10499 |
+
|
|
10500 |
+ jack_ringbuffer_write(ringbuffer, (char*)&pktlist->numPackets, sizeof(UInt32));
|
|
10501 |
|
|
10502 |
for (unsigned int i = 0; i < pktlist->numPackets; ++i) {
|
|
10503 |
|
|
10504 |
--- a/common/JackClient.cpp
|
|
10505 |
+++ b/common/JackClient.cpp
|
|
10506 |
@@ -1027,7 +1027,8 @@
|
|
10507 |
return 0;
|
|
10508 |
}
|
|
10509 |
|
|
10510 |
- int int_ref, result = -1;
|
|
10511 |
+ int int_ref = 0;
|
|
10512 |
+ int result = -1;
|
|
10513 |
fChannel->InternalClientLoad(GetClientControl()->fRefNum, client_name, va->load_name, va->load_init, options, (int*)status, &int_ref, &result);
|
|
10514 |
return int_ref;
|
|
10515 |
}
|
|
10516 |
--- a/example-clients/ipload.c
|
|
10517 |
+++ b/example-clients/ipload.c
|
|
10518 |
@@ -17,9 +17,9 @@
|
|
10519 |
#include <stdio.h>
|
|
10520 |
#include <stdlib.h>
|
|
10521 |
#include <string.h>
|
|
10522 |
-#include <signal.h>
|
|
10523 |
+#include <signal.h>
|
|
10524 |
#ifndef WIN32
|
|
10525 |
-#include <unistd.h>
|
|
10526 |
+#include <unistd.h>
|
|
10527 |
#endif
|
|
10528 |
#include <getopt.h>
|
|
10529 |
#include <jack/jack.h>
|
|
10530 |
@@ -126,7 +126,7 @@
|
|
10531 |
int
|
|
10532 |
main (int argc, char *argv[])
|
|
10533 |
{
|
|
10534 |
- jack_status_t status;
|
|
10535 |
+ jack_status_t status;
|
|
10536 |
char* name;
|
|
10537 |
|
|
10538 |
/* parse and validate command arguments */
|
|
10539 |
@@ -157,8 +157,8 @@
|
|
10540 |
(JackLoadName|JackLoadInit),
|
|
10541 |
&status, load_name, load_init);
|
|
10542 |
if (status & JackFailure) {
|
|
10543 |
- fprintf (stderr, "could not load %s, status = 0x%2.0x\n",
|
|
10544 |
- load_name, status);
|
|
10545 |
+ fprintf (stderr, "could not load %s, intclient = %d status = 0x%2.0x\n",
|
|
10546 |
+ load_name, intclient, status);
|
|
10547 |
return 2;
|
|
10548 |
}
|
|
10549 |
if (status & JackNameNotUnique) {
|
|
10550 |
@@ -178,23 +178,23 @@
|
|
10551 |
|
|
10552 |
if (wait_opt) {
|
|
10553 |
/* define a signal handler to unload the client, then
|
|
10554 |
- * wait for it to exit */
|
|
10555 |
- #ifdef WIN32
|
|
10556 |
- signal(SIGINT, signal_handler);
|
|
10557 |
- signal(SIGABRT, signal_handler);
|
|
10558 |
- signal(SIGTERM, signal_handler);
|
|
10559 |
- #else
|
|
10560 |
- signal(SIGQUIT, signal_handler);
|
|
10561 |
- signal(SIGTERM, signal_handler);
|
|
10562 |
- signal(SIGHUP, signal_handler);
|
|
10563 |
- signal(SIGINT, signal_handler);
|
|
10564 |
- #endif
|
|
10565 |
-
|
|
10566 |
- while (1) {
|
|
10567 |
- #ifdef WIN32
|
|
10568 |
- Sleep(1000);
|
|
10569 |
+ * wait for it to exit */
|
|
10570 |
+ #ifdef WIN32
|
|
10571 |
+ signal(SIGINT, signal_handler);
|
|
10572 |
+ signal(SIGABRT, signal_handler);
|
|
10573 |
+ signal(SIGTERM, signal_handler);
|
|
10574 |
+ #else
|
|
10575 |
+ signal(SIGQUIT, signal_handler);
|
|
10576 |
+ signal(SIGTERM, signal_handler);
|
|
10577 |
+ signal(SIGHUP, signal_handler);
|
|
10578 |
+ signal(SIGINT, signal_handler);
|
|
10579 |
+ #endif
|
|
10580 |
+
|
|
10581 |
+ while (1) {
|
|
10582 |
+ #ifdef WIN32
|
|
10583 |
+ Sleep(1000);
|
|
10584 |
#else
|
|
10585 |
- sleep (1);
|
|
10586 |
+ sleep (1);
|
|
10587 |
#endif
|
|
10588 |
}
|
|
10589 |
}
|
|
10590 |
--- a/tests/test.cpp
|
|
10591 |
+++ b/tests/test.cpp
|
|
10592 |
@@ -35,6 +35,7 @@
|
|
10593 |
#include <assert.h>
|
|
10594 |
#include <stdarg.h>
|
|
10595 |
#include <jack/jack.h>
|
|
10596 |
+#include <jack/intclient.h>
|
|
10597 |
#include <jack/transport.h>
|
|
10598 |
|
|
10599 |
|
|
10600 |
@@ -632,7 +633,57 @@
|
|
10601 |
if (status & JackServerStarted) {
|
|
10602 |
fprintf(stderr, "JACK server started\n");
|
|
10603 |
}
|
|
10604 |
-
|
|
10605 |
+
|
|
10606 |
+ /**
|
|
10607 |
+ * Internal client tests...
|
|
10608 |
+ *
|
|
10609 |
+ */
|
|
10610 |
+ jack_intclient_t intclient;
|
|
10611 |
+
|
|
10612 |
+ Log("trying to load the \"inprocess\" server internal client \n");
|
|
10613 |
+
|
|
10614 |
+ intclient = jack_internal_client_load (client1, "inprocess",
|
|
10615 |
+ (jack_options_t)(JackLoadName|JackLoadInit),
|
|
10616 |
+ &status, "inprocess", "");
|
|
10617 |
+
|
|
10618 |
+ if (intclient == 0 || status & JackFailure) {
|
|
10619 |
+ printf("!!! ERROR !!! cannot load internal client \"inprocess\" intclient %d status 0x%2.0x !\n", intclient, status);
|
|
10620 |
+ } else {
|
|
10621 |
+
|
|
10622 |
+ Log("\"inprocess\" server internal client loaded\n");
|
|
10623 |
+
|
|
10624 |
+ char* internal_name = jack_get_internal_client_name(client1, intclient);
|
|
10625 |
+ if (strcmp(internal_name, "inprocess") == 0) {
|
|
10626 |
+ Log("jack_get_internal_client_name returns %s\n", internal_name);
|
|
10627 |
+ } else {
|
|
10628 |
+ printf("!!! ERROR !!! jack_get_internal_client_name returns incorrect name %s\n", internal_name);
|
|
10629 |
+ }
|
|
10630 |
+
|
|
10631 |
+ jack_intclient_t intclient1 = jack_internal_client_handle(client1, "inprocess", &status);
|
|
10632 |
+ if (intclient1 == intclient) {
|
|
10633 |
+ Log("jack_internal_client_handle returns correct handle\n");
|
|
10634 |
+ } else {
|
|
10635 |
+ printf("!!! ERROR !!! jack_internal_client_handle returns incorrect handle %d\n", intclient1);
|
|
10636 |
+ }
|
|
10637 |
+
|
|
10638 |
+ // Unload internal client
|
|
10639 |
+ status = jack_internal_client_unload (client1, intclient);
|
|
10640 |
+ if (status == 0) {
|
|
10641 |
+ Log("jack_internal_client_unload done first time returns correct value\n");
|
|
10642 |
+ } else {
|
|
10643 |
+ printf("!!! ERROR !!! jack_internal_client_unload returns incorrect value 0x%2.0x\n", status);
|
|
10644 |
+ }
|
|
10645 |
+
|
|
10646 |
+ // Unload internal client second time
|
|
10647 |
+ status = jack_internal_client_unload (client1, intclient);
|
|
10648 |
+ if (status & JackFailure && status & JackNoSuchClient) {
|
|
10649 |
+ Log("jack_internal_client_unload done second time returns correct value\n");
|
|
10650 |
+ } else {
|
|
10651 |
+ printf("!!! ERROR !!! jack_internal_client_unload returns incorrect value 0x%2.0x\n", status);
|
|
10652 |
+ }
|
|
10653 |
+ }
|
|
10654 |
+
|
|
10655 |
+
|
|
10656 |
/**
|
|
10657 |
* try to register another one with the same name...
|
|
10658 |
*
|