Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/amachronic/microtar.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-25Add missing API checks to convienience functionsHEADmasterAidan MacDonald
Since mtar_write_file/dir_header() modify the cached header, they should perform API checks to detect incorrect usage.
2021-11-25Return non-const header from mtar_get_header()Aidan MacDonald
Rationale: it can be updated and passed to mtar_header_update(), saving a temporary, and without poking around the struct fields.
2021-11-25Remove MTAR_ELASTAidan MacDonald
2021-11-25Allow reading from archives that are opened for writingAidan MacDonald
This operation makes sense now that you can seek backward when writing a new archive member.
2021-11-25Allow seek during writesAidan MacDonald
This allows library users to seek within the written portion of a file and re-write previously written data. This also includes the header, which removes the need to specify file size in advance if the application can tolerate seeking back to update the header at the end of writing, once the actual file size is known.
2021-11-06Add GCC version check for #pragmaAidan MacDonald
2021-11-06Renumber error codes to make them contiguousAidan MacDonald
2021-11-06Add mtar_tell_data() to return offset in dataAidan MacDonald
2021-11-06Allow disabling API checks at compile timeAidan MacDonald
2021-11-06Add EACCESS error and use itAidan MacDonald
Return this error if using an archive in the wrong access mode, ie. write to an archive opened for reading, or vice-versa. Previously EAPI was returned which is probably not as useful.
2021-11-06Add API error checking to mtar_finalize()Aidan MacDonald
2021-11-06Basic archive creation support in mtarAidan MacDonald
This is hardly usable and doesn't handle directories or deal with filenames properly. It's here mainly to test library code.
2021-11-06Bugfixes and rework write APIAidan MacDonald
The code ends up simpler by having callers explicitly end the data stream and finalize the archive instead of trying to do it implicitly. Also fix multiple write related bugs.
2021-11-05Fix a dumb mistakeAidan MacDonald
2021-11-05Update the READMEAidan MacDonald
2021-11-05Change read/write hook return value conventionAidan MacDonald
They now return the number of bytes read or written or a negative error code.
2021-11-05Give names to the enumsAidan MacDonald
However we don't use enum types in the code for ABI reasons.
2021-11-05Add mtar_end_record()Aidan MacDonald
Rationale is similar to providing mtar_finalize(), although it is functionally useless, users may want to see the error code for this operation separately.
2021-11-05Add an ETOOSHORT error and check for itAidan MacDonald
This occurs if the caller did not write out enough data when writing an archive member.
2021-11-05Remove a redundant int return from mtar_init()Aidan MacDonald
2021-11-05Move mtar_open() to another headerAidan MacDonald
It's expected users will provide their own I/O hooks, so mtar_open() does not really belong in microtar.h.
2021-11-05Build with -O2 by defaultAidan MacDonald
2021-11-05Suppress a 'helpful' GCC warning for some correct codeAidan MacDonald
2021-11-05Fix a typoAidan MacDonald
2021-11-05Add dependency information to MakefileAidan MacDonald
2021-11-05Remove unnecessary includesAidan MacDonald
2021-11-05Allow getting access from the APIAidan MacDonald
2021-11-05Keep track of access mode to enforce API usageAidan MacDonald
2021-11-05Add write support (mostly)Aidan MacDonald
2021-11-05Use 'ar cr' in MakefileAidan MacDonald
2021-11-05Add mtar_seek_data()Aidan MacDonald
This allows users to seek within a file without accidentally skipping over the file's boundaries.
2021-11-05Add Makefile and demo appAidan MacDonald
The demo app can list contents and extract tar files using microtar, and serves to demonstrate the API.
2021-11-05Report records with null type as regular filesAidan MacDonald
This saves library users from checking for two possibilities and mirrors what we're doing in header_to_raw().
2021-11-05Add mtar_eof_data()Aidan MacDonald
Returns true when the end of the current file has been reached. Handy when reading file data in a loop.
2021-11-05Add mtar_foreach()Aidan MacDonald
This is a very convienient way of iterating over a tar archive. It can be used for search operations or data extraction and mtar_find() has been re-implemented using it.
2021-11-05Begin API redesignAidan MacDonald
1. Iterating over archive members has been simplified. Reading headers is now implicit; mtar_rewind() jumps to the start of the archive and calling mtar_next() repeatedly returns each header in turn. Use mtar_get_header() to retrieve the header data. 2. Reading file data works similarly to read() / fread() by returning the number of bytes read instead of forcing the caller to work out how many bytes are remaining. The old wraparound behaviour was removed because it is not needed anymore and proved troublesome in practice. 3. Writing data has not yet been implemented.
2021-11-05Specialize round_up -> round_up_512Aidan MacDonald
We don't need to round up to arbitrary multiples; using constants should allow the compiler to optimize better.
2021-11-05Optimization to write_null_bytes()Aidan MacDonald
This will only make a negligible difference on a proper OS and C library, but may assist simpler I/O implementations.
2021-11-05Remove mtar_raw_header_tAidan MacDonald
Prefer accessing the raw data as a plain char array, this makes the code immune to bugs induced by a compiler adding padding between struct fields. (The alternative is to add ugliness to the header to ensure the struct is packed.)
2021-11-04Remove incorrect attempt to enforce binary file IOAidan MacDonald
This was done wrongly, and in any event it is the user's responsibility to use the right mode for the OS.
2021-11-04Move stream ops into mtar_ops_t; separate open and initAidan MacDonald
Moving stream ops into a separate struct lets them be defined in a const object and shared between multiple mtar_t objects. Also provide a new mtar_init() call which accepts the ops struct and initializes the mtar_t object properly.
2021-11-04Restyle the source codeAidan MacDonald
This is frivolous, but I really don't like the current style.
2021-11-04Paste full license text into copyright headersAidan MacDonald
2021-11-04Add myself to the copyright headersAidan MacDonald
2021-05-09Reduce stack usage by avoiding large temporariesamachronic
2021-05-09Fix security flaws and improve overall robustnessamachronic
2017-08-31Merge pull request #2 from deadcast/masterrxi
Added c++ compilation support.
2017-08-31Added c++ compilation support.deadcast
2017-01-16Version 0.1.0v0.1.0rxi
2017-01-16Updated copyright year; 2016 -> 2017rxi