Commit Graph

39 Commits

Author SHA1 Message Date
Andrew Hyatt
e11125fbf2
Disable installation 2018-06-03 14:59:26 -04:00
Andrew Hyatt
a37f07c125
Rename util to util_xcbuild 2018-05-22 22:55:43 -04:00
Stephane Sezer
0a2246ec23 Extra error checking for zero-size files on Windows
We can't map zero-size files on Windows, we need to check for these
values before calling `CreateFileMapping`.
2017-12-18 13:14:35 -08:00
Stephane Sezer
376d9c5a7f Properly check for errors with CreateFileMapping
On error, `CreateFileMapping` returns NULL, not INVALID_HANDLE_VALUE.
2017-12-18 13:14:35 -08:00
Kellie Medlin
34e535ea7d [libbom/libcar] Build fixes for local setup
+ Include onhachoe's comments from PR.

Change-Id: Idf3d93d617cce81ecd80947f97a51057a070a0ef
2017-11-14 13:06:03 -08:00
Kellie Medlin
af27dd2bc4 [libbom/libcar] Minor fixes to BOM writer
- When new indices are added to a BOM, the extra spaces are now zero'd out instead of left as
junk memory.  The space after the index table seems to be hidden metadata about a freelist, so
having this data randomized is not good.
- Add support for inserting freelist data at the end of the index table.
- Sorted entries added to a BOM tree, which appears expected by apps searching through BOM trees.
2017-11-14 13:06:03 -08:00
Kellie Medlin
d63a2a97fe [libbom] Add dump_bom as an installable and improve the information it drops
dump_bom is super useful for inspecting the contents of .car files. I'd like to expose it officially.
2017-11-14 13:06:03 -08:00
Onha Choe
340985ebfd Fix windows lib casing
Change-Id: I7cfa47a40c37f45e9a25f943cdc0a9950b354e49
2017-10-18 23:13:21 -07:00
Onha Choe
7631a5edc0 Fix library name casing.
Change-Id: Iba57c4f57a1cc19fab164a85f2303775fbf1be08
2017-10-18 11:26:55 -07:00
Grant Paul
11992c4e79 Add support for memory mapping BOM files on Windows. 2017-06-19 11:52:20 -07:00
Stephane Sezer
4836a9755b De-duplicate the packed struct definition 2017-06-19 11:52:20 -07:00
Grant Paul
daa326ae9f Add MSVC support for zero-length arrays and packed structs. 2017-06-19 11:52:20 -07:00
Grant Paul
1f6710d50a Add Windows support for byte order manipulation. 2017-06-19 11:52:20 -07:00
Grant Paul
7a001832a9 Add Windows, MSVC, and MinGW support to build configuration.
- Set to use static or dynamic libraries at top level.
 - Compiler configuration for MSVC and MinGW.
 - Copy rather than create symlink for aliases on Windows.
