X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/ef13e9a46baaa347014ac236f36a2536f055b108..e564e3f84ad0ea42b78559c0bfe304893fd5e76b:/key-data.h diff --git a/key-data.h b/key-data.h index 2a8620a..d6a5636 100644 --- a/key-data.h +++ b/key-data.h @@ -7,7 +7,7 @@ * (c) 1999 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,12 +15,12 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, @@ -245,7 +245,7 @@ extern key_data *key_newbinary(unsigned /*e*/, extern key_data *key_newencrypted(unsigned /*e*/, const void */*p*/, size_t /*sz*/); -/* --- @key_mewmp@ --- * +/* --- @key_newmp@ --- * * * Arguments: @unsigned e@ = other encoding flags * @mp *m@ = pointer to the value to set @@ -393,7 +393,7 @@ extern void key_destroy(key_data */*k*/); if (_k->ref == 0) \ key_destroy(_k); \ } while (0) - + extern void key_drop(key_data */*k*/); /* --- @key_do@ --- * @@ -406,7 +406,7 @@ extern void key_drop(key_data */*k*/); * * Returns: Nonzero return code from function, or zero. * - * Use: Runs a function over all the leaves of a key. + * Use: Runs a function over all the leaves of a key. */ extern int key_do(key_data */*k*/, const key_filter */*kf*/, dstr */*d*/, @@ -414,6 +414,22 @@ extern int key_do(key_data */*k*/, const key_filter */*kf*/, dstr */*d*/, dstr */*d*/, void */*p*/), void */*p*/); +/* --- @key_copydata@ --- * + * + * Arguments: @key_data *k@ = key data to copy + * @const key_filter *kf@ = pointer to filter block + * + * Returns: Pointer to a copy of the data, or null if the root subkey + * didn't match the filter. + * + * Use: Copies a chunk of key data. Subkeys, whether they're + * structured or leaves, which don't match the filter aren't + * copied. The copy may or may not have structure in common + * with the original. + */ + +extern key_data *key_copydata(key_data */*k*/, const key_filter */*kf*/); + /*----- Textual encoding --------------------------------------------------*/ /* --- @key_read@ --- *