stop & detach driver when exiting due to -T/--temporary flag
[jack.git] / jack / intclient.h
blob36883de58a878ad3bf1218199d73e6d5c6c400d6
1 /*
2 * Copyright (C) 2004 Jack O'Quin
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __jack_intclient_h__
21 #define __jack_intclient_h__
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
27 #include <jack/types.h>
29 /**
30 * Get an internal client's name. This is useful when @ref
31 * JackUseExactName was not specified on jack_internal_client_load()
32 * and @ref JackNameNotUnique status was returned. In that case, the
33 * actual name will differ from the @a client_name requested.
35 * @param client requesting JACK client's handle.
37 * @param intclient handle returned from jack_internal_client_load()
38 * or jack_internal_client_handle().
40 * @return NULL if unsuccessful, otherwise pointer to the internal
41 * client name obtained from the heap via malloc(). The caller should
42 * free() this storage when no longer needed.
44 char *jack_get_internal_client_name (jack_client_t *client,
45 jack_intclient_t intclient);
47 /**
48 * Return the @ref jack_intclient_t handle for an internal client
49 * running in the JACK server.
51 * @param client requesting JACK client's handle.
53 * @param client_name for the internal client of no more than
54 * jack_client_name_size() characters. The name scope is local to the
55 * current server.
57 * @param status (if non-NULL) an address for JACK to return
58 * information from this operation. This status word is formed by
59 * OR-ing together the relevant @ref JackStatus bits.
61 * @return Opaque internal client handle if successful. If 0, the
62 * internal client was not found, and @a *status includes the @ref
63 * JackNoSuchClient and @ref JackFailure bits.
65 jack_intclient_t jack_internal_client_handle (jack_client_t *client,
66 const char *client_name,
67 jack_status_t *status);
69 /**
70 * Load an internal client into the JACK server.
72 * Internal clients run inside the JACK server process. They can use
73 * most of the same functions as external clients. Each internal
74 * client is built as a shared object module, which must declare
75 * jack_initialize() and jack_finish() entry points called at load and
76 * unload times. See @ref inprocess.c for an example.
78 * @param client loading JACK client's handle.
80 * @param client_name of at most jack_client_name_size() characters
81 * for the internal client to load. The name scope is local to the
82 * current server.
84 * @param options formed by OR-ing together @ref JackOptions bits.
85 * Only the @ref JackLoadOptions bits are valid.
87 * @param status (if non-NULL) an address for JACK to return
88 * information from the load operation. This status word is formed by
89 * OR-ing together the relevant @ref JackStatus bits.
91 * <b>Optional parameters:</b> depending on corresponding [@a options
92 * bits] additional parameters may follow @a status (in this order).
94 * @arg [@ref JackLoadName] <em>(char *) load_name</em> is the shared
95 * object file from which to load the new internal client (otherwise
96 * use the @a client_name).
98 * @arg [@ref JackLoadInit] <em>(char *) load_init</em> an arbitary
99 * string passed to the internal client's jack_initialize() routine
100 * (otherwise NULL), of no more than @ref JACK_LOAD_INIT_LIMIT bytes.
102 * @return Opaque internal client handle if successful. If this is 0,
103 * the load operation failed, the internal client was not loaded, and
104 * @a *status includes the @ref JackFailure bit.
106 jack_intclient_t jack_internal_client_load (jack_client_t *client,
107 const char *client_name,
108 jack_options_t options,
109 jack_status_t *status, ...);
111 * Unload an internal client from a JACK server. This calls the
112 * intclient's jack_finish() entry point then removes it. See @ref
113 * inprocess.c for an example.
115 * @param client unloading JACK client's handle.
117 * @param intclient handle returned from jack_internal_client_load() or
118 * jack_internal_client_handle().
120 * @return 0 if successful, otherwise @ref JackStatus bits.
122 jack_status_t jack_internal_client_unload (jack_client_t *client,
123 jack_intclient_t intclient);
125 #ifdef __cplusplus
127 #endif
129 #endif /* __jack_intclient_h__ */