2017-06-19 11:52:20 -07:00
Onha Choe
65364aa249 Fix bom variable offset.
Some of the vars->first were changed to vars + sizeof(struct bom_varaible) in #202
where it really had to be sizeof(struct bom_variables)
2017-01-31 02:00:15 -08:00
Grant Paul
2f87e85363 Correct casts and pointer arithmetic.
Do pointer arithmetic only happen on typed pointers or integer
representations of pointers, not void pointers. Cast integer and
floating point types explicitly when reducing precision.
2016-12-14 17:01:15 -08:00
Grant Paul
73159fa205 Avoid incorrect third parameter for command-line option parsing.
The current option functions don't take an iterator, but do take
an option for supporting duplicate options. Don't pass an iterator
as a boolean.
2016-12-14 17:01:15 -08:00
Grant Paul
bf3c57a44e Support short options in lsbom.
Short options can be combined and used as a single flag. For split
short options, the value can follow in a combined option or in the
next option.
2016-11-28 11:01:52 -08:00
brtsai
4357d4dccf made default usage print size and checksum for files 2016-11-04 18:58:35 -07:00
brtsai
82e641471f renamed octConvertingStream to stream 2016-11-04 18:58:35 -07:00
brtsai
2a401e275c made lsbom default usage print correct info
default usage prints mode(oct) and UID/GID now
2016-11-04 18:58:35 -07:00
Grant Paul
9ccf7c40ae Store order of print options in BOM list options. 2016-11-04 18:58:35 -07:00
Stephane Sezer
4fe6df20cb Fix an off-by-one in libbom 2016-10-03 13:06:25 -07:00
Grant Paul
e7b519503c Fix minor issues revealed by static analysis. 2016-09-02 22:59:40 -07:00
Grant Paul
57e8d04685 Simplify pre-allocating BOM indexes and BOM tree entries.
Use a single reserve method to reserve space in BOM indexes or in a
BOM tree's entry index, rather than specifying on initialization.
This better supports reserving additional space after allocation,
which is needed in any case, without sacrificing performance.
2016-08-31 17:35:06 -07:00
Marc Salem
596b529f86 Make reading and writing CAR files faster (#107)
* Support faster writes by preallocating indexes
* Allow reading and writing raw key value pairs in libcar
* Remove bom_alloc_empty and bom_tree_alloc_empty
* Keep space for two extra indexes for compatibility
* Include struct bom_variables when checking minimum size of BOM memory
* Remove preallocated_index_count
* Refactor resizing code
* Add API to increase the size of the BOM index free list
* Optimize CAR write by pre-allocting BOM indexes
2016-08-31 16:36:47 -07:00
Grant Paul
42c53c39ce Use optionals in parsing command line arguments. (#95)
Instead of checking if strings are empty, use optionals to store if
the arguments were passed at all. Additionally, add a few utility
methods to the option parser to simplify various tool option classes.
2016-07-27 17:38:07 -07:00
Grant Paul
c25336b50b Install into a developer root, rather than a Unix layout.
Executables are installed into `<prefix>/usr/bin and `<prefix>/usr/lib`.
Specifications are installed into `<prefix>/Library/Xcode/Specifications`.
2016-06-16 11:28:17 -07:00
Grant Paul
0bcd83f24d Replace temporary file with in-memory storage for car tests.
This helps keep the tests isolated and tests the in-memory path.
2016-05-29 16:17:58 -07:00
Marc Salem
77e0d2653e Fix compiler warning (#60) 2016-05-27 13:45:28 -07:00
Grant Paul
15110f9157 Minor style cleanup for various asset code. 2016-05-26 12:43:47 -07:00
Marc Salem
c20f6d2913 Car writer (#51)
* Add minimum size for BOM file when creating

* Add serialization and tests for AttributeList

* Optimize load time for Reader

Save pointers to construct Facets and Rendition objects on demand

* Add serialization and tests for Facet

* More complete Rendition object

Add methods for more properties, including:
  width, height, is_opaque, is_vector,
  is_resizable, resize_mode, uti
Add serialization code and unit test

* Add CAR file Writer object and unit test

Support for writing a CAR/BOM file with:
- CAR header
- keyfmt
- facets
- renditions

* A faster dump_car tool

* Avoid using string_view

* Clean up after test_car_Writer

* Clean up libcar

Covert tabs to spaces
Camel case for properties
Make most use of Rendition const again
Use reinterpret_cast
remove iterators from Writer
Check CAR header magic, and write it using strncpy
conform to for loop style

* Fix Linux compile errors

* Ensure attributes in Facet Value are ordered

Sort the attribute pairs in car_facet_value by identifier.
2016-05-26 12:30:15 -07:00
Grant Paul
aeeb3579ba Support CMake installation of libraries and executables. 2016-05-24 18:11:51 -07:00
Grant Paul
f00f186e1a Update license headers for asset catalog code. 2016-04-15 20:49:39 -07:00
Grant Paul
2c18367d68 Fixes for Linux and GCC builds.
- Use add_compile_options() in CMake to avoid duplicate lines.
 - Add missing includes as needed for Linux compilation.
 - Add required macro to access ftruncate() on Linux in C99 mode.
 - Switch to C++11 random numbers instead of arc4random for portability.
 - Workaround GCC issue with references to packed struct fields.
 - Fix missing default case required by GCC.
2016-04-15 20:40:52 -07:00
Grant Paul
8f4a8f9e51 Speed up BOM index accesses significantly.
Rathern than loop to find the index, directly load the index from
the BOM. This changes bom_index_get() from O(N) to O(1), which also
speeds up operations for BOM trees which heavily use bom_index_get().
2016-04-15 19:24:17 -07:00
Grant Paul
692122796f Add simple implementation of lsbom tool using libbom. 2016-04-15 19:24:17 -07:00
Grant Paul
1f09ee2ec6 Add simple tool to dump structure of BOM files using libbom. 2016-04-15 19:24:17 -07:00
Grant Paul
6dd08e524e Initial import of libbom and libcar. 2016-04-15 19:24:17 -07:00