diff options
Diffstat (limited to 'src/ustar.h')
-rw-r--r-- | src/ustar.h | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/src/ustar.h b/src/ustar.h index a5bb461..3495d38 100644 --- a/src/ustar.h +++ b/src/ustar.h @@ -41,11 +41,7 @@ struct opkg_opk_ustar_member { struct opkg_opk_ustar_member *next; }; -struct opkg_opk_ustar_seek_name { - const char *name; - int found; - struct opkg_opk_ustar_seek_name *next; -}; +struct opkg_opk_ustar_seek_name; /* * Allocates and initializes an archive structure. @@ -76,26 +72,32 @@ opkg_opk_ustar_list(struct opkg_opk_ustar *ustar, /* * Adds a name to a list of names to find with opkg_opk_ustar_seek(). List is - * dynamically allocated; free with free(). + * dynamically allocated; free with opkg_opk_ustar_free_seek_names(). * Parameters: - * - head: Address in which to store address of list head. - * - tail: Address in which to store address of list tail. - * - name: Name of member file to find. + * - names: Address in which to store address of list. + * - name: Name of member file to find. * Returns: * - OPKG_OPK_OK if the name was added to the list. * - OPKG_OPK_ERROR on memory exhaustion. */ int -opkg_opk_ustar_add_seek_name(struct opkg_opk_ustar_seek_name **head, - struct opkg_opk_ustar_seek_name **tail, const char *name); +opkg_opk_ustar_add_seek_name(struct opkg_opk_ustar_seek_name **names, + const char *name); + +/* + * Frees a list of names to find with opkg_opk_ustar_seek(). + * Parameters: + * - names: List of names. + */ +void +opkg_opk_ustar_free_seek_names(struct opkg_opk_ustar_seek_name *names); /* * Advances to a named member file. May be called multiple times until all * requested members are found. * Parameters: * - ustar: Archive structure. - * - names: Name(s) to find. Member "found" will be set to "1" on the first - * name found. + * - names: Name(s) to find. * Returns: * - OPKG_OPK_OK if a member matching one of the requested names is found but * more names remain to be found. @@ -109,6 +111,19 @@ opkg_opk_ustar_seek(struct opkg_opk_ustar *ustar, struct opkg_opk_ustar_seek_name *names); /* + * Advances to a named member file. + * Parameters: + * - ustar: Archive structure. + * - name: Name to find. + * Returns: + * - OPKG_OPK_OK if a member matching the requested name is found. + * - OPKG_OPK_ERROR if no matching member is found or on decompression error, an + * invalid header, or unsupported file type. + */ +int +opkg_opk_ustar_seek_one(struct opkg_opk_ustar *ustar, const char *name); + +/* * Reads up to a record (512 octets) of member file data at a time. * Parameters: * - ustar: Archive structure. |