1 /* LIBGIMP - The GIMP Library
2 * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
6 * This library is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <https://www.gnu.org/licenses/>.
23 #include <string.h> /* memcmp */
28 * gimp_procedural_db_proc_info:
29 * @procedure: The procedure name.
30 * @blurb: A short blurb.
31 * @help: Detailed procedure help.
32 * @author: Author(s) of the procedure.
33 * @copyright: The copyright.
34 * @date: Copyright date.
35 * @proc_type: The procedure type.
36 * @num_args: The number of input arguments.
37 * @num_values: The number of return values.
38 * @args: The input arguments.
39 * @return_vals: The return values.
41 * Queries the procedural database for information on the specified
44 * This procedure returns information on the specified procedure. A
45 * short blurb, detailed help, author(s), copyright information,
46 * procedure type, number of input, and number of return values are
47 * returned. Additionally this function returns specific information
48 * about each input argument and return value.
50 * Returns: TRUE on success.
53 gimp_procedural_db_proc_info (const gchar
*procedure
,
59 GimpPDBProcType
*proc_type
,
63 GimpParamDef
**return_vals
)
66 gboolean success
= TRUE
;
68 success
= _gimp_procedural_db_proc_info (procedure
,
80 *args
= g_new (GimpParamDef
, *num_args
);
81 *return_vals
= g_new (GimpParamDef
, *num_values
);
83 for (i
= 0; i
< *num_args
; i
++)
85 if (! gimp_procedural_db_proc_arg (procedure
,
89 &(*args
)[i
].description
))
92 g_free (*return_vals
);
98 for (i
= 0; i
< *num_values
; i
++)
100 if (! gimp_procedural_db_proc_val (procedure
,
102 &(*return_vals
)[i
].type
,
103 &(*return_vals
)[i
].name
,
104 &(*return_vals
)[i
].description
))
107 g_free (*return_vals
);
118 * gimp_procedural_db_get_data:
119 * @identifier: The identifier associated with data.
120 * @data: A byte array containing data.
122 * Returns data associated with the specified identifier.
124 * This procedure returns any data which may have been associated with
125 * the specified identifier. The data is copied into the given memory
128 * Returns: TRUE on success, FALSE if no data has been associated with
132 gimp_procedural_db_get_data (const gchar
*identifier
,
139 success
= _gimp_procedural_db_get_data (identifier
,
144 memcpy (data
, (gconstpointer
) hack
, size
* sizeof (guint8
));
152 * gimp_procedural_db_set_data:
153 * @identifier: The identifier associated with data.
154 * @data: A byte array containing data.
155 * @bytes: The number of bytes in the data
157 * Associates the specified identifier with the supplied data.
159 * This procedure associates the supplied data with the provided
160 * identifier. The data may be subsequently retrieved by a call to
161 * 'procedural-db-get-data'.
163 * Returns: TRUE on success.
166 gimp_procedural_db_set_data (const gchar
*identifier
,
170 return _gimp_procedural_db_set_data (identifier
,